Catch more zwave_js errors (#46957)

This commit is contained in:
Martin Hjelmare 2021-02-23 16:36:53 +01:00 committed by GitHub
parent 7a7147edcf
commit c94968d811
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 3 deletions

View file

@ -261,7 +261,10 @@ class ZWaveClimate(ZWaveBaseEntity, ClimateEntity):
if self._current_mode and self._current_mode.value is None:
# guard missing value
return None
temp = self._setpoint_value(self._current_mode_setpoint_enums[0])
try:
temp = self._setpoint_value(self._current_mode_setpoint_enums[0])
except ValueError:
return None
return temp.value if temp else None
@property
@ -270,7 +273,10 @@ class ZWaveClimate(ZWaveBaseEntity, ClimateEntity):
if self._current_mode and self._current_mode.value is None:
# guard missing value
return None
temp = self._setpoint_value(self._current_mode_setpoint_enums[1])
try:
temp = self._setpoint_value(self._current_mode_setpoint_enums[1])
except ValueError:
return None
return temp.value if temp else None
@property