A thermostat panel lets the user pick from three saved zones, each with its own preset temperature. Selecting a zone should update both the active zone label and the displayed temperature to match that zone's preset.
Clicking a zone button updates the Active zone label correctly every time, but the Temperature reading shows a small single-digit number instead of the zone's actual preset temperature.
The action carries more than one field - check that each value the reducer reads is the one that was actually meant for that purpose.
The action carries more than one field - check that each value the reducer reads is the one that was actually meant for that purpose.
Why this fixes it
The SET_ZONE case built its return object using action.zoneId for the temp field instead of action.temp - both are numeric fields on the action so nothing crashes, but the value displayed has nothing to do with the zone's actual preset temperature, it's just whichever zone id happened to be clicked. The activeLabel field reads action.label correctly, which is why the zone name always updates as expected while only the number is wrong, confirming the dispatch itself is correct and the mistake lives entirely inside the reducer's field lookup. Reading action.temp instead returns the actual preset value that was included in the dispatch.