From 7d6033a437de511b82b723b1be74b5c5033209a6 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 22 Jan 2020 13:10:56 -0500 Subject: [PATCH] avoid crashing if DisplayControl is not supported --- wideq/ac.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wideq/ac.py b/wideq/ac.py index 93ccb6a..790c5f5 100644 --- a/wideq/ac.py +++ b/wideq/ac.py @@ -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."""