Make zwave_js last seen sensor enabled by default (#109191)

* Make zwave_js last seen sensor enabled by default

* Add test

* Fix test

* improve tests
This commit is contained in:
Raman Gupta 2024-01-31 20:55:48 -05:00 committed by GitHub
parent 08f8f84f61
commit 2b525ed2e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 48 additions and 19 deletions

View file

@ -343,6 +343,7 @@ class ZWaveJSStatisticsSensorEntityDescription(SensorEntityDescription):
convert: Callable[
[ControllerStatisticsDataType | NodeStatisticsDataType, str], Any
] = lambda statistics, key: statistics.get(key)
entity_registry_enabled_default: bool = False
# Controller statistics descriptions
@ -487,6 +488,7 @@ ENTITY_DESCRIPTION_NODE_STATISTICS_LIST = [
else None
)
),
entity_registry_enabled_default=True,
),
]
@ -930,7 +932,6 @@ class ZWaveStatisticsSensor(SensorEntity):
entity_description: ZWaveJSStatisticsSensorEntityDescription
_attr_should_poll = False
_attr_entity_category = EntityCategory.DIAGNOSTIC
_attr_entity_registry_enabled_default = False
_attr_has_entity_name = True
def __init__(