Skip to content

Commit

Permalink
Merge pull request #80 from LorenzoRogai/patch-1
Browse files Browse the repository at this point in the history
[IT] Exclude non-self fuel prices
  • Loading branch information
myTselection authored Jan 20, 2025
2 parents 7c59365 + 233684b commit 8f0da3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/carbu_com/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ def getFuelPricesIT(self, postalcode, country, town, locationinfo, fueltype: Fue
pb_get_prices_price = pb_get_prices.get('prices').get('price')

# Filter the list to keep only items containing "diesel" in the "fuel" value
fuel_type_items = [item for item in pb_get_prices_price if fueltype.it_name in item["fuel"].lower()]
fuel_type_items = [item for item in pb_get_prices_price if fueltype.it_name in item["fuel"].lower() and item["service"] == "SS"]

# Sort the filtered list by the "price" key in ascending order
sorted_fuel_type_items = sorted(fuel_type_items, key=lambda x: float(x["price"]))
Expand Down

0 comments on commit 8f0da3d

Please sign in to comment.