Fix water_heater false error, add mean_type/unit_class for HA 2026.11, fix temperature state_class#540
Open
mosandlt wants to merge 1 commit intobosch-thermostat:masterfrom
Open
Fix water_heater false error, add mean_type/unit_class for HA 2026.11, fix temperature state_class#540mosandlt wants to merge 1 commit intobosch-thermostat:masterfrom
mosandlt wants to merge 1 commit intobosch-thermostat:masterfrom
Conversation
… fix temperature state_class - water_heater.py: Fix false error 'A target temperature must be provided' when automation sets the same temperature that is already active. Only error when target_temp is None; silently skip if unchanged. - sensor/statistic_helper.py: Add mean_type (StatisticMeanType.NONE) and unit_class to StatisticMetaData to satisfy HA 2026.11 requirements. Both use safe fallbacks for older HA versions. - sensor/base.py + sensor/recording.py: Fix sensor.ractualtemp warning 'state_class total is impossible for temperature device class'. Override state_class to measurement when device_class is temperature. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
water_heater.py: Fix falseERROR: A target temperature must be provided— the error fired when an automation set the same temperature already active. Now only errors whentarget_temp is None; silently skips if temperature is unchanged.sensor/statistic_helper.py: Addmean_type(StatisticMeanType.NONE) andunit_classtoStatisticMetaData— required by HA 2026.11 (currently warning). Both usetry/exceptfallbacks for older HA versions.unit_classis derived from unit of measurement (kWh/Wh → energy, kW → power).sensor/base.py+sensor/recording.py: FixWARNING: sensor state_class 'total' is impossible for device_class 'temperature'— the bosch library returnsstate_class=totalfor temperature sensors (e.g.sensor.ractualtemp), which is invalid. Override tomeasurementwhen device_class is temperature.Test plan
ERROR: A target temperature must be providedwhen automation sets same temperature already activeWARNING: mean_type not specifiedon startupWARNING: unit_class not specifiedon startupWARNING: state_class 'total' impossible for temperatureon startupTested on HA 2026.3.4 with bosch-thermostat custom component.
🤖 Generated with Claude Code