AlexandrErohin / home-assistant-flightradar24

Flightradar24 integration for Home Assistant
https://community.home-assistant.io/t/custom-component-flightradar24
MIT License
137 stars 15 forks source link

Tracking Error if flight is not flying #59

Closed Bkk20 closed 6 days ago

Bkk20 commented 1 week ago

The sensor name for tracked flights is sensor.flightradar24_additional_tracked.

I have used it to track various flights and it works fine, but if the flight is not flying and still scheduled, I get the error “undefined error dict object has no attribute airline short. Also when I use “if” everywhere it does not work. Anyone has the same problem?

AlexandrErohin commented 6 days ago

When a flight is scheduled - only callsign and flight_number fields are available. Other fields may be available but it is not guaranteed

Bkk20 commented 6 days ago

Okay, Thank you. So the integration is not good for flights which are not in the air. No problem :)

But imagine, I add a track e.g. UA123 which is in the air. Then everything works, but if this airplane has been landed. Then it is vanished from my detail list but its still tracked in the background and then I get errors because of the already landed flight in my detail list . How can I prevent it? How do I know which flight is still not removed from the list (add. tracking)?

AlexandrErohin commented 6 days ago

If you are talking about an error from dashbord when you add flight list. You always may add IF statement for field tracked_type. If tracked_type=live - you show all fields, else you may show only callsign

Bkk20 commented 6 days ago

Thanks! Its working. Sad that only Callsign and Flightnumber is possivle for scheduled flights. But in general, great work!

AlexandrErohin commented 5 days ago

@Bkk20 Would be great if you could give a star to the repo :) Thanks