From 7ae1d1e391ed8e68df133cf3398fd8b3fc0ecd9f Mon Sep 17 00:00:00 2001 From: Simone Rossetto Date: Thu, 27 Oct 2022 21:27:21 +0200 Subject: [PATCH] Set enabled flag for wifi signal sensor --- custom_components/daikin_residential/sensor.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/custom_components/daikin_residential/sensor.py b/custom_components/daikin_residential/sensor.py index 53811d6..578f435 100644 --- a/custom_components/daikin_residential/sensor.py +++ b/custom_components/daikin_residential/sensor.py @@ -203,12 +203,9 @@ def state_class(self): class DaikinGatewaySensor(DaikinSensor): """Representation of a WiFi Sensor.""" - + # set default category for these entities _attr_entity_category = EntityCategory.DIAGNOSTIC - - # auto disable these entities when added for the first time - _attr_entity_registry_enabled_default = False @property def state(self): @@ -231,3 +228,8 @@ def state_class(self): return STATE_CLASS_MEASUREMENT else: return None + + @property + def entity_registry_enabled_default(self): + # auto disable these entities when added for the first time except the wifi signal + return (self._device_attribute == ATTR_WIFI_STRENGTH)