Skip to content

Commit

Permalink
bump pyfuelprices
Browse files Browse the repository at this point in the history
  • Loading branch information
pantherale0 committed Jun 27, 2024
1 parent f7a0d29 commit 7754b13
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion custom_components/fuel_prices/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"issue_tracker": "https://github.com/pantherale0/ha-fuelprices/issues",
"requirements": [
"these-united-states==1.1.0.21",
"pyfuelprices==2.5.1"
"pyfuelprices==2.6.0"
],
"ssdp": [],
"version": "0.0.0",
Expand Down
7 changes: 5 additions & 2 deletions custom_components/fuel_prices/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ async def async_update(self) -> None:
self._cached_data = data[int(self._count)-1]
return True
self._cached_data = None
self._next_update = datetime.now() + timedelta(days=1)
self._last_update = datetime.now()
self._next_update = datetime.now() + timedelta(minutes=5)

@property
def native_value(self) -> str | float:
Expand All @@ -168,5 +169,7 @@ def extra_state_attributes(self) -> Mapping[str, Any] | None:
"""Return extra state attributes."""
return {
"area": self._area,
**self._cached_data
**self._cached_data,
"last_updated": self._last_update,
"next_update": self._next_update
}
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ colorlog==6.7.0
homeassistant==2024.3.3
pip>=21.0,<23.2
ruff==0.0.292
pyfuelprices==2.5.1
pyfuelprices==2.6.0

0 comments on commit 7754b13

Please sign in to comment.