Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix of visual feedback of IDLE/HEATING state when using valve and pwm is zero #166

Merged
merged 3 commits into from
Oct 5, 2023

Conversation

bemobolo
Copy link
Contributor

@bemobolo bemobolo commented Oct 5, 2023

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 is OFF or ON.
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 have ON/OFF states. As a consequence in pwm: 0 mode the _is_device_active property returns always false -> the hvac_action is always IDLE even if the control_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 in pwm mode or not (aka. toggle or valve device is used) and if non pwm 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).

@ScratMan
Copy link
Owner

ScratMan commented Oct 5, 2023

Hello, thanks for the fix. But "inverted" is useless when state is "analog" 0/100. You should remove the ==0 option and if pm == 0, only return True if state is >0

@bemobolo
Copy link
Contributor Author

bemobolo commented Oct 5, 2023

Thank you, I've made the requested changes!

@ScratMan ScratMan merged commit f965368 into ScratMan:development Oct 5, 2023
2 checks passed
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