Search is not available for this dataset
identifier
stringlengths
1
155
parameters
stringlengths
2
6.09k
docstring
stringlengths
11
63.4k
docstring_summary
stringlengths
0
63.4k
function
stringlengths
29
99.8k
function_tokens
list
start_point
list
end_point
list
language
stringclasses
1 value
docstring_language
stringlengths
2
7
docstring_language_predictions
stringlengths
18
23
is_langid_reliable
stringclasses
2 values
test_play_media_invalid_type
(hass, remote)
Test for play_media with invalid media type.
Test for play_media with invalid media type.
async def test_play_media_invalid_type(hass, remote): """Test for play_media with invalid media type.""" with patch("homeassistant.components.samsungtv.bridge.Remote") as remote: url = "https://example.com" await setup_samsungtv(hass, MOCK_CONFIG) remote.reset_mock() assert await...
[ "async", "def", "test_play_media_invalid_type", "(", "hass", ",", "remote", ")", ":", "with", "patch", "(", "\"homeassistant.components.samsungtv.bridge.Remote\"", ")", "as", "remote", ":", "url", "=", "\"https://example.com\"", "await", "setup_samsungtv", "(", "hass", ...
[ 650, 0 ]
[ 669, 37 ]
python
en
['en', 'en', 'en']
True
test_play_media_channel_as_string
(hass, remote)
Test for play_media with invalid channel as string.
Test for play_media with invalid channel as string.
async def test_play_media_channel_as_string(hass, remote): """Test for play_media with invalid channel as string.""" with patch("homeassistant.components.samsungtv.bridge.Remote") as remote: url = "https://example.com" await setup_samsungtv(hass, MOCK_CONFIG) remote.reset_mock() ...
[ "async", "def", "test_play_media_channel_as_string", "(", "hass", ",", "remote", ")", ":", "with", "patch", "(", "\"homeassistant.components.samsungtv.bridge.Remote\"", ")", "as", "remote", ":", "url", "=", "\"https://example.com\"", "await", "setup_samsungtv", "(", "ha...
[ 672, 0 ]
[ 691, 37 ]
python
en
['en', 'en', 'en']
True
test_play_media_channel_as_non_positive
(hass, remote)
Test for play_media with invalid channel as non positive integer.
Test for play_media with invalid channel as non positive integer.
async def test_play_media_channel_as_non_positive(hass, remote): """Test for play_media with invalid channel as non positive integer.""" with patch("homeassistant.components.samsungtv.bridge.Remote") as remote: await setup_samsungtv(hass, MOCK_CONFIG) remote.reset_mock() assert await has...
[ "async", "def", "test_play_media_channel_as_non_positive", "(", "hass", ",", "remote", ")", ":", "with", "patch", "(", "\"homeassistant.components.samsungtv.bridge.Remote\"", ")", "as", "remote", ":", "await", "setup_samsungtv", "(", "hass", ",", "MOCK_CONFIG", ")", "...
[ 694, 0 ]
[ 712, 37 ]
python
en
['en', 'en', 'en']
True
test_select_source
(hass, remote)
Test for select_source.
Test for select_source.
async def test_select_source(hass, remote): """Test for select_source.""" await setup_samsungtv(hass, MOCK_CONFIG) assert await hass.services.async_call( DOMAIN, SERVICE_SELECT_SOURCE, {ATTR_ENTITY_ID: ENTITY_ID, ATTR_INPUT_SOURCE: "HDMI"}, True, ) # key and update ca...
[ "async", "def", "test_select_source", "(", "hass", ",", "remote", ")", ":", "await", "setup_samsungtv", "(", "hass", ",", "MOCK_CONFIG", ")", "assert", "await", "hass", ".", "services", ".", "async_call", "(", "DOMAIN", ",", "SERVICE_SELECT_SOURCE", ",", "{", ...
[ 715, 0 ]
[ 728, 50 ]
python
en
['en', 'en', 'en']
True
test_select_source_invalid_source
(hass, remote)
Test for select_source with invalid source.
Test for select_source with invalid source.
async def test_select_source_invalid_source(hass, remote): """Test for select_source with invalid source.""" with patch("homeassistant.components.samsungtv.bridge.Remote") as remote: await setup_samsungtv(hass, MOCK_CONFIG) remote.reset_mock() assert await hass.services.async_call( ...
[ "async", "def", "test_select_source_invalid_source", "(", "hass", ",", "remote", ")", ":", "with", "patch", "(", "\"homeassistant.components.samsungtv.bridge.Remote\"", ")", "as", "remote", ":", "await", "setup_samsungtv", "(", "hass", ",", "MOCK_CONFIG", ")", "remote...
[ 731, 0 ]
[ 745, 37 ]
python
en
['en', 'en', 'en']
True
setup_platform
(hass, config, add_entities, discovery_info=None)
Set up the iOS sensor.
Set up the iOS sensor.
def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the iOS sensor."""
[ "def", "setup_platform", "(", "hass", ",", "config", ",", "add_entities", ",", "discovery_info", "=", "None", ")", ":" ]
[ 19, 0 ]
[ 20, 32 ]
python
en
['en', 'pt', 'en']
True
async_setup_entry
(hass, config_entry, async_add_entities)
Set up iOS from a config entry.
Set up iOS from a config entry.
async def async_setup_entry(hass, config_entry, async_add_entities): """Set up iOS from a config entry.""" dev = [] for device_name, device in ios.devices(hass).items(): for sensor_type in ("level", "state"): dev.append(IOSSensor(sensor_type, device_name, device)) async_add_entities...
[ "async", "def", "async_setup_entry", "(", "hass", ",", "config_entry", ",", "async_add_entities", ")", ":", "dev", "=", "[", "]", "for", "device_name", ",", "device", "in", "ios", ".", "devices", "(", "hass", ")", ".", "items", "(", ")", ":", "for", "s...
[ 24, 0 ]
[ 31, 33 ]
python
en
['en', 'en', 'en']
True
IOSSensor.__init__
(self, sensor_type, device_name, device)
Initialize the sensor.
Initialize the sensor.
def __init__(self, sensor_type, device_name, device): """Initialize the sensor.""" self._device_name = device_name self._name = f"{device_name} {SENSOR_TYPES[sensor_type][0]}" self._device = device self.type = sensor_type self._state = None self._unit_of_measureme...
[ "def", "__init__", "(", "self", ",", "sensor_type", ",", "device_name", ",", "device", ")", ":", "self", ".", "_device_name", "=", "device_name", "self", ".", "_name", "=", "f\"{device_name} {SENSOR_TYPES[sensor_type][0]}\"", "self", ".", "_device", "=", "device",...
[ 37, 4 ]
[ 44, 64 ]
python
en
['en', 'en', 'en']
True
IOSSensor.device_info
(self)
Return information about the device.
Return information about the device.
def device_info(self): """Return information about the device.""" return { "identifiers": { ( ios.DOMAIN, self._device[ios.ATTR_DEVICE][ios.ATTR_DEVICE_PERMANENT_ID], ) }, "name": self._device[ios...
[ "def", "device_info", "(", "self", ")", ":", "return", "{", "\"identifiers\"", ":", "{", "(", "ios", ".", "DOMAIN", ",", "self", ".", "_device", "[", "ios", ".", "ATTR_DEVICE", "]", "[", "ios", ".", "ATTR_DEVICE_PERMANENT_ID", "]", ",", ")", "}", ",", ...
[ 47, 4 ]
[ 60, 9 ]
python
en
['en', 'en', 'en']
True
IOSSensor.name
(self)
Return the name of the iOS sensor.
Return the name of the iOS sensor.
def name(self): """Return the name of the iOS sensor.""" device_name = self._device[ios.ATTR_DEVICE][ios.ATTR_DEVICE_NAME] return f"{device_name} {SENSOR_TYPES[self.type][0]}"
[ "def", "name", "(", "self", ")", ":", "device_name", "=", "self", ".", "_device", "[", "ios", ".", "ATTR_DEVICE", "]", "[", "ios", ".", "ATTR_DEVICE_NAME", "]", "return", "f\"{device_name} {SENSOR_TYPES[self.type][0]}\"" ]
[ 63, 4 ]
[ 66, 60 ]
python
en
['en', 'mi', 'en']
True
IOSSensor.state
(self)
Return the state of the sensor.
Return the state of the sensor.
def state(self): """Return the state of the sensor.""" return self._state
[ "def", "state", "(", "self", ")", ":", "return", "self", ".", "_state" ]
[ 69, 4 ]
[ 71, 26 ]
python
en
['en', 'en', 'en']
True
IOSSensor.unique_id
(self)
Return the unique ID of this sensor.
Return the unique ID of this sensor.
def unique_id(self): """Return the unique ID of this sensor.""" device_id = self._device[ios.ATTR_DEVICE_ID] return f"{self.type}_{device_id}"
[ "def", "unique_id", "(", "self", ")", ":", "device_id", "=", "self", ".", "_device", "[", "ios", ".", "ATTR_DEVICE_ID", "]", "return", "f\"{self.type}_{device_id}\"" ]
[ 74, 4 ]
[ 77, 41 ]
python
en
['en', 'la', 'en']
True
IOSSensor.should_poll
(self)
No polling needed.
No polling needed.
def should_poll(self): """No polling needed.""" return False
[ "def", "should_poll", "(", "self", ")", ":", "return", "False" ]
[ 80, 4 ]
[ 82, 20 ]
python
en
['en', 'en', 'en']
True
IOSSensor.unit_of_measurement
(self)
Return the unit of measurement this sensor expresses itself in.
Return the unit of measurement this sensor expresses itself in.
def unit_of_measurement(self): """Return the unit of measurement this sensor expresses itself in.""" return self._unit_of_measurement
[ "def", "unit_of_measurement", "(", "self", ")", ":", "return", "self", ".", "_unit_of_measurement" ]
[ 85, 4 ]
[ 87, 40 ]
python
en
['en', 'en', 'en']
True
IOSSensor.device_state_attributes
(self)
Return the device state attributes.
Return the device state attributes.
def device_state_attributes(self): """Return the device state attributes.""" device = self._device[ios.ATTR_DEVICE] device_battery = self._device[ios.ATTR_BATTERY] return { "Battery State": device_battery[ios.ATTR_BATTERY_STATE], "Battery Level": device_battery[io...
[ "def", "device_state_attributes", "(", "self", ")", ":", "device", "=", "self", ".", "_device", "[", "ios", ".", "ATTR_DEVICE", "]", "device_battery", "=", "self", ".", "_device", "[", "ios", ".", "ATTR_BATTERY", "]", "return", "{", "\"Battery State\"", ":",...
[ 90, 4 ]
[ 100, 9 ]
python
en
['en', 'en', 'en']
True
IOSSensor.icon
(self)
Return the icon to use in the frontend, if any.
Return the icon to use in the frontend, if any.
def icon(self): """Return the icon to use in the frontend, if any.""" device_battery = self._device[ios.ATTR_BATTERY] battery_state = device_battery[ios.ATTR_BATTERY_STATE] battery_level = device_battery[ios.ATTR_BATTERY_LEVEL] charging = True icon_state = DEFAULT_ICON_ST...
[ "def", "icon", "(", "self", ")", ":", "device_battery", "=", "self", ".", "_device", "[", "ios", ".", "ATTR_BATTERY", "]", "battery_state", "=", "device_battery", "[", "ios", ".", "ATTR_BATTERY_STATE", "]", "battery_level", "=", "device_battery", "[", "ios", ...
[ 103, 4 ]
[ 123, 85 ]
python
en
['en', 'en', 'en']
True
IOSSensor._update
(self, device)
Get the latest state of the sensor.
Get the latest state of the sensor.
def _update(self, device): """Get the latest state of the sensor.""" self._device = device self._state = self._device[ios.ATTR_BATTERY][self.type] self.async_write_ha_state()
[ "def", "_update", "(", "self", ",", "device", ")", ":", "self", ".", "_device", "=", "device", "self", ".", "_state", "=", "self", ".", "_device", "[", "ios", ".", "ATTR_BATTERY", "]", "[", "self", ".", "type", "]", "self", ".", "async_write_ha_state",...
[ 126, 4 ]
[ 130, 35 ]
python
en
['en', 'en', 'en']
True
IOSSensor.async_added_to_hass
(self)
Added to hass so need to register to dispatch.
Added to hass so need to register to dispatch.
async def async_added_to_hass(self) -> None: """Added to hass so need to register to dispatch.""" self._state = self._device[ios.ATTR_BATTERY][self.type] device_id = self._device[ios.ATTR_DEVICE_ID] self.async_on_remove( async_dispatcher_connect(self.hass, f"{DOMAIN}.{device_...
[ "async", "def", "async_added_to_hass", "(", "self", ")", "->", "None", ":", "self", ".", "_state", "=", "self", ".", "_device", "[", "ios", ".", "ATTR_BATTERY", "]", "[", "self", ".", "type", "]", "device_id", "=", "self", ".", "_device", "[", "ios", ...
[ 132, 4 ]
[ 138, 9 ]
python
en
['en', 'en', 'en']
True
_async_create_entities
(hass, config)
Create Template Alarm Control Panels.
Create Template Alarm Control Panels.
async def _async_create_entities(hass, config): """Create Template Alarm Control Panels.""" alarm_control_panels = [] for device, device_config in config[CONF_ALARM_CONTROL_PANELS].items(): name = device_config.get(CONF_NAME, device) state_template = device_config.get(CONF_VALUE_TEMPLATE) ...
[ "async", "def", "_async_create_entities", "(", "hass", ",", "config", ")", ":", "alarm_control_panels", "=", "[", "]", "for", "device", ",", "device_config", "in", "config", "[", "CONF_ALARM_CONTROL_PANELS", "]", ".", "items", "(", ")", ":", "name", "=", "de...
[ 81, 0 ]
[ 111, 31 ]
python
en
['en', 'ro', 'en']
True
async_setup_platform
(hass, config, async_add_entities, discovery_info=None)
Set up the Template Alarm Control Panels.
Set up the Template Alarm Control Panels.
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Set up the Template Alarm Control Panels.""" await async_setup_reload_service(hass, DOMAIN, PLATFORMS) async_add_entities(await _async_create_entities(hass, config))
[ "async", "def", "async_setup_platform", "(", "hass", ",", "config", ",", "async_add_entities", ",", "discovery_info", "=", "None", ")", ":", "await", "async_setup_reload_service", "(", "hass", ",", "DOMAIN", ",", "PLATFORMS", ")", "async_add_entities", "(", "await...
[ 114, 0 ]
[ 118, 66 ]
python
en
['en', 'en', 'en']
True
AlarmControlPanelTemplate.__init__
( self, hass, device_id, name, state_template, disarm_action, arm_away_action, arm_home_action, arm_night_action, code_arm_required, unique_id, )
Initialize the panel.
Initialize the panel.
def __init__( self, hass, device_id, name, state_template, disarm_action, arm_away_action, arm_home_action, arm_night_action, code_arm_required, unique_id, ): """Initialize the panel.""" super().__init__() ...
[ "def", "__init__", "(", "self", ",", "hass", ",", "device_id", ",", "name", ",", "state_template", ",", "disarm_action", ",", "arm_away_action", ",", "arm_home_action", ",", "arm_night_action", ",", "code_arm_required", ",", "unique_id", ",", ")", ":", "super", ...
[ 124, 4 ]
[ 160, 35 ]
python
en
['en', 'en', 'en']
True
AlarmControlPanelTemplate.name
(self)
Return the display name of this alarm control panel.
Return the display name of this alarm control panel.
def name(self): """Return the display name of this alarm control panel.""" return self._name
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "_name" ]
[ 163, 4 ]
[ 165, 25 ]
python
en
['en', 'en', 'en']
True
AlarmControlPanelTemplate.unique_id
(self)
Return the unique id of this alarm control panel.
Return the unique id of this alarm control panel.
def unique_id(self): """Return the unique id of this alarm control panel.""" return self._unique_id
[ "def", "unique_id", "(", "self", ")", ":", "return", "self", ".", "_unique_id" ]
[ 168, 4 ]
[ 170, 30 ]
python
en
['en', 'la', 'en']
True
AlarmControlPanelTemplate.state
(self)
Return the state of the device.
Return the state of the device.
def state(self): """Return the state of the device.""" return self._state
[ "def", "state", "(", "self", ")", ":", "return", "self", ".", "_state" ]
[ 173, 4 ]
[ 175, 26 ]
python
en
['en', 'en', 'en']
True
AlarmControlPanelTemplate.supported_features
(self)
Return the list of supported features.
Return the list of supported features.
def supported_features(self) -> int: """Return the list of supported features.""" supported_features = 0 if self._arm_night_script is not None: supported_features = supported_features | SUPPORT_ALARM_ARM_NIGHT if self._arm_home_script is not None: supported_featu...
[ "def", "supported_features", "(", "self", ")", "->", "int", ":", "supported_features", "=", "0", "if", "self", ".", "_arm_night_script", "is", "not", "None", ":", "supported_features", "=", "supported_features", "|", "SUPPORT_ALARM_ARM_NIGHT", "if", "self", ".", ...
[ 178, 4 ]
[ 190, 33 ]
python
en
['en', 'en', 'en']
True
AlarmControlPanelTemplate.code_format
(self)
Return one or more digits/characters.
Return one or more digits/characters.
def code_format(self): """Return one or more digits/characters.""" return FORMAT_NUMBER
[ "def", "code_format", "(", "self", ")", ":", "return", "FORMAT_NUMBER" ]
[ 193, 4 ]
[ 195, 28 ]
python
en
['en', 'en', 'en']
True
AlarmControlPanelTemplate.code_arm_required
(self)
Whether the code is required for arm actions.
Whether the code is required for arm actions.
def code_arm_required(self): """Whether the code is required for arm actions.""" return self._code_arm_required
[ "def", "code_arm_required", "(", "self", ")", ":", "return", "self", ".", "_code_arm_required" ]
[ 198, 4 ]
[ 200, 38 ]
python
en
['en', 'en', 'en']
True
AlarmControlPanelTemplate.async_added_to_hass
(self)
Register callbacks.
Register callbacks.
async def async_added_to_hass(self): """Register callbacks.""" if self._template: self.add_template_attribute( "_state", self._template, None, self._update_state ) await super().async_added_to_hass()
[ "async", "def", "async_added_to_hass", "(", "self", ")", ":", "if", "self", ".", "_template", ":", "self", ".", "add_template_attribute", "(", "\"_state\"", ",", "self", ".", "_template", ",", "None", ",", "self", ".", "_update_state", ")", "await", "super",...
[ 221, 4 ]
[ 227, 43 ]
python
en
['en', 'no', 'en']
False
AlarmControlPanelTemplate._async_alarm_arm
(self, state, script=None, code=None)
Arm the panel to specified state with supplied script.
Arm the panel to specified state with supplied script.
async def _async_alarm_arm(self, state, script=None, code=None): """Arm the panel to specified state with supplied script.""" optimistic_set = False if self._template is None: self._state = state optimistic_set = True if script is not None: await scr...
[ "async", "def", "_async_alarm_arm", "(", "self", ",", "state", ",", "script", "=", "None", ",", "code", "=", "None", ")", ":", "optimistic_set", "=", "False", "if", "self", ".", "_template", "is", "None", ":", "self", ".", "_state", "=", "state", "opti...
[ 229, 4 ]
[ 243, 39 ]
python
en
['en', 'en', 'en']
True
AlarmControlPanelTemplate.async_alarm_arm_away
(self, code=None)
Arm the panel to Away.
Arm the panel to Away.
async def async_alarm_arm_away(self, code=None): """Arm the panel to Away.""" await self._async_alarm_arm( STATE_ALARM_ARMED_AWAY, script=self._arm_away_script, code=code )
[ "async", "def", "async_alarm_arm_away", "(", "self", ",", "code", "=", "None", ")", ":", "await", "self", ".", "_async_alarm_arm", "(", "STATE_ALARM_ARMED_AWAY", ",", "script", "=", "self", ".", "_arm_away_script", ",", "code", "=", "code", ")" ]
[ 245, 4 ]
[ 249, 9 ]
python
en
['en', 'en', 'en']
True
AlarmControlPanelTemplate.async_alarm_arm_home
(self, code=None)
Arm the panel to Home.
Arm the panel to Home.
async def async_alarm_arm_home(self, code=None): """Arm the panel to Home.""" await self._async_alarm_arm( STATE_ALARM_ARMED_HOME, script=self._arm_home_script, code=code )
[ "async", "def", "async_alarm_arm_home", "(", "self", ",", "code", "=", "None", ")", ":", "await", "self", ".", "_async_alarm_arm", "(", "STATE_ALARM_ARMED_HOME", ",", "script", "=", "self", ".", "_arm_home_script", ",", "code", "=", "code", ")" ]
[ 251, 4 ]
[ 255, 9 ]
python
en
['en', 'en', 'en']
True
AlarmControlPanelTemplate.async_alarm_arm_night
(self, code=None)
Arm the panel to Night.
Arm the panel to Night.
async def async_alarm_arm_night(self, code=None): """Arm the panel to Night.""" await self._async_alarm_arm( STATE_ALARM_ARMED_NIGHT, script=self._arm_night_script, code=code )
[ "async", "def", "async_alarm_arm_night", "(", "self", ",", "code", "=", "None", ")", ":", "await", "self", ".", "_async_alarm_arm", "(", "STATE_ALARM_ARMED_NIGHT", ",", "script", "=", "self", ".", "_arm_night_script", ",", "code", "=", "code", ")" ]
[ 257, 4 ]
[ 261, 9 ]
python
en
['en', 'en', 'en']
True
AlarmControlPanelTemplate.async_alarm_disarm
(self, code=None)
Disarm the panel.
Disarm the panel.
async def async_alarm_disarm(self, code=None): """Disarm the panel.""" await self._async_alarm_arm( STATE_ALARM_DISARMED, script=self._disarm_script, code=code )
[ "async", "def", "async_alarm_disarm", "(", "self", ",", "code", "=", "None", ")", ":", "await", "self", ".", "_async_alarm_arm", "(", "STATE_ALARM_DISARMED", ",", "script", "=", "self", ".", "_disarm_script", ",", "code", "=", "code", ")" ]
[ 263, 4 ]
[ 267, 9 ]
python
en
['en', 'ceb', 'en']
True
ConfigFlow.async_step_user
(self, user_input=None)
Handle the initial step.
Handle the initial step.
async def async_step_user(self, user_input=None): """Handle the initial step.""" errors = {} if self._options is None: self._options = {OPTION_WORLDWIDE: "Worldwide"} coordinator = await get_coordinator(self.hass) for case in sorted( coordinat...
[ "async", "def", "async_step_user", "(", "self", ",", "user_input", "=", "None", ")", ":", "errors", "=", "{", "}", "if", "self", ".", "_options", "is", "None", ":", "self", ".", "_options", "=", "{", "OPTION_WORLDWIDE", ":", "\"Worldwide\"", "}", "coordi...
[ 17, 4 ]
[ 40, 9 ]
python
en
['en', 'en', 'en']
True
_mock_get_config
()
Return a default nuheat config.
Return a default nuheat config.
def _mock_get_config(): """Return a default nuheat config.""" return { DOMAIN: {CONF_USERNAME: "me", CONF_PASSWORD: "secret", CONF_DEVICES: [12345]} }
[ "def", "_mock_get_config", "(", ")", ":", "return", "{", "DOMAIN", ":", "{", "CONF_USERNAME", ":", "\"me\"", ",", "CONF_PASSWORD", ":", "\"secret\"", ",", "CONF_DEVICES", ":", "[", "12345", "]", "}", "}" ]
[ 123, 0 ]
[ 127, 5 ]
python
en
['es', 'fr', 'en']
False
async_setup_entry
(hass, config_entry, async_add_entities)
Set up the ecobee thermostat.
Set up the ecobee thermostat.
async def async_setup_entry(hass, config_entry, async_add_entities): """Set up the ecobee thermostat.""" data = hass.data[DOMAIN] devices = [Thermostat(data, index) for index in range(len(data.ecobee.thermostats))] async_add_entities(devices, True) platform = entity_platform.current_platform.get...
[ "async", "def", "async_setup_entry", "(", "hass", ",", "config_entry", ",", "async_add_entities", ")", ":", "data", "=", "hass", ".", "data", "[", "DOMAIN", "]", "devices", "=", "[", "Thermostat", "(", "data", ",", "index", ")", "for", "index", "in", "ra...
[ 166, 0 ]
[ 279, 5 ]
python
en
['en', 'en', 'en']
True
Thermostat.__init__
(self, data, thermostat_index)
Initialize the thermostat.
Initialize the thermostat.
def __init__(self, data, thermostat_index): """Initialize the thermostat.""" self.data = data self.thermostat_index = thermostat_index self.thermostat = self.data.ecobee.get_thermostat(self.thermostat_index) self._name = self.thermostat["name"] self.vacation = None ...
[ "def", "__init__", "(", "self", ",", "data", ",", "thermostat_index", ")", ":", "self", ".", "data", "=", "data", "self", ".", "thermostat_index", "=", "thermostat_index", "self", ".", "thermostat", "=", "self", ".", "data", ".", "ecobee", ".", "get_thermo...
[ 285, 4 ]
[ 311, 44 ]
python
en
['en', 'en', 'en']
True
Thermostat.async_update
(self)
Get the latest state from the thermostat.
Get the latest state from the thermostat.
async def async_update(self): """Get the latest state from the thermostat.""" if self.update_without_throttle: await self.data.update(no_throttle=True) self.update_without_throttle = False else: await self.data.update() self.thermostat = self.data.ecob...
[ "async", "def", "async_update", "(", "self", ")", ":", "if", "self", ".", "update_without_throttle", ":", "await", "self", ".", "data", ".", "update", "(", "no_throttle", "=", "True", ")", "self", ".", "update_without_throttle", "=", "False", "else", ":", ...
[ 313, 4 ]
[ 322, 56 ]
python
en
['en', 'en', 'en']
True
Thermostat.available
(self)
Return if device is available.
Return if device is available.
def available(self): """Return if device is available.""" return self.thermostat["runtime"]["connected"]
[ "def", "available", "(", "self", ")", ":", "return", "self", ".", "thermostat", "[", "\"runtime\"", "]", "[", "\"connected\"", "]" ]
[ 325, 4 ]
[ 327, 54 ]
python
en
['en', 'en', 'en']
True
Thermostat.supported_features
(self)
Return the list of supported features.
Return the list of supported features.
def supported_features(self): """Return the list of supported features.""" return SUPPORT_FLAGS
[ "def", "supported_features", "(", "self", ")", ":", "return", "SUPPORT_FLAGS" ]
[ 330, 4 ]
[ 332, 28 ]
python
en
['en', 'en', 'en']
True
Thermostat.name
(self)
Return the name of the Ecobee Thermostat.
Return the name of the Ecobee Thermostat.
def name(self): """Return the name of the Ecobee Thermostat.""" return self.thermostat["name"]
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "thermostat", "[", "\"name\"", "]" ]
[ 335, 4 ]
[ 337, 38 ]
python
en
['en', 'en', 'en']
True
Thermostat.unique_id
(self)
Return a unique identifier for this ecobee thermostat.
Return a unique identifier for this ecobee thermostat.
def unique_id(self): """Return a unique identifier for this ecobee thermostat.""" return self.thermostat["identifier"]
[ "def", "unique_id", "(", "self", ")", ":", "return", "self", ".", "thermostat", "[", "\"identifier\"", "]" ]
[ 340, 4 ]
[ 342, 44 ]
python
en
['en', 'en', 'en']
True
Thermostat.device_info
(self)
Return device information for this ecobee thermostat.
Return device information for this ecobee thermostat.
def device_info(self): """Return device information for this ecobee thermostat.""" try: model = f"{ECOBEE_MODEL_TO_NAME[self.thermostat['modelNumber']]} Thermostat" except KeyError: _LOGGER.error( "Model number for ecobee thermostat %s not recognized. " ...
[ "def", "device_info", "(", "self", ")", ":", "try", ":", "model", "=", "f\"{ECOBEE_MODEL_TO_NAME[self.thermostat['modelNumber']]} Thermostat\"", "except", "KeyError", ":", "_LOGGER", ".", "error", "(", "\"Model number for ecobee thermostat %s not recognized. \"", "\"Please visi...
[ 345, 4 ]
[ 365, 9 ]
python
en
['en', 'en', 'en']
True
Thermostat.temperature_unit
(self)
Return the unit of measurement.
Return the unit of measurement.
def temperature_unit(self): """Return the unit of measurement.""" return TEMP_FAHRENHEIT
[ "def", "temperature_unit", "(", "self", ")", ":", "return", "TEMP_FAHRENHEIT" ]
[ 368, 4 ]
[ 370, 30 ]
python
en
['en', 'la', 'en']
True
Thermostat.current_temperature
(self)
Return the current temperature.
Return the current temperature.
def current_temperature(self): """Return the current temperature.""" return self.thermostat["runtime"]["actualTemperature"] / 10.0
[ "def", "current_temperature", "(", "self", ")", ":", "return", "self", ".", "thermostat", "[", "\"runtime\"", "]", "[", "\"actualTemperature\"", "]", "/", "10.0" ]
[ 373, 4 ]
[ 375, 69 ]
python
en
['en', 'la', 'en']
True
Thermostat.target_temperature_low
(self)
Return the lower bound temperature we try to reach.
Return the lower bound temperature we try to reach.
def target_temperature_low(self): """Return the lower bound temperature we try to reach.""" if self.hvac_mode == HVAC_MODE_HEAT_COOL: return self.thermostat["runtime"]["desiredHeat"] / 10.0 return None
[ "def", "target_temperature_low", "(", "self", ")", ":", "if", "self", ".", "hvac_mode", "==", "HVAC_MODE_HEAT_COOL", ":", "return", "self", ".", "thermostat", "[", "\"runtime\"", "]", "[", "\"desiredHeat\"", "]", "/", "10.0", "return", "None" ]
[ 378, 4 ]
[ 382, 19 ]
python
en
['en', 'en', 'en']
True
Thermostat.target_temperature_high
(self)
Return the upper bound temperature we try to reach.
Return the upper bound temperature we try to reach.
def target_temperature_high(self): """Return the upper bound temperature we try to reach.""" if self.hvac_mode == HVAC_MODE_HEAT_COOL: return self.thermostat["runtime"]["desiredCool"] / 10.0 return None
[ "def", "target_temperature_high", "(", "self", ")", ":", "if", "self", ".", "hvac_mode", "==", "HVAC_MODE_HEAT_COOL", ":", "return", "self", ".", "thermostat", "[", "\"runtime\"", "]", "[", "\"desiredCool\"", "]", "/", "10.0", "return", "None" ]
[ 385, 4 ]
[ 389, 19 ]
python
en
['en', 'en', 'en']
True
Thermostat.target_temperature
(self)
Return the temperature we try to reach.
Return the temperature we try to reach.
def target_temperature(self): """Return the temperature we try to reach.""" if self.hvac_mode == HVAC_MODE_HEAT_COOL: return None if self.hvac_mode == HVAC_MODE_HEAT: return self.thermostat["runtime"]["desiredHeat"] / 10.0 if self.hvac_mode == HVAC_MODE_COOL: ...
[ "def", "target_temperature", "(", "self", ")", ":", "if", "self", ".", "hvac_mode", "==", "HVAC_MODE_HEAT_COOL", ":", "return", "None", "if", "self", ".", "hvac_mode", "==", "HVAC_MODE_HEAT", ":", "return", "self", ".", "thermostat", "[", "\"runtime\"", "]", ...
[ 392, 4 ]
[ 400, 19 ]
python
en
['en', 'en', 'en']
True
Thermostat.fan
(self)
Return the current fan status.
Return the current fan status.
def fan(self): """Return the current fan status.""" if "fan" in self.thermostat["equipmentStatus"]: return STATE_ON return HVAC_MODE_OFF
[ "def", "fan", "(", "self", ")", ":", "if", "\"fan\"", "in", "self", ".", "thermostat", "[", "\"equipmentStatus\"", "]", ":", "return", "STATE_ON", "return", "HVAC_MODE_OFF" ]
[ 403, 4 ]
[ 407, 28 ]
python
en
['en', 'bg', 'en']
True
Thermostat.fan_mode
(self)
Return the fan setting.
Return the fan setting.
def fan_mode(self): """Return the fan setting.""" return self.thermostat["runtime"]["desiredFanMode"]
[ "def", "fan_mode", "(", "self", ")", ":", "return", "self", ".", "thermostat", "[", "\"runtime\"", "]", "[", "\"desiredFanMode\"", "]" ]
[ 410, 4 ]
[ 412, 59 ]
python
en
['en', 'fy', 'en']
True
Thermostat.fan_modes
(self)
Return the available fan modes.
Return the available fan modes.
def fan_modes(self): """Return the available fan modes.""" return self._fan_modes
[ "def", "fan_modes", "(", "self", ")", ":", "return", "self", ".", "_fan_modes" ]
[ 415, 4 ]
[ 417, 30 ]
python
en
['en', 'en', 'en']
True
Thermostat.preset_mode
(self)
Return current preset mode.
Return current preset mode.
def preset_mode(self): """Return current preset mode.""" events = self.thermostat["events"] for event in events: if not event["running"]: continue if event["type"] == "hold": if event["holdClimateRef"] in self._preset_modes: ...
[ "def", "preset_mode", "(", "self", ")", ":", "events", "=", "self", ".", "thermostat", "[", "\"events\"", "]", "for", "event", "in", "events", ":", "if", "not", "event", "[", "\"running\"", "]", ":", "continue", "if", "event", "[", "\"type\"", "]", "==...
[ 420, 4 ]
[ 440, 82 ]
python
en
['en', 'ca', 'en']
True
Thermostat.hvac_mode
(self)
Return current operation.
Return current operation.
def hvac_mode(self): """Return current operation.""" return ECOBEE_HVAC_TO_HASS[self.thermostat["settings"]["hvacMode"]]
[ "def", "hvac_mode", "(", "self", ")", ":", "return", "ECOBEE_HVAC_TO_HASS", "[", "self", ".", "thermostat", "[", "\"settings\"", "]", "[", "\"hvacMode\"", "]", "]" ]
[ 443, 4 ]
[ 445, 75 ]
python
bg
['nl', 'bg', 'en']
False
Thermostat.hvac_modes
(self)
Return the operation modes list.
Return the operation modes list.
def hvac_modes(self): """Return the operation modes list.""" return self._operation_list
[ "def", "hvac_modes", "(", "self", ")", ":", "return", "self", ".", "_operation_list" ]
[ 448, 4 ]
[ 450, 35 ]
python
en
['en', 'en', 'en']
True
Thermostat.current_humidity
(self)
Return the current humidity.
Return the current humidity.
def current_humidity(self) -> Optional[int]: """Return the current humidity.""" return self.thermostat["runtime"]["actualHumidity"]
[ "def", "current_humidity", "(", "self", ")", "->", "Optional", "[", "int", "]", ":", "return", "self", ".", "thermostat", "[", "\"runtime\"", "]", "[", "\"actualHumidity\"", "]" ]
[ 453, 4 ]
[ 455, 59 ]
python
en
['en', 'en', 'en']
True
Thermostat.hvac_action
(self)
Return current HVAC action. Ecobee returns a CSV string with different equipment that is active. We are prioritizing any heating/cooling equipment, otherwase look at drying/fanning. Idle if nothing going on. We are unable to map all actions to HA equivalents.
Return current HVAC action.
def hvac_action(self): """Return current HVAC action. Ecobee returns a CSV string with different equipment that is active. We are prioritizing any heating/cooling equipment, otherwase look at drying/fanning. Idle if nothing going on. We are unable to map all actions to HA equiv...
[ "def", "hvac_action", "(", "self", ")", ":", "if", "self", ".", "thermostat", "[", "\"equipmentStatus\"", "]", "==", "\"\"", ":", "return", "CURRENT_HVAC_IDLE", "actions", "=", "[", "ECOBEE_HVAC_ACTION_TO_HASS", "[", "status", "]", "for", "status", "in", "self...
[ 458, 4 ]
[ 485, 32 ]
python
en
['en', 'da', 'en']
True
Thermostat.device_state_attributes
(self)
Return device specific state attributes.
Return device specific state attributes.
def device_state_attributes(self): """Return device specific state attributes.""" status = self.thermostat["equipmentStatus"] return { "fan": self.fan, "climate_mode": self._preset_modes[ self.thermostat["program"]["currentClimateRef"] ], ...
[ "def", "device_state_attributes", "(", "self", ")", ":", "status", "=", "self", ".", "thermostat", "[", "\"equipmentStatus\"", "]", "return", "{", "\"fan\"", ":", "self", ".", "fan", ",", "\"climate_mode\"", ":", "self", ".", "_preset_modes", "[", "self", "....
[ 488, 4 ]
[ 498, 9 ]
python
en
['fr', 'en', 'en']
True
Thermostat.is_aux_heat
(self)
Return true if aux heater.
Return true if aux heater.
def is_aux_heat(self): """Return true if aux heater.""" return "auxHeat" in self.thermostat["equipmentStatus"]
[ "def", "is_aux_heat", "(", "self", ")", ":", "return", "\"auxHeat\"", "in", "self", ".", "thermostat", "[", "\"equipmentStatus\"", "]" ]
[ 501, 4 ]
[ 503, 62 ]
python
fr
['fr', 'co', 'fr']
True
Thermostat.async_turn_aux_heat_on
(self)
Turn auxiliary heater on.
Turn auxiliary heater on.
async def async_turn_aux_heat_on(self) -> None: """Turn auxiliary heater on.""" if not self.is_aux_heat: _LOGGER.warning("# Changing aux heat is not supported")
[ "async", "def", "async_turn_aux_heat_on", "(", "self", ")", "->", "None", ":", "if", "not", "self", ".", "is_aux_heat", ":", "_LOGGER", ".", "warning", "(", "\"# Changing aux heat is not supported\"", ")" ]
[ 505, 4 ]
[ 508, 67 ]
python
en
['fr', 'fi', 'en']
False
Thermostat.async_turn_aux_heat_off
(self)
Turn auxiliary heater off.
Turn auxiliary heater off.
async def async_turn_aux_heat_off(self) -> None: """Turn auxiliary heater off.""" if self.is_aux_heat: _LOGGER.warning("# Changing aux heat is not supported")
[ "async", "def", "async_turn_aux_heat_off", "(", "self", ")", "->", "None", ":", "if", "self", ".", "is_aux_heat", ":", "_LOGGER", ".", "warning", "(", "\"# Changing aux heat is not supported\"", ")" ]
[ 510, 4 ]
[ 513, 67 ]
python
en
['en', 'en', 'en']
True
Thermostat.set_preset_mode
(self, preset_mode)
Activate a preset.
Activate a preset.
def set_preset_mode(self, preset_mode): """Activate a preset.""" if preset_mode == self.preset_mode: return self.update_without_throttle = True # If we are currently in vacation mode, cancel it. if self.preset_mode == PRESET_VACATION: self.data.ecobee.de...
[ "def", "set_preset_mode", "(", "self", ",", "preset_mode", ")", ":", "if", "preset_mode", "==", "self", ".", "preset_mode", ":", "return", "self", ".", "update_without_throttle", "=", "True", "# If we are currently in vacation mode, cancel it.", "if", "self", ".", "...
[ 515, 4 ]
[ 562, 13 ]
python
ca
['en', 'ca', 'it']
False
Thermostat.preset_modes
(self)
Return available preset modes.
Return available preset modes.
def preset_modes(self): """Return available preset modes.""" return list(self._preset_modes.values())
[ "def", "preset_modes", "(", "self", ")", ":", "return", "list", "(", "self", ".", "_preset_modes", ".", "values", "(", ")", ")" ]
[ 565, 4 ]
[ 567, 48 ]
python
en
['fr', 'en', 'en']
True
Thermostat.set_auto_temp_hold
(self, heat_temp, cool_temp)
Set temperature hold in auto mode.
Set temperature hold in auto mode.
def set_auto_temp_hold(self, heat_temp, cool_temp): """Set temperature hold in auto mode.""" if cool_temp is not None: cool_temp_setpoint = cool_temp else: cool_temp_setpoint = self.thermostat["runtime"]["desiredCool"] / 10.0 if heat_temp is not None: ...
[ "def", "set_auto_temp_hold", "(", "self", ",", "heat_temp", ",", "cool_temp", ")", ":", "if", "cool_temp", "is", "not", "None", ":", "cool_temp_setpoint", "=", "cool_temp", "else", ":", "cool_temp_setpoint", "=", "self", ".", "thermostat", "[", "\"runtime\"", ...
[ 569, 4 ]
[ 595, 43 ]
python
it
['en', 'it', 'it']
True
Thermostat.set_fan_mode
(self, fan_mode)
Set the fan mode. Valid values are "on" or "auto".
Set the fan mode. Valid values are "on" or "auto".
def set_fan_mode(self, fan_mode): """Set the fan mode. Valid values are "on" or "auto".""" if fan_mode.lower() not in (FAN_ON, FAN_AUTO): error = "Invalid fan_mode value: Valid values are 'on' or 'auto'" _LOGGER.error(error) return cool_temp = self.thermost...
[ "def", "set_fan_mode", "(", "self", ",", "fan_mode", ")", ":", "if", "fan_mode", ".", "lower", "(", ")", "not", "in", "(", "FAN_ON", ",", "FAN_AUTO", ")", ":", "error", "=", "\"Invalid fan_mode value: Valid values are 'on' or 'auto'\"", "_LOGGER", ".", "error",...
[ 597, 4 ]
[ 614, 57 ]
python
en
['en', 'en', 'en']
True
Thermostat.set_temp_hold
(self, temp)
Set temperature hold in modes other than auto. Ecobee API: It is good practice to set the heat and cool hold temperatures to be the same, if the thermostat is in either heat, cool, auxHeatOnly, or off mode. If the thermostat is in auto mode, an additional rule is required. The cool hold...
Set temperature hold in modes other than auto.
def set_temp_hold(self, temp): """Set temperature hold in modes other than auto. Ecobee API: It is good practice to set the heat and cool hold temperatures to be the same, if the thermostat is in either heat, cool, auxHeatOnly, or off mode. If the thermostat is in auto mode, an ...
[ "def", "set_temp_hold", "(", "self", ",", "temp", ")", ":", "if", "self", ".", "hvac_mode", "==", "HVAC_MODE_HEAT", "or", "self", ".", "hvac_mode", "==", "HVAC_MODE_COOL", ":", "heat_temp", "=", "temp", "cool_temp", "=", "temp", "else", ":", "delta", "=", ...
[ 616, 4 ]
[ 634, 53 ]
python
en
['en', 'en', 'en']
True
Thermostat.set_temperature
(self, **kwargs)
Set new target temperature.
Set new target temperature.
def set_temperature(self, **kwargs): """Set new target temperature.""" low_temp = kwargs.get(ATTR_TARGET_TEMP_LOW) high_temp = kwargs.get(ATTR_TARGET_TEMP_HIGH) temp = kwargs.get(ATTR_TEMPERATURE) if self.hvac_mode == HVAC_MODE_HEAT_COOL and ( low_temp is not None or...
[ "def", "set_temperature", "(", "self", ",", "*", "*", "kwargs", ")", ":", "low_temp", "=", "kwargs", ".", "get", "(", "ATTR_TARGET_TEMP_LOW", ")", "high_temp", "=", "kwargs", ".", "get", "(", "ATTR_TARGET_TEMP_HIGH", ")", "temp", "=", "kwargs", ".", "get",...
[ 636, 4 ]
[ 649, 86 ]
python
en
['en', 'ca', 'en']
True
Thermostat.set_humidity
(self, humidity)
Set the humidity level.
Set the humidity level.
def set_humidity(self, humidity): """Set the humidity level.""" self.data.ecobee.set_humidity(self.thermostat_index, humidity)
[ "def", "set_humidity", "(", "self", ",", "humidity", ")", ":", "self", ".", "data", ".", "ecobee", ".", "set_humidity", "(", "self", ".", "thermostat_index", ",", "humidity", ")" ]
[ 651, 4 ]
[ 653, 70 ]
python
en
['en', 'zu', 'en']
True
Thermostat.set_hvac_mode
(self, hvac_mode)
Set HVAC mode (auto, auxHeatOnly, cool, heat, off).
Set HVAC mode (auto, auxHeatOnly, cool, heat, off).
def set_hvac_mode(self, hvac_mode): """Set HVAC mode (auto, auxHeatOnly, cool, heat, off).""" ecobee_value = next( (k for k, v in ECOBEE_HVAC_TO_HASS.items() if v == hvac_mode), None ) if ecobee_value is None: _LOGGER.error("Invalid mode for set_hvac_mode: %s", hv...
[ "def", "set_hvac_mode", "(", "self", ",", "hvac_mode", ")", ":", "ecobee_value", "=", "next", "(", "(", "k", "for", "k", ",", "v", "in", "ECOBEE_HVAC_TO_HASS", ".", "items", "(", ")", "if", "v", "==", "hvac_mode", ")", ",", "None", ")", "if", "ecobee...
[ 655, 4 ]
[ 664, 43 ]
python
fr
['fr', 'ny', 'fr']
True
Thermostat.set_fan_min_on_time
(self, fan_min_on_time)
Set the minimum fan on time.
Set the minimum fan on time.
def set_fan_min_on_time(self, fan_min_on_time): """Set the minimum fan on time.""" self.data.ecobee.set_fan_min_on_time(self.thermostat_index, fan_min_on_time) self.update_without_throttle = True
[ "def", "set_fan_min_on_time", "(", "self", ",", "fan_min_on_time", ")", ":", "self", ".", "data", ".", "ecobee", ".", "set_fan_min_on_time", "(", "self", ".", "thermostat_index", ",", "fan_min_on_time", ")", "self", ".", "update_without_throttle", "=", "True" ]
[ 666, 4 ]
[ 669, 43 ]
python
en
['en', 'sq', 'en']
True
Thermostat.resume_program
(self, resume_all)
Resume the thermostat schedule program.
Resume the thermostat schedule program.
def resume_program(self, resume_all): """Resume the thermostat schedule program.""" self.data.ecobee.resume_program( self.thermostat_index, "true" if resume_all else "false" ) self.update_without_throttle = True
[ "def", "resume_program", "(", "self", ",", "resume_all", ")", ":", "self", ".", "data", ".", "ecobee", ".", "resume_program", "(", "self", ".", "thermostat_index", ",", "\"true\"", "if", "resume_all", "else", "\"false\"", ")", "self", ".", "update_without_thro...
[ 671, 4 ]
[ 676, 43 ]
python
en
['en', 'en', 'en']
True
Thermostat.hold_preference
(self)
Return user preference setting for hold time.
Return user preference setting for hold time.
def hold_preference(self): """Return user preference setting for hold time.""" # Values returned from thermostat are 'useEndTime4hour', # 'useEndTime2hour', 'nextTransition', 'indefinite', 'askMe' default = self.thermostat["settings"]["holdAction"] if default == "nextTransition":...
[ "def", "hold_preference", "(", "self", ")", ":", "# Values returned from thermostat are 'useEndTime4hour',", "# 'useEndTime2hour', 'nextTransition', 'indefinite', 'askMe'", "default", "=", "self", ".", "thermostat", "[", "\"settings\"", "]", "[", "\"holdAction\"", "]", "if", ...
[ 678, 4 ]
[ 688, 31 ]
python
en
['da', 'en', 'en']
True
Thermostat.create_vacation
(self, service_data)
Create a vacation with user-specified parameters.
Create a vacation with user-specified parameters.
def create_vacation(self, service_data): """Create a vacation with user-specified parameters.""" vacation_name = service_data[ATTR_VACATION_NAME] cool_temp = convert( service_data[ATTR_COOL_TEMP], self.hass.config.units.temperature_unit, TEMP_FAHRENHEIT, ...
[ "def", "create_vacation", "(", "self", ",", "service_data", ")", ":", "vacation_name", "=", "service_data", "[", "ATTR_VACATION_NAME", "]", "cool_temp", "=", "convert", "(", "service_data", "[", "ATTR_COOL_TEMP", "]", ",", "self", ".", "hass", ".", "config", "...
[ 690, 4 ]
[ 734, 9 ]
python
en
['en', 'en', 'en']
True
Thermostat.delete_vacation
(self, vacation_name)
Delete a vacation with the specified name.
Delete a vacation with the specified name.
def delete_vacation(self, vacation_name): """Delete a vacation with the specified name.""" _LOGGER.debug( "Deleting a vacation on thermostat %s with name %s", self.name, vacation_name, ) self.data.ecobee.delete_vacation(self.thermostat_index, vacation_...
[ "def", "delete_vacation", "(", "self", ",", "vacation_name", ")", ":", "_LOGGER", ".", "debug", "(", "\"Deleting a vacation on thermostat %s with name %s\"", ",", "self", ".", "name", ",", "vacation_name", ",", ")", "self", ".", "data", ".", "ecobee", ".", "dele...
[ 736, 4 ]
[ 743, 78 ]
python
en
['en', 'en', 'en']
True
Thermostat.turn_on
(self)
Set the thermostat to the last active HVAC mode.
Set the thermostat to the last active HVAC mode.
def turn_on(self): """Set the thermostat to the last active HVAC mode.""" _LOGGER.debug( "Turning on ecobee thermostat %s in %s mode", self.name, self._last_active_hvac_mode, ) self.set_hvac_mode(self._last_active_hvac_mode)
[ "def", "turn_on", "(", "self", ")", ":", "_LOGGER", ".", "debug", "(", "\"Turning on ecobee thermostat %s in %s mode\"", ",", "self", ".", "name", ",", "self", ".", "_last_active_hvac_mode", ",", ")", "self", ".", "set_hvac_mode", "(", "self", ".", "_last_active...
[ 745, 4 ]
[ 752, 55 ]
python
en
['en', 'en', 'en']
True
Thermostat.set_dst_mode
(self, dst_enabled)
Enable/disable automatic daylight savings time.
Enable/disable automatic daylight savings time.
def set_dst_mode(self, dst_enabled): """Enable/disable automatic daylight savings time.""" self.data.ecobee.set_dst_mode(self.thermostat_index, dst_enabled)
[ "def", "set_dst_mode", "(", "self", ",", "dst_enabled", ")", ":", "self", ".", "data", ".", "ecobee", ".", "set_dst_mode", "(", "self", ".", "thermostat_index", ",", "dst_enabled", ")" ]
[ 754, 4 ]
[ 756, 73 ]
python
en
['en', 'en', 'en']
True
Thermostat.set_mic_mode
(self, mic_enabled)
Enable/disable Alexa mic (only for Ecobee 4).
Enable/disable Alexa mic (only for Ecobee 4).
def set_mic_mode(self, mic_enabled): """Enable/disable Alexa mic (only for Ecobee 4).""" self.data.ecobee.set_mic_mode(self.thermostat_index, mic_enabled)
[ "def", "set_mic_mode", "(", "self", ",", "mic_enabled", ")", ":", "self", ".", "data", ".", "ecobee", ".", "set_mic_mode", "(", "self", ".", "thermostat_index", ",", "mic_enabled", ")" ]
[ 758, 4 ]
[ 760, 73 ]
python
en
['en', 'en', 'en']
True
Thermostat.set_occupancy_modes
(self, auto_away=None, follow_me=None)
Enable/disable Smart Home/Away and Follow Me modes.
Enable/disable Smart Home/Away and Follow Me modes.
def set_occupancy_modes(self, auto_away=None, follow_me=None): """Enable/disable Smart Home/Away and Follow Me modes.""" self.data.ecobee.set_occupancy_modes( self.thermostat_index, auto_away, follow_me )
[ "def", "set_occupancy_modes", "(", "self", ",", "auto_away", "=", "None", ",", "follow_me", "=", "None", ")", ":", "self", ".", "data", ".", "ecobee", ".", "set_occupancy_modes", "(", "self", ".", "thermostat_index", ",", "auto_away", ",", "follow_me", ")" ]
[ 762, 4 ]
[ 766, 9 ]
python
en
['en', 'en', 'en']
True
shutterbox_fixture
()
Return a shutterBox fixture.
Return a shutterBox fixture.
def shutterbox_fixture(): """Return a shutterBox fixture.""" feature = mock_feature( "covers", blebox_uniapi.cover.Cover, unique_id="BleBox-shutterBox-2bee34e750b8-position", full_name="shutterBox-position", device_class="shutter", current=None, state=None...
[ "def", "shutterbox_fixture", "(", ")", ":", "feature", "=", "mock_feature", "(", "\"covers\"", ",", "blebox_uniapi", ".", "cover", ".", "Cover", ",", "unique_id", "=", "\"BleBox-shutterBox-2bee34e750b8-position\"", ",", "full_name", "=", "\"shutterBox-position\"", ","...
[ 41, 0 ]
[ 57, 49 ]
python
en
['en', 'lb', 'en']
True
gatebox_fixture
()
Return a gateBox fixture.
Return a gateBox fixture.
def gatebox_fixture(): """Return a gateBox fixture.""" feature = mock_feature( "covers", blebox_uniapi.cover.Cover, unique_id="BleBox-gateBox-1afe34db9437-position", device_class="gatebox", full_name="gateBox-position", current=None, state=None, ha...
[ "def", "gatebox_fixture", "(", ")", ":", "feature", "=", "mock_feature", "(", "\"covers\"", ",", "blebox_uniapi", ".", "cover", ".", "Cover", ",", "unique_id", "=", "\"BleBox-gateBox-1afe34db9437-position\"", ",", "device_class", "=", "\"gatebox\"", ",", "full_name"...
[ 61, 0 ]
[ 77, 46 ]
python
en
['en', 'lb', 'en']
True
gate_fixture
()
Return a gateController fixture.
Return a gateController fixture.
def gate_fixture(): """Return a gateController fixture.""" feature = mock_feature( "covers", blebox_uniapi.cover.Cover, unique_id="BleBox-gateController-2bee34e750b8-position", full_name="gateController-position", device_class="gate", current=None, state=N...
[ "def", "gate_fixture", "(", ")", ":", "feature", "=", "mock_feature", "(", "\"covers\"", ",", "blebox_uniapi", ".", "cover", ".", "Cover", ",", "unique_id", "=", "\"BleBox-gateController-2bee34e750b8-position\"", ",", "full_name", "=", "\"gateController-position\"", "...
[ 81, 0 ]
[ 97, 53 ]
python
en
['en', 'lb', 'en']
True
test_init_gatecontroller
(gatecontroller, hass, config)
Test gateController default state.
Test gateController default state.
async def test_init_gatecontroller(gatecontroller, hass, config): """Test gateController default state.""" _, entity_id = gatecontroller entry = await async_setup_entity(hass, config, entity_id) assert entry.unique_id == "BleBox-gateController-2bee34e750b8-position" state = hass.states.get(entity_...
[ "async", "def", "test_init_gatecontroller", "(", "gatecontroller", ",", "hass", ",", "config", ")", ":", "_", ",", "entity_id", "=", "gatecontroller", "entry", "=", "await", "async_setup_entity", "(", "hass", ",", "config", ",", "entity_id", ")", "assert", "en...
[ 100, 0 ]
[ 127, 38 ]
python
da
['da', 'de', 'en']
False
test_init_shutterbox
(shutterbox, hass, config)
Test gateBox default state.
Test gateBox default state.
async def test_init_shutterbox(shutterbox, hass, config): """Test gateBox default state.""" _, entity_id = shutterbox entry = await async_setup_entity(hass, config, entity_id) assert entry.unique_id == "BleBox-shutterBox-2bee34e750b8-position" state = hass.states.get(entity_id) assert state.na...
[ "async", "def", "test_init_shutterbox", "(", "shutterbox", ",", "hass", ",", "config", ")", ":", "_", ",", "entity_id", "=", "shutterbox", "entry", "=", "await", "async_setup_entity", "(", "hass", ",", "config", ",", "entity_id", ")", "assert", "entry", ".",...
[ 130, 0 ]
[ 157, 38 ]
python
de
['nl', 'de', 'en']
False
test_init_gatebox
(gatebox, hass, config)
Test cover default state.
Test cover default state.
async def test_init_gatebox(gatebox, hass, config): """Test cover default state.""" _, entity_id = gatebox entry = await async_setup_entity(hass, config, entity_id) assert entry.unique_id == "BleBox-gateBox-1afe34db9437-position" state = hass.states.get(entity_id) assert state.name == "gateBox...
[ "async", "def", "test_init_gatebox", "(", "gatebox", ",", "hass", ",", "config", ")", ":", "_", ",", "entity_id", "=", "gatebox", "entry", "=", "await", "async_setup_entity", "(", "hass", ",", "config", ",", "entity_id", ")", "assert", "entry", ".", "uniqu...
[ 160, 0 ]
[ 189, 38 ]
python
en
['da', 'en', 'en']
True
test_open
(feature, hass, config)
Test cover opening.
Test cover opening.
async def test_open(feature, hass, config): """Test cover opening.""" feature_mock, entity_id = feature def initial_update(): feature_mock.state = 3 # manually stopped def open_gate(): feature_mock.state = 1 # opening feature_mock.async_update = AsyncMock(side_effect=initial_up...
[ "async", "def", "test_open", "(", "feature", ",", "hass", ",", "config", ")", ":", "feature_mock", ",", "entity_id", "=", "feature", "def", "initial_update", "(", ")", ":", "feature_mock", ".", "state", "=", "3", "# manually stopped", "def", "open_gate", "("...
[ 193, 0 ]
[ 217, 60 ]
python
en
['en', 'en', 'en']
True
test_close
(feature, hass, config)
Test cover closing.
Test cover closing.
async def test_close(feature, hass, config): """Test cover closing.""" feature_mock, entity_id = feature def initial_update(): feature_mock.state = 4 # open def close(): feature_mock.state = 0 # closing feature_mock.async_update = AsyncMock(side_effect=initial_update) featu...
[ "async", "def", "test_close", "(", "feature", ",", "hass", ",", "config", ")", ":", "feature_mock", ",", "entity_id", "=", "feature", "def", "initial_update", "(", ")", ":", "feature_mock", ".", "state", "=", "4", "# open", "def", "close", "(", ")", ":",...
[ 221, 0 ]
[ 242, 60 ]
python
en
['en', 'en', 'en']
True
opening_to_stop_feature_mock
(feature_mock)
Return an mocked feature which can be updated and stopped.
Return an mocked feature which can be updated and stopped.
def opening_to_stop_feature_mock(feature_mock): """Return an mocked feature which can be updated and stopped.""" def initial_update(): feature_mock.state = 1 # opening def stop(): feature_mock.state = 2 # manually stopped feature_mock.async_update = AsyncMock(side_effect=initial_upd...
[ "def", "opening_to_stop_feature_mock", "(", "feature_mock", ")", ":", "def", "initial_update", "(", ")", ":", "feature_mock", ".", "state", "=", "1", "# opening", "def", "stop", "(", ")", ":", "feature_mock", ".", "state", "=", "2", "# manually stopped", "feat...
[ 245, 0 ]
[ 255, 57 ]
python
en
['en', 'en', 'en']
True
test_stop
(feature, hass, config)
Test cover stopping.
Test cover stopping.
async def test_stop(feature, hass, config): """Test cover stopping.""" feature_mock, entity_id = feature opening_to_stop_feature_mock(feature_mock) await async_setup_entity(hass, config, entity_id) assert hass.states.get(entity_id).state == STATE_OPENING feature_mock.async_update = AsyncMock(...
[ "async", "def", "test_stop", "(", "feature", ",", "hass", ",", "config", ")", ":", "feature_mock", ",", "entity_id", "=", "feature", "opening_to_stop_feature_mock", "(", "feature_mock", ")", "await", "async_setup_entity", "(", "hass", ",", "config", ",", "entity...
[ 259, 0 ]
[ 272, 57 ]
python
en
['en', 'en', 'en']
True
test_update
(feature, hass, config)
Test cover updating.
Test cover updating.
async def test_update(feature, hass, config): """Test cover updating.""" feature_mock, entity_id = feature def initial_update(): feature_mock.current = 29 # inverted feature_mock.state = 2 # manually stopped feature_mock.async_update = AsyncMock(side_effect=initial_update) awai...
[ "async", "def", "test_update", "(", "feature", ",", "hass", ",", "config", ")", ":", "feature_mock", ",", "entity_id", "=", "feature", "def", "initial_update", "(", ")", ":", "feature_mock", ".", "current", "=", "29", "# inverted", "feature_mock", ".", "stat...
[ 276, 0 ]
[ 291, 36 ]
python
en
['fr', 'en', 'en']
True
test_set_position
(feature, hass, config)
Test cover position setting.
Test cover position setting.
async def test_set_position(feature, hass, config): """Test cover position setting.""" feature_mock, entity_id = feature def initial_update(): feature_mock.state = 3 # closed def set_position(position): assert position == 99 # inverted feature_mock.state = 1 # opening ...
[ "async", "def", "test_set_position", "(", "feature", ",", "hass", ",", "config", ")", ":", "feature_mock", ",", "entity_id", "=", "feature", "def", "initial_update", "(", ")", ":", "feature_mock", ".", "state", "=", "3", "# closed", "def", "set_position", "(...
[ 297, 0 ]
[ 323, 60 ]
python
en
['en', 'en', 'en']
True
test_unknown_position
(shutterbox, hass, config)
Test cover position setting.
Test cover position setting.
async def test_unknown_position(shutterbox, hass, config): """Test cover position setting.""" feature_mock, entity_id = shutterbox def initial_update(): feature_mock.state = 4 # opening feature_mock.current = -1 feature_mock.async_update = AsyncMock(side_effect=initial_update) a...
[ "async", "def", "test_unknown_position", "(", "shutterbox", ",", "hass", ",", "config", ")", ":", "feature_mock", ",", "entity_id", "=", "shutterbox", "def", "initial_update", "(", ")", ":", "feature_mock", ".", "state", "=", "4", "# opening", "feature_mock", ...
[ 326, 0 ]
[ 341, 56 ]
python
en
['en', 'en', 'en']
True
test_with_stop
(gatebox, hass, config)
Test stop capability is available.
Test stop capability is available.
async def test_with_stop(gatebox, hass, config): """Test stop capability is available.""" feature_mock, entity_id = gatebox opening_to_stop_feature_mock(feature_mock) feature_mock.has_stop = True await async_setup_entity(hass, config, entity_id) state = hass.states.get(entity_id) supporte...
[ "async", "def", "test_with_stop", "(", "gatebox", ",", "hass", ",", "config", ")", ":", "feature_mock", ",", "entity_id", "=", "gatebox", "opening_to_stop_feature_mock", "(", "feature_mock", ")", "feature_mock", ".", "has_stop", "=", "True", "await", "async_setup_...
[ 344, 0 ]
[ 355, 44 ]
python
en
['en', 'en', 'en']
True
test_with_no_stop
(gatebox, hass, config)
Test stop capability is not available.
Test stop capability is not available.
async def test_with_no_stop(gatebox, hass, config): """Test stop capability is not available.""" feature_mock, entity_id = gatebox opening_to_stop_feature_mock(feature_mock) feature_mock.has_stop = False await async_setup_entity(hass, config, entity_id) state = hass.states.get(entity_id) ...
[ "async", "def", "test_with_no_stop", "(", "gatebox", ",", "hass", ",", "config", ")", ":", "feature_mock", ",", "entity_id", "=", "gatebox", "opening_to_stop_feature_mock", "(", "feature_mock", ")", "feature_mock", ".", "has_stop", "=", "False", "await", "async_se...
[ 358, 0 ]
[ 369, 48 ]
python
en
['en', 'en', 'en']
True
test_update_failure
(feature, hass, config, caplog)
Test that update failures are logged.
Test that update failures are logged.
async def test_update_failure(feature, hass, config, caplog): """Test that update failures are logged.""" caplog.set_level(logging.ERROR) feature_mock, entity_id = feature feature_mock.async_update = AsyncMock(side_effect=blebox_uniapi.error.ClientError) await async_setup_entity(hass, config, enti...
[ "async", "def", "test_update_failure", "(", "feature", ",", "hass", ",", "config", ",", "caplog", ")", ":", "caplog", ".", "set_level", "(", "logging", ".", "ERROR", ")", "feature_mock", ",", "entity_id", "=", "feature", "feature_mock", ".", "async_update", ...
[ 373, 0 ]
[ 382, 73 ]
python
en
['en', 'en', 'en']
True
test_opening_state
(feature, hass, config)
Test that entity properties work.
Test that entity properties work.
async def test_opening_state(feature, hass, config): """Test that entity properties work.""" feature_mock, entity_id = feature def initial_update(): feature_mock.state = 1 # opening feature_mock.async_update = AsyncMock(side_effect=initial_update) await async_setup_entity(hass, config, e...
[ "async", "def", "test_opening_state", "(", "feature", ",", "hass", ",", "config", ")", ":", "feature_mock", ",", "entity_id", "=", "feature", "def", "initial_update", "(", ")", ":", "feature_mock", ".", "state", "=", "1", "# opening", "feature_mock", ".", "a...
[ 386, 0 ]
[ 396, 60 ]
python
en
['en', 'en', 'en']
True
test_closing_state
(feature, hass, config)
Test that entity properties work.
Test that entity properties work.
async def test_closing_state(feature, hass, config): """Test that entity properties work.""" feature_mock, entity_id = feature def initial_update(): feature_mock.state = 0 # closing feature_mock.async_update = AsyncMock(side_effect=initial_update) await async_setup_entity(hass, config, e...
[ "async", "def", "test_closing_state", "(", "feature", ",", "hass", ",", "config", ")", ":", "feature_mock", ",", "entity_id", "=", "feature", "def", "initial_update", "(", ")", ":", "feature_mock", ".", "state", "=", "0", "# closing", "feature_mock", ".", "a...
[ 400, 0 ]
[ 410, 60 ]
python
en
['en', 'en', 'en']
True
test_closed_state
(feature, hass, config)
Test that entity properties work.
Test that entity properties work.
async def test_closed_state(feature, hass, config): """Test that entity properties work.""" feature_mock, entity_id = feature def initial_update(): feature_mock.state = 3 # closed feature_mock.async_update = AsyncMock(side_effect=initial_update) await async_setup_entity(hass, config, ent...
[ "async", "def", "test_closed_state", "(", "feature", ",", "hass", ",", "config", ")", ":", "feature_mock", ",", "entity_id", "=", "feature", "def", "initial_update", "(", ")", ":", "feature_mock", ".", "state", "=", "3", "# closed", "feature_mock", ".", "asy...
[ 414, 0 ]
[ 424, 59 ]
python
en
['en', 'en', 'en']
True
mock_dummy_tcp_server
()
Mock a valid WiffiTcpServer.
Mock a valid WiffiTcpServer.
def mock_dummy_tcp_server(): """Mock a valid WiffiTcpServer.""" class Dummy: async def start_server(self): pass async def close_server(self): pass server = Dummy() with patch( "homeassistant.components.wiffi.config_flow.WiffiTcpServer", return_value=ser...
[ "def", "mock_dummy_tcp_server", "(", ")", ":", "class", "Dummy", ":", "async", "def", "start_server", "(", "self", ")", ":", "pass", "async", "def", "close_server", "(", "self", ")", ":", "pass", "server", "=", "Dummy", "(", ")", "with", "patch", "(", ...
[ 21, 0 ]
[ 35, 20 ]
python
en
['en', 'en', 'en']
True
mock_addr_in_use_server
()
Mock a WiffiTcpServer with addr_in_use.
Mock a WiffiTcpServer with addr_in_use.
def mock_addr_in_use_server(): """Mock a WiffiTcpServer with addr_in_use.""" class Dummy: async def start_server(self): raise OSError(errno.EADDRINUSE, "") async def close_server(self): pass server = Dummy() with patch( "homeassistant.components.wiffi.c...
[ "def", "mock_addr_in_use_server", "(", ")", ":", "class", "Dummy", ":", "async", "def", "start_server", "(", "self", ")", ":", "raise", "OSError", "(", "errno", ".", "EADDRINUSE", ",", "\"\"", ")", "async", "def", "close_server", "(", "self", ")", ":", "...
[ 39, 0 ]
[ 53, 20 ]
python
en
['en', 'en', 'en']
True
mock_start_server_failed
()
Mock a WiffiTcpServer with start_server_failed.
Mock a WiffiTcpServer with start_server_failed.
def mock_start_server_failed(): """Mock a WiffiTcpServer with start_server_failed.""" class Dummy: async def start_server(self): raise OSError(errno.EACCES, "") async def close_server(self): pass server = Dummy() with patch( "homeassistant.components.wi...
[ "def", "mock_start_server_failed", "(", ")", ":", "class", "Dummy", ":", "async", "def", "start_server", "(", "self", ")", ":", "raise", "OSError", "(", "errno", ".", "EACCES", ",", "\"\"", ")", "async", "def", "close_server", "(", "self", ")", ":", "pas...
[ 57, 0 ]
[ 71, 20 ]
python
en
['en', 'en', 'en']
True
test_form
(hass, dummy_tcp_server)
Test how we get the form.
Test how we get the form.
async def test_form(hass, dummy_tcp_server): """Test how we get the form.""" result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": config_entries.SOURCE_USER} ) assert result["type"] == RESULT_TYPE_FORM assert result["errors"] == {} assert result["step_id"] == co...
[ "async", "def", "test_form", "(", "hass", ",", "dummy_tcp_server", ")", ":", "result", "=", "await", "hass", ".", "config_entries", ".", "flow", ".", "async_init", "(", "DOMAIN", ",", "context", "=", "{", "\"source\"", ":", "config_entries", ".", "SOURCE_USE...
[ 74, 0 ]
[ 87, 54 ]
python
en
['en', 'en', 'en']
True