Skip to content

Commit

Permalink
brand name
Browse files Browse the repository at this point in the history
  • Loading branch information
myTselection committed Apr 5, 2024
1 parent 41abc5c commit 86ebd50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions custom_components/carbu_com/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ async def async_update(self):
self._date = stationInfo.get("date")
self._country = stationInfo.get("country")
self._id = stationInfo.get("id")
self._score = stationInfo.get("score")

async def async_will_remove_from_hass(self):
"""Clean up after entity before removal."""
Expand Down
7 changes: 5 additions & 2 deletions custom_components/carbu_com/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,8 @@ def getFuelPricesUS(self, postalcode, country, town, locationinfo, fueltype: Fue
# url = block['href']
station_id = block.get('id')
station_name = block.get('info').get('name')
alias_name = block.get('info').get('alias')
brand_name = block.get('info').get('brand_name')
station_street = block.get('info').get('address').get('line_1')
station_city = block.get('info').get('address').get('locality')
station_postalcode = block.get('info').get('address').get('postal_code')
Expand All @@ -698,10 +700,11 @@ def getFuelPricesUS(self, postalcode, country, town, locationinfo, fueltype: Fue

block_data = {
'id': station_id,
'name': station_name,
'name': f"{alias_name} {station_name}" if alias_name else station_name,
# 'url': f"https://www.clever-tanken.de{url}",
# 'logo_url': f"https://www.clever-tanken.de/{logo_url}",
'brand': station_name,
'brand': brand_name,
'city': station_city,
'address': f"{station_street}, {station_city}",
'postalcode': station_postalcode,
'locality': station_locality,
Expand Down

0 comments on commit 86ebd50

Please sign in to comment.