1
0
mirror of https://github.com/natekspencer/hacs-oasis_mini.git synced 2025-12-06 18:44:14 -05:00

Use helper to get image from track dictionary

This commit is contained in:
Nathan Spencer
2025-11-26 19:46:02 +00:00
parent 5dc49b6a68
commit c4fd6a7ef6
3 changed files with 16 additions and 14 deletions

View File

@@ -19,7 +19,7 @@ from .utils import (
_parse_int,
create_svg,
decrypt_svg_content,
get_url_for_image,
get_image_url_from_track,
)
if TYPE_CHECKING: # avoid runtime circular imports
@@ -407,9 +407,7 @@ class OasisDevice:
Returns:
str: Full URL to the track image or `None` if no image is available.
"""
if track := self.track:
return get_url_for_image(track.get("image"))
return None
return get_image_url_from_track(self.track)
@property
def track_name(self) -> str | None: