Use short hand entity_registry_enabled_default in nws (#100227)
* Use short hand entity_registry_enabled_default in nws see https://github.com/home-assistant/core/pull/95315 * Update homeassistant/components/nws/sensor.py
This commit is contained in:
parent
93f3bc6c2b
commit
70c6bceaee
1 changed files with 1 additions and 5 deletions
|
@ -149,6 +149,7 @@ class NWSWeather(CoordinatorWeatherEntity):
|
|||
self.station = self.nws.station
|
||||
|
||||
self.mode = mode
|
||||
self._attr_entity_registry_enabled_default = mode == DAYNIGHT
|
||||
|
||||
self.observation: dict[str, Any] | None = None
|
||||
self._forecast_hourly: list[dict[str, Any]] | None = None
|
||||
|
@ -352,8 +353,3 @@ class NWSWeather(CoordinatorWeatherEntity):
|
|||
"""
|
||||
await self.coordinator.async_request_refresh()
|
||||
await self.coordinator_forecast_legacy.async_request_refresh()
|
||||
|
||||
@property
|
||||
def entity_registry_enabled_default(self) -> bool:
|
||||
"""Return if the entity should be enabled when first added to the entity registry."""
|
||||
return self.mode == DAYNIGHT
|
||||
|
|
Loading…
Add table
Reference in a new issue