Skip to content

Commit

Permalink
19.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
magnuselden authored and magnuselden committed Feb 22, 2024
1 parent df62040 commit b321c47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions custom_components/peaqev/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"iot_class": "calculated",
"issue_tracker": "https://github.com/elden1337/hass-peaq/issues",
"requirements": [
"peaqevcore==19.7.0"
"peaqevcore==19.7.1"
],
"version": "3.4.0"
"version": "3.4.1"
}
3 changes: 1 addition & 2 deletions custom_components/peaqev/sensors/money_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,13 @@ def icon(self) -> str:
return "mdi:database-outline"

async def async_update(self) -> None:
if datetime.now() - self._state > timedelta(minutes=1):
ret = await self.hub.async_request_sensor_data(
AVERAGE_SPOTPRICE_DATA, AVERAGE_STDEV_DATA
)
if ret is not None:
if len(ret):
self._state = datetime.now()
if ret.get(AVERAGE_SPOTPRICE_DATA, {}) != self._average_spotprice_data:
self._state = datetime.now()
_diff = self.diff_dicts(self._average_spotprice_data, ret.get(AVERAGE_SPOTPRICE_DATA, {}))
_LOGGER.debug(f"dict avgprice was changed: added: {_diff[0]}, removed: {_diff[1]}")
self._average_spotprice_data = ret.get(AVERAGE_SPOTPRICE_DATA, {})
Expand Down

0 comments on commit b321c47

Please sign in to comment.