Skip to content

Commit

Permalink
Set enabled flag for wifi signal sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
droscy authored and rospogrigio committed Oct 28, 2022
1 parent 127e2e2 commit 7ae1d1e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions custom_components/daikin_residential/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)

0 comments on commit 7ae1d1e

Please sign in to comment.