Skip to content

Commit

Permalink
The return type of "volume" is optional now. The Air Purifier 2 doesn…
Browse files Browse the repository at this point in the history
…'t support the property.
  • Loading branch information
syssi committed Jan 22, 2018
1 parent ea756d0 commit 962ba53
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions miio/airpurifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(self, data: Dict[str, Any]) -> None:
'child_lock': 'off', 'limit_hum': null, 'trans_level': null,
'bright': 71, 'favorite_level': 17, 'filter1_life': 77,
'act_det': null, 'f1_hour_used': 771, 'use_time': 2776200,
'motor1_speed': 0]
'motor1_speed': 0, 'volume': 100]
Response of a Air Purifier 2:
Expand All @@ -45,7 +45,7 @@ def __init__(self, data: Dict[str, Any]) -> None:
'filter1_life': 80, 'f1_hour_used': 682, 'use_time': 2457000,
'motor1_speed': 354, 'purify_volume': 25262, 'f1_hour': 3500,
'led': 'off', 'led_b': 2, 'bright': None, 'buzzer': 'off',
'child_lock': 'off'}
'child_lock': 'off', 'volume': None}
A request is limited to 16 properties.
"""
Expand Down Expand Up @@ -150,7 +150,7 @@ def motor_speed(self) -> int:
return self.data["motor1_speed"]

@property
def volume(self) -> int:
def volume(self) -> Optional[int]:
"""Volume of sound notifications [0-100]."""
return self.data["volume"]

Expand Down

0 comments on commit 962ba53

Please sign in to comment.