From 700fe624b2373d88661749370343231f1e664bfc Mon Sep 17 00:00:00 2001 From: Necroneco Date: Tue, 27 Feb 2024 10:36:45 +0800 Subject: [PATCH] fix code error --- custom_components/aqara_gateway/binary_sensor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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):