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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions custom_components/smart_thermostat/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,11 +964,15 @@ async def _async_control_heating(self, time_func=None, calc_pid=False):

@property
def _is_device_active(self):
"""If the toggleable device is currently active."""
if self._heater_polarity_invert:
return self.hass.states.is_state(self.heater_or_cooler_entity, STATE_OFF)
return self.hass.states.is_state(self.heater_or_cooler_entity, STATE_ON)

if self._pwm:
"""If the toggleable device is currently active."""
if self._heater_polarity_invert:
return self.hass.states.is_state(self.heater_or_cooler_entity, STATE_OFF)
return self.hass.states.is_state(self.heater_or_cooler_entity, STATE_ON)
else:
"""If the valve device is currently active."""
return float(self.hass.states.get(self.heater_or_cooler_entity).state) > 0

@property
def supported_features(self):
"""Return the list of supported features."""
Expand Down
Loading