Replies: 3 comments 1 reply
|
The icon is currently selected only from the WMO weather code, and code 0 means clear sky in both daytime and nighttime. That is why a clear observation at 9:42 PM can still display the sun emoji. The fix is to carry the day/night field from Open-Meteo into the stored weather object and choose the icon from both values: For example, clear code 0 can map to a sun during the day and a moon at night. The same distinction can be applied to the partly-clear code. If is_day is not available in the response, use the location's local timestamp plus sunrise/sunset; do not compare against the server's timezone because the detector and browser may be running in different zones. I would keep the textual description unchanged and make the icon a presentation detail, so historical detections do not need a migration beyond the existing weather payload. Add tests for code 0 at day and night, a timezone boundary, and missing is_day so the fallback remains deterministic. The current mapping is in frontend/src/composables/useDetectionInfo.js and only keys on weatherData.code. |
|
@trowhill haha, i noticed it a few times with Killdeer and Canada Goose showing up at night, and wanted to fix it, but procrastinated. now i have no excuse 🙈 |
Uh oh!
There was an error while loading. Please reload this page.
Awesome job on the new detection info, I do have one suggestion with the conditions part. I had a observation at 9:42 PM, in the conditions it shows the Sun Icon instead of a moon one. I appreciate all the hard work you have put into BirdNET-PiPy.
Thanks,
GW
All reactions