Skip to content

fix(weather): preserve zero feels-like temperatures - #4336

Merged
KristjanESPERANTO merged 2 commits into
MagicMirrorOrg:developfrom
xunguangzlj-cloud:fix/weather-zero-feels-like
Nov 9, 2026
Merged

KristjanESPERANTO merged 2 commits into
MagicMirrorOrg:developfrom
xunguangzlj-cloud:fix/weather-zero-feels-like

Conversation

@xunguangzlj-cloud

@xunguangzlj-cloud xunguangzlj-cloud commented Nov 8, 2026 •

Copy link
Copy Markdown

Summary

A weather provider can report a feels-like temperature of exactly 0. Keep that reading instead of substituting a calculated value. The fallback for missing or invalid readings still works.

Verification

  • The zero-temperature regression failed on develop (WeatherObject returned 11.741 for a provider reading of 0). The zero and three fallback cases pass with the change.
  • Ran node --run lint:fix and checked the resulting diff.
  • Windows unit run in UTC: 536 passed and 4 failed. The exact same four tests fail on develop: three logger caller-prefix cases and the system-information test that expects Linux.

AI assistance was used to implement and verify this change.

Review follow-up: the UK Met Office provider now preserves 0°C in current observations, the first-hour fallback, daily forecasts, and hourly forecasts. All four regressions returned null on the previous head. The weather unit suite passed all 247 tests, and both changed files passed ESLint and Prettier.

@KristjanESPERANTO

Copy link
Copy Markdown
Collaborator

Looks good, thanks for the PR! 🙂

While tracing the data flow, I noticed a related issue in ukmetofficedatahub.js (lines 143, 170, 207, and 238): these mappings use || null, which turns a valid feels-like temperature of 0 into null before it reaches WeatherObject. Could you switch those fallbacks to ?? null as well? That would make the fix cover this provider too.

@KristjanESPERANTO
KristjanESPERANTO merged commit 33da260 into MagicMirrorOrg:develop Nov 9, 2026
13 checks passed
@KristjanESPERANTO

Copy link
Copy Markdown
Collaborator

@xunguangzlj-cloud Thanks for the additional commit! This will land in the next release 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants