Skip to content

Commit

Permalink
Merge pull request #375 from ic-dev21/main
Browse files Browse the repository at this point in the history
Add 2 more states to cache invalidation
  • Loading branch information
ic-dev21 authored Feb 6, 2024
2 parents 8fddee4 + 1d65ef0 commit fbcdb98
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions custom_components/hilo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,14 +375,14 @@ async def get_event_details(self, event_id: int):
del self._events[event_id]
"""
Note ic-dev21: temp fix until we an make it prettier.
During reduction we delete the event attributes and reload
them with the next if, the rest of time time we're reading
it from cache
During appreciation, pre-heat and reduction we delete
the event attributes and reload them with the next if,
the rest of time time we're reading it from cache
"""

if event.state == "reduction":
if event.state in ["appreciation", "pre_heat", "reduction"]:
LOG.debug(
f"Invalidating cache for event {event_id} during reduction phase ({event.last_update=})"
f"Invalidating cache for event {event_id} during appreciation, pre_heat or reduction phase ({event.last_update=})"
)
del self._events[event_id]

Expand Down
4 changes: 2 additions & 2 deletions custom_components/hilo/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"documentation": "https://github.com/dvd-dev/hilo",
"iot_class": "cloud_push",
"issue_tracker": "https://github.com/dvd-dev/hilo/issues",
"requirements": ["python-hilo>=2024.1.2"],
"version": "2024.1.3"
"requirements": ["python-hilo>=2024.2.1"],
"version": "2024.2.1"
}

0 comments on commit fbcdb98

Please sign in to comment.