Added Device_class for firmware update binary sensor, fixes #137

This commit is contained in:
tomaae 2021-12-14 20:59:59 +01:00
parent 72f8f1bc64
commit 86a4dd358f

View file

@ -261,6 +261,14 @@ class MikrotikControllerBinarySensor(BinarySensorEntity):
"""Return the state attributes."""
return self._attrs
@property
def device_class(self) -> Optional[str]:
"""Return the device class."""
if ATTR_DEVICE_CLASS in self._type:
return self._type[ATTR_DEVICE_CLASS]
return None
@property
def unique_id(self) -> str:
"""Return a unique id for this entity."""