1
0
mirror of https://github.com/no2chem/wideq.git synced 2025-05-16 07:10:09 -07:00

avoid crashing if DisplayControl is not supported

This commit is contained in:
David 2020-01-22 13:10:56 -05:00
parent acc8603c9e
commit 7d6033a437

View File

@ -264,8 +264,11 @@ 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:
return 0 # Device does not support reporting display light status
def get_volume(self):
"""Get the speaker volume level."""