Skip to content

Commit

Permalink
Improve properties
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi committed Jan 2, 2019
1 parent 1332aa2 commit 99417af
Showing 1 changed file with 34 additions and 4 deletions.
38 changes: 34 additions & 4 deletions miio/aircondition.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,45 @@ def temperature(self) -> int:
"""Current temperature."""
return self.data['temp_dec'] / 10.0

@property
def ot_run_temperature(self) -> int:
"""Outdoor operation temperature."""
return self.data['ot_run_temp']

@property
def ep_temperature(self) -> int:
"""Outer ring temperature."""
return self.data['ep_temp']

@property
def es_temperature(self) -> int:
"""Outer ring temperature."""
return self.data['es_temp']

@property
def he_temperature(self) -> int:
"""Outlet temperature."""
return self.data['he_temp']

@property
def target_temperature(self) -> int:
"""Target temperature."""
return self.data['st_temp_dec'] / 10.0

@property
def humidity(self) -> Optional[int]:
"""Current humidity."""
"""Current indoor humidity."""
return self.data["humidity"]

def external_humidity(self) -> Optional[int]:
"""Current external humidity."""
return self.data["ex_humidity"]

@property
def outdoor_humidity(self) -> Optional[int]:
"""Current outdoor humidity."""
return self.data["ot_humidity"]

@property
def mode(self) -> Optional[OperationMode]:
"""Current operation mode."""
Expand All @@ -109,7 +134,7 @@ def mode(self) -> Optional[OperationMode]:

@property
def lcd_auto(self) -> bool:
"""Lcd auto?."""
"""Automatic display brightness."""
return self.data['lcd_auto'] == 'on'

@property
Expand All @@ -124,7 +149,7 @@ def audio(self) -> bool:

@property
def swing(self) -> bool:
"""Swing."""
"""Vertical swing."""
return self.data['vertical_swing'] == 'on'

@property
Expand Down Expand Up @@ -164,7 +189,7 @@ def speed(self) -> int:

@property
def compressor_frequency(self) -> int:
"""Compressor frequency."""
"""Compressor frequency in Hz."""
return self.data['compressor_frq']

@property
Expand All @@ -177,6 +202,11 @@ def swing_range(self) -> [int, int]:
"""Swing range."""
return [self.data['vertical_rt'], self.data['vertical_end']]

@property
def power_consumption(self) -> float:
"""Power consumption in kWh."""
return self.data['ele_quantity'] / 10.0

@property
def extra_features(self) -> Optional[int]:
return self.data["app_extra"]
Expand Down

0 comments on commit 99417af

Please sign in to comment.