Skip to content

Commit

Permalink
bump pyfuelprices to 2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
pantherale0 committed Feb 2, 2024
1 parent b53ed84 commit 41dcfe2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
6 changes: 1 addition & 5 deletions custom_components/fuel_prices/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,8 @@ async def handle_fuel_location_lookup(call: ServiceCall) -> ServiceResponse:
)
except ValueError as err:
raise HomeAssistantError("Country not available for fuel data.") from err
locations_built = []
for loc in locations:
await loc.dynamic_build_fuels()
locations_built.append(loc.__dict__())

return {"items": locations_built, "sources": entry.data.get("sources", [])}
return {"items": locations, "sources": entry.data.get("sources", [])}

hass.services.async_register(
DOMAIN,
Expand Down
9 changes: 5 additions & 4 deletions custom_components/fuel_prices/device_tracker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Device tracker for fuel prices."""

from __future__ import annotations

import logging
Expand Down Expand Up @@ -36,16 +37,16 @@ async def async_setup_entry(
coordinates=(area[CONF_LATITUDE], area[CONF_LONGITUDE]),
radius=area[CONF_RADIUS],
):
if station.id not in found_entities:
if station["id"] not in found_entities:
entities.append(
FeulStationTracker(
coordinator=cooridinator,
fuel_station_id=station.id,
fuel_station_id=station["id"],
entity_id="devicetracker",
source=station.props[PROP_FUEL_LOCATION_SOURCE],
source=station["props"][PROP_FUEL_LOCATION_SOURCE],
)
)
found_entities.append(station.id)
found_entities.append(station["id"])

async_add_entities(entities, True)

Expand Down
2 changes: 1 addition & 1 deletion custom_components/fuel_prices/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"requirements": [
"reverse-geocode==1.4.1",
"these-united-states==1.1.0.21",
"pyfuelprices==2.1.11"
"pyfuelprices==2.2.2"
],
"ssdp": [],
"version": "0.0.0",
Expand Down
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==2023.8.0
pip>=21.0,<23.2
ruff==0.0.292
pyfuelprices==2.1.10
pyfuelprices==2.2.2

0 comments on commit 41dcfe2

Please sign in to comment.