mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Fix small inconsistency in OpenUV data storage (#64717)
This commit is contained in:
parent
0f7e9177a2
commit
a70c980283
@ -161,7 +161,7 @@ class OpenUV:
|
||||
f"Error during protection data update: {err}"
|
||||
) from err
|
||||
|
||||
self.data[DATA_PROTECTION_WINDOW] = data["result"]
|
||||
self.data[DATA_PROTECTION_WINDOW] = data.get("result")
|
||||
|
||||
async def async_update_uv_index_data(self) -> None:
|
||||
"""Update sensor (uv index, etc) data."""
|
||||
@ -172,7 +172,7 @@ class OpenUV:
|
||||
f"Error during UV index data update: {err}"
|
||||
) from err
|
||||
|
||||
self.data[DATA_UV] = data
|
||||
self.data[DATA_UV] = data.get("result")
|
||||
|
||||
async def async_update(self) -> None:
|
||||
"""Update sensor/binary sensor data."""
|
||||
|
@ -134,7 +134,7 @@ class OpenUvSensor(OpenUvEntity, SensorEntity):
|
||||
@callback
|
||||
def update_from_latest_data(self) -> None:
|
||||
"""Update the state."""
|
||||
if not (data := self.openuv.data[DATA_UV].get("result")):
|
||||
if (data := self.openuv.data[DATA_UV]) is None:
|
||||
self._attr_available = False
|
||||
return
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user