Open mgmread opened 3 years ago
Hello, Same problem for me with a 7km radius. When a plane is going outside the radius, the MM still show it until a more closer plane enter the radius. It will never return to "No Planes Nearby"
MM version : 2.18.0
Config
{ module: 'MMM-FlightRadarTracker', header: 'Avion le plus proche', position: 'bottom_left', classes: 'scheduler', config: { module_schedule: [ {from: '0 9 * * 1-5', to: '0 23 * * 1-5'}, {from: '* * * * 6-7', to: '* * * * 6-7'} ], updateInterval: 15, distance: 7, passingByThreshold: -1, limit: 1, speedUnits: 'metric', altitudeUnits: 'metric', centerPoint: [XXX, XXX], showAirline: true, showType: true, showSpeed: true, showAltitude: true, showHeading: true, showDirectionAsArrow: true, showRoute: true, noPlanesLabel: 'Aucun avion detecté', atTheWindowLabel: 'Visible', passingByLabel: 'Non visible', sort: 'distance', sortDescending: false } }
For information, with remote control we can see the MM on port 8080.
If we do reload page (with juste the F5 touch on the keyboard), the module will display "no Planes Nearby".
So, it's just look like a refresh problem of web page I think, but MM directly doesn't do that. That is the problem.
Was there any update to this? I'm seeing the same thing. Is there any way to force that module to refresh so that the list shows as no planes when its outside the radius?
Was there any update to this? I'm seeing the same thing. Is there any way to force that module to refresh so that the list shows as no planes when its outside the radius?
This module seem to be abandonned. So I've delete it :(
Was there any update to this? I'm seeing the same thing. Is there any way to force that module to refresh so that the list shows as no planes when its outside the radius?
This module seem to be abandonned. So I've delete it :(
Everything else seems to work, but this would be a great feature add.
For anyone following this, I found out the issue here and added a quick if/else statement to get it going. Basically if the node_helper.js didn't find any planes, it wouldn't pass anything back to the MMM-FlightRadarTracker.js file, so the module only updated when a new plane was found.
In node_helper.js on line 94, I set it to send a notification back with an empty array if no aircraft was found, and it will now update.
.then(function (result) {
if(result.length !== 0){
result.forEach(function(f) {
self.getFlightDetails(payload.centerPoint[0], payload.centerPoint[1], payload.limit, payload.sort, payload.sortDescending, result, f);
});
} else {
self.sendSocketNotification('MMM-FlightRadarTracker_DATA_RECEIVED', []);
}
})
Use at your own risk!
@george-dilthey's fix worked for me. I think restarting MM was needed because I don't think a simple refresh was enough. Also, his code replaces lines 94-98.
I live near to an airport, so use a very small radius so that I only have flights appear when they fly pretty much directly overhead. When the plane leaves, the list does not revert to 'No Planes Nearby' as it would when the program first starts.