Skip to content

Commit

Permalink
3.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
magnuselden authored and magnuselden committed Jul 21, 2023
1 parent 8e98651 commit e350c78
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
2 changes: 1 addition & 1 deletion custom_components/peaqev/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
"requirements": [
"peaqevcore==19.0.1"
],
"version": "3.0.1"
"version": "3.0.2"
}
5 changes: 0 additions & 5 deletions custom_components/peaqev/peaqservice/hub/nordpool/nordpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,17 +202,12 @@ async def async_add_average_data(self, new_val):
rounded = round(new_val, 3)
if datetime.now().date not in self.model.average_data.keys():
self.model.average_data[datetime.now().date] = rounded
# if len(self.model.average_data) == 0:
# self.model.average_data.append(rounded)
# elif self.model.average_data[-1] != rounded:
# self.model.average_data.append(rounded)
await self.async_cap_average_data_length()

async def async_cap_average_data_length(self):
while len(self.model.average_data) > AVERAGE_MAX_LEN:
min_key = min(self.model.average_data.keys())
del self.model.average_data[min_key]
#del self.model.average_data[0]

async def async_get_average(self, days: int) -> float:
try:
Expand Down
3 changes: 0 additions & 3 deletions custom_components/peaqev/sensors/money_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ async def async_added_to_hass(self):
await self.hub.nordpool.async_import_average_data(
state.attributes.get("Nordpool average data", 50)
)
# self._average_nordpool_data = list(
# state.attributes.get("Nordpool average data", 50)
# )
self._average_nordpool_data = self.hub.nordpool.average_data
self._average_nordpool = (
f"{self.hub.nordpool.average_weekly} {self._currency}"
Expand Down

0 comments on commit e350c78

Please sign in to comment.