mirror of
https://github.com/no2chem/wideq.git
synced 2025-05-16 07:10:09 -07:00
Merge pull request #81 from dacrypt/master
avoid crashing if DisplayControl is not supported
This commit is contained in:
commit
d8389f3bee
@ -264,8 +264,13 @@ class ACDevice(Device):
|
||||
def get_light(self):
|
||||
"""Get a Boolean indicating whether the display light is on."""
|
||||
|
||||
value = self._get_control('DisplayControl')
|
||||
return value == '0' # Seems backwards, but isn't.
|
||||
try:
|
||||
value = self._get_control('DisplayControl')
|
||||
return value == '0' # Seems backwards, but isn't.
|
||||
except FailedRequestError:
|
||||
# Device does not support reporting display light status.
|
||||
# Since it's probably not changeable the it must be on.
|
||||
return True
|
||||
|
||||
def get_volume(self):
|
||||
"""Get the speaker volume level."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user