0706ae70dc9114f6755afa65f12f6d5023b21518,homeassistant/components/maxcube/climate.py,MaxCubeClimate,set_preset_mode,#MaxCubeClimate#Any#,258
Before Change
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):
After Change
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: 9
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: open-mmlab/mmcv
Commit Name: 4ec73abbcc30314604d7afa6f59c1d6be5e8426c
Time: 2020-08-17
Author: linjintao@sensetime.com
File Name: mmcv/runner/hooks/logger/text.py
Class Name: TextLoggerHook
Method Name: log
Project Name: mne-tools/mne-python
Commit Name: 35d7c539c93bd0bff7788fad93ce08686e0cc760
Time: 2019-04-10
Author: larson.eric.d@gmail.com
File Name: mne/source_space.py
Class Name:
Method Name: _check_spacing