desc stringlengths 3 26.7k | decl stringlengths 11 7.89k | bodies stringlengths 8 553k |
|---|---|---|
'Turn away mode on.'
| def turn_away_mode_on(self):
| _LOGGER.error('Service Not Implemented yet')
|
'Turn away mode off.'
| def turn_away_mode_off(self):
| _LOGGER.error('Service Not Implemented yet')
|
'Turn auxillary heater on.'
| def turn_aux_heat_on(self):
| _LOGGER.error('Service Not Implemented yet')
|
'Turn auxillary heater off.'
| def turn_aux_heat_off(self):
| _LOGGER.error('Service Not Implemented yet')
|
'Initialize the Z-Wave climate device.'
| def __init__(self, values, temp_unit):
| ZWaveDeviceEntity.__init__(self, values, DOMAIN)
self._target_temperature = None
self._current_temperature = None
self._current_operation = None
self._operation_list = None
self._operating_state = None
self._current_fan_mode = None
self._fan_list = None
self._fan_state = None
sel... |
'Handle the data changes for node values.'
| def update_properties(self):
| if self.values.mode:
self._current_operation = self.values.mode.data
operation_list = self.values.mode.data_items
if operation_list:
self._operation_list = list(operation_list)
_LOGGER.debug('self._operation_list=%s', self._operation_list)
_LOGGER.debug('self._current_ope... |
'Return the fan speed set.'
| @property
def current_fan_mode(self):
| return self._current_fan_mode
|
'Return a list of available fan modes.'
| @property
def fan_list(self):
| return self._fan_list
|
'Return the swing mode set.'
| @property
def current_swing_mode(self):
| return self._current_swing_mode
|
'Return a list of available swing modes.'
| @property
def swing_list(self):
| return self._swing_list
|
'Return the unit of measurement.'
| @property
def temperature_unit(self):
| if (self._unit == 'C'):
return TEMP_CELSIUS
elif (self._unit == 'F'):
return TEMP_FAHRENHEIT
return self._unit
|
'Return the current temperature.'
| @property
def current_temperature(self):
| return self._current_temperature
|
'Return the current operation mode.'
| @property
def current_operation(self):
| return self._current_operation
|
'Return a list of available operation modes.'
| @property
def operation_list(self):
| return self._operation_list
|
'Return the temperature we try to reach.'
| @property
def target_temperature(self):
| return self._target_temperature
|
'Set new target temperature.'
| def set_temperature(self, **kwargs):
| if (kwargs.get(ATTR_TEMPERATURE) is not None):
temperature = kwargs.get(ATTR_TEMPERATURE)
else:
return
self.values.primary.data = temperature
|
'Set new target fan mode.'
| def set_fan_mode(self, fan):
| if self.values.fan_mode:
self.values.fan_mode.data = fan
|
'Set new target operation mode.'
| def set_operation_mode(self, operation_mode):
| if self.values.mode:
self.values.mode.data = operation_mode
|
'Set new target swing mode.'
| def set_swing_mode(self, swing_mode):
| if (self._zxt_120 == 1):
if self.values.zxt_120_swing_mode:
self.values.zxt_120_swing_mode.data = swing_mode
|
'Return the device specific state attributes.'
| @property
def device_state_attributes(self):
| data = super().device_state_attributes
if self._operating_state:
data[ATTR_OPERATING_STATE] = self._operating_state
if self._fan_state:
data[ATTR_FAN_STATE] = self._fan_state
return data
|
'Initialize the device.'
| def __init__(self, hass, thermostat, name, away_temp):
| self._name = name
self.hass = hass
self._away = False
self._away_temp = away_temp
self._prev_temp = thermostat.setpoint
self.thermostat = thermostat
self.thermostat.mode = 2
self._state = None
self._temperature = None
self._setpoint = None
|
'Return the name of this Thermostat.'
| @property
def name(self):
| return self._name
|
'Return the unit of measurement used by the platform.'
| @property
def temperature_unit(self):
| return TEMP_CELSIUS
|
'Return current operation i.e. heat, cool, idle.'
| @property
def current_operation(self):
| if self._state:
return STATE_HEAT
return STATE_IDLE
|
'Return the current temperature.'
| @property
def current_temperature(self):
| return self._temperature
|
'Return the temperature we try to reach.'
| @property
def target_temperature(self):
| return self._setpoint
|
'Set the temperature.'
| def set_temperature(self, **kwargs):
| self.turn_away_mode_off()
temp = kwargs.get(ATTR_TEMPERATURE)
self.thermostat.setpoint = temp
|
'Return true if away mode is on.'
| @property
def is_away_mode_on(self):
| return self._away
|
'Turn away mode on.'
| def turn_away_mode_on(self):
| if (not self._away):
self._prev_temp = self._setpoint
self.thermostat.setpoint = self._away_temp
self._away = True
|
'Turn away mode off.'
| def turn_away_mode_off(self):
| if self._away:
self.thermostat.setpoint = self._prev_temp
self._away = False
|
'Update local state.'
| def update(self):
| self._setpoint = self.thermostat.setpoint
self._temperature = self.thermostat.temperature
self._state = self.thermostat.state
|
'Initialize the unit.'
| def __init__(self, modbus_slave, name):
| from pyflexit import pyflexit
self._name = name
self._slave = modbus_slave
self._target_temperature = None
self._current_temperature = None
self._current_fan_mode = None
self._current_operation = None
self._fan_list = ['Off', 'Low', 'Medium', 'High']
self._current_operation = None
... |
'Update unit attributes.'
| def update(self):
| if (not self.unit.update()):
_LOGGER.warning('Modbus read failed')
self._target_temperature = self.unit.get_target_temp
self._current_temperature = self.unit.get_temp
self._current_fan_mode = self._fan_list[self.unit.get_fan_speed]
self._filter_hours = self.unit.get_filter_hours
se... |
'Return device specific state attributes.'
| @property
def device_state_attributes(self):
| return {'filter_hours': self._filter_hours, 'filter_alarm': self._filter_alarm, 'heat_recovery': self._heat_recovery, 'heating': self._heating, 'heater_enabled': self._heater_enabled, 'cooling': self._cooling}
|
'Return the polling state.'
| @property
def should_poll(self):
| return True
|
'Return the name of the climate device.'
| @property
def name(self):
| return self._name
|
'Return the unit of measurement.'
| @property
def temperature_unit(self):
| return TEMP_CELSIUS
|
'Return the current temperature.'
| @property
def current_temperature(self):
| return self._current_temperature
|
'Return the temperature we try to reach.'
| @property
def target_temperature(self):
| return self._target_temperature
|
'Return current operation ie. heat, cool, idle.'
| @property
def current_operation(self):
| return self._current_operation
|
'Return the fan setting.'
| @property
def current_fan_mode(self):
| return self._current_fan_mode
|
'Return the list of available fan modes.'
| @property
def fan_list(self):
| return self._fan_list
|
'Set new target temperature.'
| def set_temperature(self, **kwargs):
| if (kwargs.get(ATTR_TEMPERATURE) is not None):
self._target_temperature = kwargs.get(ATTR_TEMPERATURE)
self.unit.set_temp(self._target_temperature)
|
'Set new fan mode.'
| def set_fan_mode(self, fan):
| self.unit.set_fan_speed(self._fan_list.index(fan))
|
'Initialize of Tado climate device.'
| def __init__(self, store, zone_name, zone_id, data_id, min_temp, max_temp, ac_mode, tolerance=0.3):
| self._store = store
self._data_id = data_id
self.zone_name = zone_name
self.zone_id = zone_id
self.ac_mode = ac_mode
self._active = False
self._device_is_active = False
self._unit = TEMP_CELSIUS
self._cur_temp = None
self._cur_humidity = None
self._is_away = False
self._m... |
'Return the name of the device.'
| @property
def name(self):
| return self.zone_name
|
'Return the current humidity.'
| @property
def current_humidity(self):
| return self._cur_humidity
|
'Return the sensor temperature.'
| @property
def current_temperature(self):
| return self._cur_temp
|
'Return current readable operation mode.'
| @property
def current_operation(self):
| if self._cooling:
return 'Cooling'
return OPERATION_LIST.get(self._current_operation)
|
'Return the list of available operation modes (readable).'
| @property
def operation_list(self):
| return list(OPERATION_LIST.values())
|
'Return the fan setting.'
| @property
def current_fan_mode(self):
| if self.ac_mode:
return FAN_MODES_LIST.get(self._current_fan)
return None
|
'List of available fan modes.'
| @property
def fan_list(self):
| if self.ac_mode:
return list(FAN_MODES_LIST.values())
return None
|
'Return the unit of measurement used by the platform.'
| @property
def temperature_unit(self):
| return self._unit
|
'Return true if away mode is on.'
| @property
def is_away_mode_on(self):
| return self._is_away
|
'Return the temperature we try to reach.'
| @property
def target_temperature(self):
| return self._target_temp
|
'Set new target temperature.'
| def set_temperature(self, **kwargs):
| temperature = kwargs.get(ATTR_TEMPERATURE)
if (temperature is None):
return
self._current_operation = CONST_OVERLAY_TADO_MODE
self._overlay_mode = None
self._target_temp = temperature
self._control_heating()
|
'Set new operation mode.'
| def set_operation_mode(self, readable_operation_mode):
| operation_mode = CONST_MODE_SMART_SCHEDULE
for (mode, readable) in OPERATION_LIST.items():
if (readable == readable_operation_mode):
operation_mode = mode
break
self._current_operation = operation_mode
self._overlay_mode = None
self._control_heating()
|
'Return the minimum temperature.'
| @property
def min_temp(self):
| if self._min_temp:
return self._min_temp
return super().min_temp
|
'Return the maximum temperature.'
| @property
def max_temp(self):
| if self._max_temp:
return self._max_temp
return super().max_temp
|
'Update the state of this climate device.'
| def update(self):
| self._store.update()
data = self._store.get_data(self._data_id)
if (data is None):
_LOGGER.debug('Recieved no data for zone %s', self.zone_name)
return
if ('sensorDataPoints' in data):
sensor_data = data['sensorDataPoints']
unit = TEMP_CELSIUS
if ('... |
'Send new target temperature to mytado.'
| def _control_heating(self):
| if ((not self._active) and (None not in (self._cur_temp, self._target_temp))):
self._active = True
_LOGGER.info('Obtained current and target temperature. Tado thermostat active')
if ((not self._active) or (self._current_operation == self._overlay_mode)):
return
i... |
'Initialize the sensor.'
| def __init__(self, data, module_name, away_temp=None):
| self._data = data
self._state = None
self._name = module_name
self._target_temperature = None
self._away = None
|
'Return the name of the sensor.'
| @property
def name(self):
| return self._name
|
'Return the state of the device.'
| @property
def state(self):
| return self._target_temperature
|
'Return the unit of measurement.'
| @property
def temperature_unit(self):
| return TEMP_CELSIUS
|
'Return the current temperature.'
| @property
def current_temperature(self):
| return self._data.current_temperature
|
'Return the temperature we try to reach.'
| @property
def target_temperature(self):
| return self._target_temperature
|
'Return the current state of the thermostat.'
| @property
def current_operation(self):
| state = self._data.thermostatdata.relay_cmd
if (state == 0):
return STATE_IDLE
elif (state == 100):
return STATE_HEAT
|
'Return true if away mode is on.'
| @property
def is_away_mode_on(self):
| return self._away
|
'Turn away on.'
| def turn_away_mode_on(self):
| mode = 'away'
temp = None
self._data.thermostatdata.setthermpoint(mode, temp, endTimeOffset=None)
self._away = True
|
'Turn away off.'
| def turn_away_mode_off(self):
| mode = 'program'
temp = None
self._data.thermostatdata.setthermpoint(mode, temp, endTimeOffset=None)
self._away = False
|
'Set new target temperature for 2 hours.'
| def set_temperature(self, **kwargs):
| temperature = kwargs.get(ATTR_TEMPERATURE)
if (temperature is None):
return
mode = 'manual'
self._data.thermostatdata.setthermpoint(mode, temperature, DEFAULT_TIME_OFFSET)
self._target_temperature = temperature
self._away = False
|
'Get the latest data from NetAtmo API and updates the states.'
| @Throttle(MIN_TIME_BETWEEN_UPDATES)
def update(self):
| self._data.update()
self._target_temperature = self._data.thermostatdata.setpoint_temp
self._away = (self._data.setpoint_mode == 'away')
|
'Initialize the data object.'
| def __init__(self, auth, device=None):
| self.auth = auth
self.thermostatdata = None
self.module_names = []
self.device = device
self.current_temperature = None
self.target_temperature = None
self.setpoint_mode = None
|
'Return all module available on the API as a list.'
| def get_module_names(self):
| self.update()
if (not self.device):
for device in self.thermostatdata.modules:
for module in self.thermostatdata.modules[device].values():
self.module_names.append(module['module_name'])
else:
for module in self.thermostatdata.modules[self.device].values():
... |
'Call the NetAtmo API to update the data.'
| @Throttle(MIN_TIME_BETWEEN_UPDATES)
def update(self):
| import lnetatmo
self.thermostatdata = lnetatmo.ThermostatData(self.auth)
self.target_temperature = self.thermostatdata.setpoint_temp
self.setpoint_mode = self.thermostatdata.setpoint_mode
self.current_temperature = self.thermostatdata.temp
|
'Initialize the thermostat based on the given configuration.'
| def __init__(self, hass, config):
| KNXMultiAddressDevice.__init__(self, hass, config, ['temperature', 'setpoint'], ['mode'])
self._unit_of_measurement = TEMP_CELSIUS
self._away = False
self._is_fan_on = False
self._current_temp = None
self._target_temp = None
|
'Return the polling state, is needed for the KNX thermostat.'
| @property
def should_poll(self):
| return True
|
'Return the unit of measurement.'
| @property
def temperature_unit(self):
| return self._unit_of_measurement
|
'Return the current temperature.'
| @property
def current_temperature(self):
| return self._current_temp
|
'Return the temperature we try to reach.'
| @property
def target_temperature(self):
| return self._target_temp
|
'Set new target temperature.'
| def set_temperature(self, **kwargs):
| temperature = kwargs.get(ATTR_TEMPERATURE)
if (temperature is None):
return
from knxip.conversion import float_to_knx2
self.set_value('setpoint', float_to_knx2(temperature))
_LOGGER.debug('Set target temperature to %s', temperature)
|
'Set operation mode.'
| def set_operation_mode(self, operation_mode):
| raise NotImplementedError()
|
'Update KNX climate.'
| def update(self):
| from knxip.conversion import knx2_to_float
super().update()
self._current_temp = knx2_to_float(self.value('temperature'))
self._target_temp = knx2_to_float(self.value('setpoint'))
|
'Initialize the Wink device.'
| def __init__(self, wink, hass, temp_unit):
| super().__init__(wink, hass)
self._config_temp_unit = temp_unit
|
'Callback when entity is added to hass.'
| @asyncio.coroutine
def async_added_to_hass(self):
| self.hass.data[DOMAIN]['entities']['climate'].append(self)
|
'Return the unit of measurement.'
| @property
def temperature_unit(self):
| return TEMP_CELSIUS
|
'Return the optional state attributes.'
| @property
def device_state_attributes(self):
| data = {}
target_temp_high = self.target_temperature_high
target_temp_low = self.target_temperature_low
if (target_temp_high is not None):
data[ATTR_TARGET_TEMP_HIGH] = self._convert_for_display(self.target_temperature_high)
if (target_temp_low is not None):
data[ATTR_TARGET_TEMP_LOW... |
'Return the current temperature.'
| @property
def current_temperature(self):
| return self.wink.current_temperature()
|
'Return the current humidity.'
| @property
def current_humidity(self):
| if (self.wink.current_humidity() is not None):
if (self.wink.current_humidity() < 1):
return (self.wink.current_humidity() * 100)
return self.wink.current_humidity()
return None
|
'Return the current external temperature.'
| @property
def external_temperature(self):
| return self.wink.current_external_temperature()
|
'Return the current average temp of all remote sensor.'
| @property
def smart_temperature(self):
| return self.wink.current_smart_temperature()
|
'Return status of eco target (Is the termostat in eco mode).'
| @property
def eco_target(self):
| return self.wink.eco_target()
|
'Return status of if the thermostat has detected occupancy.'
| @property
def occupied(self):
| return self.wink.occupied()
|
'Return current operation ie. heat, cool, idle.'
| @property
def current_operation(self):
| if (not self.wink.is_on()):
current_op = STATE_OFF
elif (self.wink.current_hvac_mode() == 'cool_only'):
current_op = STATE_COOL
elif (self.wink.current_hvac_mode() == 'heat_only'):
current_op = STATE_HEAT
elif (self.wink.current_hvac_mode() == 'aux'):
current_op = STATE_H... |
'Return the humidity we try to reach.'
| @property
def target_humidity(self):
| target_hum = None
if (self.wink.current_humidifier_mode() == 'on'):
if (self.wink.current_humidifier_set_point() is not None):
target_hum = (self.wink.current_humidifier_set_point() * 100)
elif (self.wink.current_dehumidifier_mode() == 'on'):
if (self.wink.current_dehumidifier_se... |
'Return the temperature we try to reach.'
| @property
def target_temperature(self):
| if ((self.current_operation != STATE_AUTO) and (not self.is_away_mode_on)):
if (self.current_operation == STATE_COOL):
return self.wink.current_max_set_point()
elif (self.current_operation == STATE_HEAT):
return self.wink.current_min_set_point()
return None
|
'Return the lower bound temperature we try to reach.'
| @property
def target_temperature_low(self):
| if (self.current_operation == STATE_AUTO):
return self.wink.current_min_set_point()
return None
|
'Return the higher bound temperature we try to reach.'
| @property
def target_temperature_high(self):
| if (self.current_operation == STATE_AUTO):
return self.wink.current_max_set_point()
return None
|
'Return if away mode is on.'
| @property
def is_away_mode_on(self):
| return self.wink.away()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.