Fix Totalconnect BinarySensorDeviceClass logic (#94772)

* handle temperature

* test for temperature

* test for unknown
This commit is contained in:
Austin Mroczek 2023-06-20 13:12:11 -07:00 committed by GitHub
parent 6183a36fce
commit 252c0e8ad9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 11 deletions

View file

@ -81,15 +81,9 @@ class TotalConnectZoneSecurityBinarySensor(TotalConnectZoneBinarySensor):
return BinarySensorDeviceClass.MOTION
if self._zone.is_type_medical():
return BinarySensorDeviceClass.SAFETY
# "security" type is a generic category so test for it last
if self._zone.is_type_security():
return BinarySensorDeviceClass.DOOR
_LOGGER.error(
"TotalConnect zone %s reported an unexpected device class",
self._zone.zoneid,
)
return None
if self._zone.is_type_temperature():
return BinarySensorDeviceClass.PROBLEM
return BinarySensorDeviceClass.DOOR
def update(self):
"""Return the state of the device."""