1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-20 02:48:57 +00:00

add entity_picture to fressnapf_tracker (#158099)

This commit is contained in:
Kevin Stillhammer
2025-12-06 13:28:53 +01:00
committed by GitHub
parent ce14544ec1
commit 38c5e483a8
3 changed files with 7 additions and 0 deletions

View File

@@ -42,6 +42,11 @@ class FressnapfTrackerDeviceTracker(FressnapfTrackerBaseEntity, TrackerEntity):
"""Return if entity is available."""
return super().available and self.coordinator.data.position is not None
@property
def entity_picture(self) -> str | None:
"""Return the entity picture url."""
return self.coordinator.data.icon
@property
def latitude(self) -> float | None:
"""Return latitude value of the device."""

View File

@@ -59,6 +59,7 @@ MOCK_TRACKER = Tracker(
not_charging=True,
overall=True,
),
icon="http://res.cloudinary.com/iot-venture/image/upload/v1717594357/kyaqq7nfitrdvaoakb8s.jpg",
)

View File

@@ -37,6 +37,7 @@
# name: test_state_entity_device_snapshots[device_tracker.fluffy-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'entity_picture': 'http://res.cloudinary.com/iot-venture/image/upload/v1717594357/kyaqq7nfitrdvaoakb8s.jpg',
'friendly_name': 'Fluffy',
'gps_accuracy': 10.0,
'latitude': 52.520008,