Skip to content

Commit

Permalink
Add league logos
Browse files Browse the repository at this point in the history
  • Loading branch information
kloemi committed Nov 21, 2023
1 parent 3233ed2 commit a192e18
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
23 changes: 21 additions & 2 deletions custom_components/samsvolleyball/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,33 @@
"vvrp",
]

LEAGUE_URL_LOGO_MAP = {
"baden": "https://www.sbvv-online.de/cms/files/layout/images/logos/logo_sbvv.png",
"bvv": "https://vvb.sams-server.de/cms/files/VVB_Dateien/layout_homepage/logo/vvb_logo.jpg",
"dvv": "https://www.volleyball-verband.de/?proxy=img/logo_dvv.png",
"flvb": "https://flvb.lu/images/logos/FLVB%20Logo%2060%20ans%20SVG.svg",
"hvbv": "https://www.hvbv.de/cms/files/hvbv/layout/images/logo.png",
"hvv": "https://www.hessen-volley.de/cms/files/hvv/layout/images/logo/hvv-logo-internet-w.svg",
"nwvv": "https://www.nwvv.de/cms/files/layout/images/nwvv_nvv-blau_transparent_426w.png",
"shvv": "https://www.shvv.de/cms/files/shvv/layout/logos/shvv_logo_400.png",
"ssvb": "https://www.ssvb.org/cms/files/SSVB_Dateien/layout/images/SSVB-Logo.png",
"svv": "https://www.volley-saar.de/cms/files/SVV_Dateien/layout_homepage/images/logo/SVV%20Logo.jpg",
"tvv": "https://www.tv-v.de/cms/files/TVV_Dateien/layout_homepage/images/logo/TVV_Logo.png",
"vbl": "https://www.volleyball-bundesliga.de/cms/files/layout/images/vbl_logo_ohne_text_320x320.png",
"vmv": "https://www.vmv24.de/srv/images/vmv-logo.gif",
"vlw": "https://www.vlw-online.de/cms/files/VLW_Dateien/layout_homepage/images/logo/VLW_Logo.png",
"vvb": "https://vvb.sams-server.de/cms/files/VVB_Dateien/layout_homepage/logo/vvb_logo.jpg",
"vvrp": "https://www.vvrp.de/cms/files/VVRP_Dateien/layout/logos/Logo_VVRP.svg",
}

TIMEOUT_PERIOD_CHECK = 30 # sec
NO_GAME = 0
NEAR_GAME = 1
IN_GAME = 2

TIMEOUT = {
NO_GAME: 2 * 60 * 60, # 2h min.
NEAR_GAME: 12 * 60, # 12 min.
NO_GAME: 2 * 60 * 60, # 2h min.
NEAR_GAME: 12 * 60, # 12 min.
IN_GAME: 5 * 60, # 5 min.
}

Expand Down
3 changes: 2 additions & 1 deletion custom_components/samsvolleyball/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
DEFAULT_ICON,
DOMAIN,
IN_GAME,
LEAGUE_URL_LOGO_MAP,
NEAR_GAME,
NO_GAME,
STATES_IN,
Expand Down Expand Up @@ -161,7 +162,7 @@ def extra_state_attributes(self) -> dict[str, Any]:

self._attr[ATTR_ATTRIBUTION] = ATTRIBUTION
self._attr["sport"] = VOLLEYBALL
self._attr["league_logo"] = None # ToDo: needed from region out of config
self._attr["league_logo"] = LEAGUE_URL_LOGO_MAP[self._config.data[CONF_REGION]]

if self.coordinator.data is None:
return self._attr
Expand Down

0 comments on commit a192e18

Please sign in to comment.