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:
committed by
GitHub
parent
ce14544ec1
commit
38c5e483a8
@@ -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."""
|
||||
|
||||
@@ -59,6 +59,7 @@ MOCK_TRACKER = Tracker(
|
||||
not_charging=True,
|
||||
overall=True,
|
||||
),
|
||||
icon="http://res.cloudinary.com/iot-venture/image/upload/v1717594357/kyaqq7nfitrdvaoakb8s.jpg",
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user