diff --git a/custom_components/aqara_gateway/binary_sensor.py b/custom_components/aqara_gateway/binary_sensor.py index 10d7ef6..0387725 100755 --- a/custom_components/aqara_gateway/binary_sensor.py +++ b/custom_components/aqara_gateway/binary_sensor.py @@ -110,6 +110,10 @@ def update(self, data: dict = None): self.schedule_update_ha_state() + def reset_state(self): + self._state = '' + self.async_write_ha_state() + class GatewayNatgasSensor(GatewayBinarySensor, BinarySensorEntity): """Representation of a Xiaomi/Aqara Natgas Sensor.""" @@ -159,10 +163,6 @@ def update(self, data: dict = None): self._state = not value self.schedule_update_ha_state() - - def reset_state(self): - self._state = '' - self.async_write_ha_state() class GatewayMotionSensor(GatewayBinarySensor):