Add state_class support to Rest (#58026)

This commit is contained in:
Chris Browet 2021-10-22 22:48:13 +02:00 committed by GitHub
parent ee087c7a05
commit 1867d24b18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 52 additions and 21 deletions

View file

@ -85,14 +85,14 @@ class RestBinarySensor(RestEntity, BinarySensorEntity):
resource_template,
):
"""Initialize a REST binary sensor."""
super().__init__(
coordinator, rest, name, device_class, resource_template, force_update
)
super().__init__(coordinator, rest, name, resource_template, force_update)
self._state = False
self._previous_data = None
self._value_template = value_template
self._is_on = None
self._attr_device_class = device_class
@property
def is_on(self):
"""Return true if the binary sensor is on."""