Skip to content

Commit aca5f06

Browse files
committed
Add valve domain
1 parent 60c3dbf commit aca5f06

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

custom_components/smart_thermostat/climate.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from homeassistant.components.input_number import DOMAIN as INPUT_NUMBER_DOMAIN
3636
from homeassistant.components.light import (DOMAIN as LIGHT_DOMAIN, SERVICE_TURN_ON as SERVICE_TURN_LIGHT_ON,
3737
ATTR_BRIGHTNESS_PCT)
38+
from homeassistant.components.valve import (DOMAIN as VALVE_DOMAIN, SERVICE_SET_VALVE_POSITION, ATTR_POSITION)
3839
from homeassistant.core import DOMAIN as HA_DOMAIN, CoreState, Event, EventStateChangedData, callback
3940
from homeassistant.util import slugify
4041
import homeassistant.helpers.config_validation as cv
@@ -1008,6 +1009,12 @@ async def _async_set_valve_value(self, value: float):
10081009
LIGHT_DOMAIN,
10091010
SERVICE_TURN_LIGHT_ON,
10101011
data)
1012+
elif heater_or_cooler_entity[0:6] == 'valve.':
1013+
data = {ATTR_ENTITY_ID: heater_or_cooler_entity, ATTR_POSITION: value}
1014+
await self.hass.services.async_call(
1015+
VALVE_DOMAIN,
1016+
SERVICE_SET_VALVE_POSITION,
1017+
data)
10111018
else:
10121019
data = {ATTR_ENTITY_ID: heater_or_cooler_entity, ATTR_VALUE: value}
10131020
await self.hass.services.async_call(

0 commit comments

Comments
 (0)