Skip to content

Commit

Permalink
Merge branch 'master' of github.com:myTselection/Carbu_com
Browse files Browse the repository at this point in the history
  • Loading branch information
myTselection committed Feb 15, 2025
2 parents b74917a + 5dda657 commit 5b23820
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ cards:
<center>
[{{state_attr('sensor.carbu_com_super95_3010_price','supplier')}}]({{state_attr('sensor.carbu_com_super95_3010_5km','url')}})
[{{state_attr('sensor.carbu_com_super95_3010_price','supplier')}}]({{state_attr('sensor.carbu_com_super95_3010_price','url')}})
### <center>{{states('sensor.carbu_com_super95_3010_price')}} €/l
- type: markdown
Expand Down Expand Up @@ -487,7 +487,7 @@ cards:
<center>
[{{state_attr('sensor.carbu_com_super95_3010_10km','supplier')}}]({{state_attr('sensor.carbu_com_super95_3010_5km','url')}})
[{{state_attr('sensor.carbu_com_super95_3010_10km','supplier')}}]({{state_attr('sensor.carbu_com_super95_3010_10km','url')}})
### <center>{{states('sensor.carbu_com_super95_3010_10km')}} €/l
Expand Down
6 changes: 3 additions & 3 deletions custom_components/carbu_com/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def getFuelPricesNL(self, postalcode, country, town, locationinfo, fueltype: Fue
# _LOGGER.debug(f"NL URL: {nl_url}")
response = self.s.get(nl_url,headers=header,timeout=50)
if response.status_code != 200:
_LOGGER.error(f"ERROR: {response.text}")
_LOGGER.error(f"ERROR: NL URL: {nl_url}, {response.text}")
assert response.status_code == 200
radius = radius + 0.045

Expand Down 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 Expand Up @@ -1789,4 +1789,4 @@ def get_nested_element(self, json_obj, key_string):
# print("FuelType.SUPER95_OFFICIAL_E10")
# print(session.getFuelOfficial(FuelType.SUPER95_OFFICIAL_E10, "NL"))

# print(FuelType.DIESEL.code)
# print(FuelType.DIESEL.code)
2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Carbu.com",
"render_readme": true,
"country": ["BE","FR","NL","IT","DE","LU"]
"country": ["BE","FR","NL","IT","DE","LU","ES"]
}

0 comments on commit 5b23820

Please sign in to comment.