Skip to content
Open
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
30 changes: 20 additions & 10 deletions custom_components/smart_thermostat/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -976,12 +976,17 @@ async def _async_heater_turn_on(self):
self.entity_id, ", ".join([entity for entity in self.heater_or_cooler_entity]))
return
for heater_or_cooler_entity in self.heater_or_cooler_entity:
data = {ATTR_ENTITY_ID: heater_or_cooler_entity}
if self._heater_polarity_invert:
service = SERVICE_TURN_OFF
if heater_or_cooler_entity.startswith('valve.'):
data = {ATTR_ENTITY_ID: heater_or_cooler_entity}
await self.hass.services.async_call(
VALVE_DOMAIN, 'open_valve', data)
else:
service = SERVICE_TURN_ON
await self.hass.services.async_call(HA_DOMAIN, service, data)
data = {ATTR_ENTITY_ID: heater_or_cooler_entity}
if self._heater_polarity_invert:
service = SERVICE_TURN_OFF
else:
service = SERVICE_TURN_ON
await self.hass.services.async_call(HA_DOMAIN, service, data)

async def _async_heater_turn_off(self, force=False):
"""Turn heater toggleable device off."""
Expand All @@ -1001,12 +1006,17 @@ async def _async_heater_turn_off(self, force=False):
if entity is None:
continue
for heater_or_cooler_entity in self.heater_or_cooler_entity:
data = {ATTR_ENTITY_ID: heater_or_cooler_entity}
if self._heater_polarity_invert:
service = SERVICE_TURN_ON
if heater_or_cooler_entity.startswith('valve.'):
data = {ATTR_ENTITY_ID: heater_or_cooler_entity}
await self.hass.services.async_call(
VALVE_DOMAIN, 'close_valve', data)
else:
service = SERVICE_TURN_OFF
await self.hass.services.async_call(HA_DOMAIN, service, data)
data = {ATTR_ENTITY_ID: heater_or_cooler_entity}
if self._heater_polarity_invert:
service = SERVICE_TURN_ON
else:
service = SERVICE_TURN_OFF
await self.hass.services.async_call(HA_DOMAIN, service, data)

async def _async_set_valve_value(self, value: float):
_LOGGER.info("%s: Change state of %s to %s", self.entity_id,
Expand Down