Skip to content

Commit

Permalink
fix Added to track disappears
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandrErohin committed Sep 5, 2024
1 parent 6b677b3 commit 3d30865
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,14 @@ automation:
action:
service: notify.mobile_app_<device_name>
data:
content: >-
message: >-
Flight entry of {{ trigger.event.data.callsign }} to {{ trigger.event.data.airport_destination_city }}
[Open FlightRadar](https://www.flightradar24.com/{{ trigger.event.data.callsign }})
data:
url: >-
https://fr24.com/{{ trigger.event.data.callsign }}/{{
trigger.event.data.id }}
image: "{{ trigger.event.data.aircraft_photo_medium }}"
```
All available fields in `trigger.event.data` you can check [here](#flight)
Expand All @@ -130,9 +135,14 @@ automation:
action:
service: notify.mobile_app_<device_name>
data:
content: >-
message: >-
Flight takes off {{ trigger.event.data.callsign }} to {{ trigger.event.data.airport_destination_city }}
[Open FlightRadar](https://www.flightradar24.com/{{ trigger.event.data.callsign }})
data:
url: >-
https://fr24.com/{{ trigger.event.data.callsign }}/{{
trigger.event.data.id }}
image: "{{ trigger.event.data.aircraft_photo_medium }}"
```

### <a id="automation">Automation</a>
Expand Down
4 changes: 4 additions & 0 deletions custom_components/flightradar24/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ async def _update_flights_tracked(self) -> None:
remains = self.tracked.keys() - current.keys()
if remains:
for flight_id in remains:
size = current.__len__()
await self._find_flight(current, self.tracked[flight_id]['flight_number'])
if size == current.__len__():
current[flight_id] = self.tracked[flight_id]
current[flight_id]['tracked_type'] = 'not_found'

self.tracked = current

Expand Down
2 changes: 1 addition & 1 deletion custom_components/flightradar24/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/AlexandrErohin/home-assistant-flightradar24/issues",
"requirements": ["FlightRadarAPI==1.3.25", "pycountry==23.12.11"],
"version": "1.15.0"
"version": "1.15.1"
}

0 comments on commit 3d30865

Please sign in to comment.