Fix of visual feedback of IDLE/HEATING state when using valve and pwm is zero #166
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.
Issue:
In the current implementation of the
hvac_action
property the_is_device_active
property is used to decide whether the device is active or not.But
_is_device_active
property only checks if the (toggle) heating entity state isOFF
orON
.When setting
pwm: 0
the heating entity is considered a valve like entity which is able to accept values between 0-100 and therefore it does not haveON/OFF
states. As a consequence inpwm: 0
mode the_is_device_active
property returns always false -> thehvac_action
is alwaysIDLE
even if thecontrol_output
is above 0 or even when it's 100.Fix:
There is a branch added to
_is_device_active
to check whether we're inpwm
mode or not (aka. toggle or valve device is used) and if nonpwm
mode then the return value of the property is based on the float value of the valve device state (ON if state > 0, OFF if state == 0).