skodaconnect / homeassistant-myskoda

Homeassistant integration for MySkoda.
4 stars 2 forks source link

[Feature] Add image of car as icon to device_tracker #2

Open Prior99 opened 1 week ago

Prior99 commented 1 week ago

Original issue in old repository by @sonar98.

In the Skodaconnect version the device_tracker icon shows the image that is available from the API.

image

I think this part of the code in the init.py is getting this image:

if "position" in self.attribute:
    # Try to use small thumbnail first hand, else fallback to fullsize
    if self.vehicle.is_model_image_small_supported:
        attributes["entity_picture"] = self.vehicle.model_image_small
    elif self.vehicle.is_model_image_large_supported:
        attributes["entity_picture"] = self.vehicle.model_image_large

return attributes