Skip to content

Commit

Permalink
19.6.6
Browse files Browse the repository at this point in the history
  • Loading branch information
magnuselden authored and magnuselden committed Jan 12, 2024
1 parent 45cc37b commit 152411b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
21 changes: 15 additions & 6 deletions peaqevcore/models/hub/currentpeak.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,22 @@ def _make_key(self, year = None) -> str:
async def async_update(self, peaks: list) -> None:
self.update_history(peaks)

def update_history(self, peaks: list) -> None:
self._peaks.extend(peaks) if isinstance(peaks, list) else self._peaks.append(peaks)
current_key = self._make_key()
if current_key not in self._history:
self._history[current_key] = []
self._history[current_key].extend(self._peaks)
# def update_history(self, peaks: list) -> None:
# self._peaks.extend(peaks) if isinstance(peaks, list) else self._peaks.append(peaks)
# current_key = self._make_key()
# if current_key not in self._history:
# self._history[current_key] = []
# self._history[current_key].extend(self._peaks)
# self._refresh_peak()

def update_history(self, peaks: list) -> None:
_key = self._make_key()
self._history[_key] = peaks
self._refresh_peak()
# if self._locale.data.query_model.get_currently_obeserved_peak() > min(peaks):
# self._value = self._locale.data.query_model.observed_peak
# else:
# self._value = self._get_peak()

def _refresh_peak(self) -> None:
cc = self._locale.data.query_model.get_currently_obeserved_peak(self.dt)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setuptools.setup(
name="peaqevcore",
version="19.6.5",
version="19.6.6",
author="Magnus Eldén",
description="Core types for peaqev car charging",
url="https://github.com/elden1337/peaqev-core",
Expand Down

0 comments on commit 152411b

Please sign in to comment.