Skip to content

Commit

Permalink
fix: only replace data information if API data is present
Browse files Browse the repository at this point in the history
  • Loading branch information
geertmeersman committed Dec 16, 2024
1 parent 027277c commit 90f5b79
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions custom_components/mobile_vikings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ async def get_data(self) -> dict | None:
if self._init:
self._init = False
for key, value in data.items():
# Check if the value is a dictionary and contains an "error" key
if isinstance(value, dict) and value.get("error"):
continue # Skip this key if "error" is present
self.data[key] = value
await self.store.async_save(self.data)

Expand Down

0 comments on commit 90f5b79

Please sign in to comment.