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: 10
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: ilastik/ilastik
Commit Name: fa6401c65531d695f302ac7fdfd76a82e8fc7b83
Time: 2013-04-23
Author: kemal.eren@iwr.uni-heidelberg.de
File Name: ilastik/applets/objectExtraction/opObjectExtraction.py
Class Name: OpRegionFeatures3d
Method Name: setupOutputs
Project Name: biocore/scikit-bio
Commit Name: 6e00de3f14cba558d1ffdb71072a2e60d97bc72d
Time: 2014-09-10
Author: ebolyen@gmail.com
File Name: skbio/io/newick.py
Class Name:
Method Name: _newick_sniffer