mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Fix LaCrosse View not updating (#79474)
This commit is contained in:
parent
da960f6ed4
commit
d6a6d0d754
@ -105,7 +105,7 @@ async def async_setup_entry(
|
||||
sensors: list[Sensor] = coordinator.data
|
||||
|
||||
sensor_list = []
|
||||
for sensor in sensors:
|
||||
for i, sensor in enumerate(sensors):
|
||||
for field in sensor.sensor_field_names:
|
||||
description = SENSOR_DESCRIPTIONS.get(field)
|
||||
if description is None:
|
||||
@ -125,6 +125,7 @@ async def async_setup_entry(
|
||||
coordinator=coordinator,
|
||||
description=description,
|
||||
sensor=sensor,
|
||||
index=i,
|
||||
)
|
||||
)
|
||||
|
||||
@ -144,6 +145,7 @@ class LaCrosseViewSensor(
|
||||
description: LaCrosseSensorEntityDescription,
|
||||
coordinator: DataUpdateCoordinator[list[Sensor]],
|
||||
sensor: Sensor,
|
||||
index: int,
|
||||
) -> None:
|
||||
"""Initialize."""
|
||||
super().__init__(coordinator)
|
||||
@ -157,11 +159,11 @@ class LaCrosseViewSensor(
|
||||
"model": sensor.model,
|
||||
"via_device": (DOMAIN, sensor.location.id),
|
||||
}
|
||||
self._sensor = sensor
|
||||
self.index = index
|
||||
|
||||
@property
|
||||
def native_value(self) -> float | str:
|
||||
"""Return the sensor value."""
|
||||
return self.entity_description.value_fn(
|
||||
self._sensor, self.entity_description.key
|
||||
self.coordinator.data[self.index], self.entity_description.key
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user