0706ae70dc9114f6755afa65f12f6d5023b21518,homeassistant/components/maxcube/climate.py,MaxCubeClimate,set_preset_mode,#MaxCubeClimate#Any#,258
Before Change
def set_preset_mode(self, preset_mode):
Set new operation mode.
device = self._cubehandle.cube.device_by_rf(self._rf_address)
temp = None
mode = MAX_DEVICE_MODE_AUTOMATIC
if preset_mode in [PRESET_COMFORT, PRESET_ECO, PRESET_ON]:
mode = MAX_DEVICE_MODE_MANUAL
if preset_mode == PRESET_COMFORT:
temp = device.comfort_temperature
elif preset_mode == PRESET_ECO:
temp = device.eco_temperature
else:
temp = ON_TEMPERATURE
else:
mode = HASS_PRESET_TO_MAX_MODE[preset_mode] or MAX_DEVICE_MODE_AUTOMATIC
with self._cubehandle.mutex:
try:
self._cubehandle.cube.set_temperature_mode(device, temp, mode)
except (socket.timeout, OSError):
_LOGGER.error("Setting operation mode failed")
return
@property
def extra_state_attributes(self):
Return the optional state attributes.
cube = self._cubehandle.cube
After Change
PRESET_ON,
]
def set_preset_mode(self, preset_mode):
Set new operation mode.
if preset_mode == PRESET_COMFORT:
self._set_target(MAX_DEVICE_MODE_MANUAL, self._device.comfort_temperature)
elif preset_mode == PRESET_ECO:
self._set_target(MAX_DEVICE_MODE_MANUAL, self._device.eco_temperature)
elif preset_mode == PRESET_ON:
self._set_target(MAX_DEVICE_MODE_MANUAL, ON_TEMPERATURE)
elif preset_mode == PRESET_AWAY:
self._set_target(MAX_DEVICE_MODE_VACATION, None)
elif preset_mode == PRESET_BOOST:
self._set_target(MAX_DEVICE_MODE_BOOST, None)
elif preset_mode == PRESET_NONE:
self._set_target(MAX_DEVICE_MODE_AUTOMATIC, None)
else:
raise ValueError(f"unsupported preset mode {preset_mode}")
@property
def extra_state_attributes(self):
Return the optional state attributes.
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 19
Instances
Project Name: home-assistant/home-assistant
Commit Name: 0706ae70dc9114f6755afa65f12f6d5023b21518
Time: 2021-03-27
Author: unaiur@gmail.com
File Name: homeassistant/components/maxcube/climate.py
Class Name: MaxCubeClimate
Method Name: set_preset_mode
Project Name: home-assistant/home-assistant
Commit Name: 0706ae70dc9114f6755afa65f12f6d5023b21518
Time: 2021-03-27
Author: unaiur@gmail.com
File Name: homeassistant/components/maxcube/climate.py
Class Name: MaxCubeClimate
Method Name: set_temperature
Project Name: home-assistant/home-assistant
Commit Name: 0706ae70dc9114f6755afa65f12f6d5023b21518
Time: 2021-03-27
Author: unaiur@gmail.com
File Name: homeassistant/components/maxcube/climate.py
Class Name: MaxCubeClimate
Method Name: set_preset_mode
Project Name: home-assistant/home-assistant
Commit Name: 0706ae70dc9114f6755afa65f12f6d5023b21518
Time: 2021-03-27
Author: unaiur@gmail.com
File Name: homeassistant/components/maxcube/climate.py
Class Name: MaxCubeClimate
Method Name: set_hvac_mode