1
0
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:
Adrian Sampson 2020-01-22 16:09:34 -07:00 committed by GitHub
commit d8389f3bee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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."""