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
Group._reset_tracked_state
(self)
Reset tracked state.
Reset tracked state.
def _reset_tracked_state(self): """Reset tracked state.""" self._on_off = {} self._assumed = {} self._on_states = set() for entity_id in self.trackable: state = self.hass.states.get(entity_id) if state is not None: self._see_state(state)
[ "def", "_reset_tracked_state", "(", "self", ")", ":", "self", ".", "_on_off", "=", "{", "}", "self", ".", "_assumed", "=", "{", "}", "self", ".", "_on_states", "=", "set", "(", ")", "for", "entity_id", "in", "self", ".", "trackable", ":", "state", "=...
[ 674, 4 ]
[ 684, 38 ]
python
en
['en', 'en', 'en']
True
Group._see_state
(self, new_state)
Keep track of the the state.
Keep track of the the state.
def _see_state(self, new_state): """Keep track of the the state.""" entity_id = new_state.entity_id domain = new_state.domain state = new_state.state registry = self.hass.data[REG_KEY] self._assumed[entity_id] = new_state.attributes.get(ATTR_ASSUMED_STATE) if dom...
[ "def", "_see_state", "(", "self", ",", "new_state", ")", ":", "entity_id", "=", "new_state", ".", "entity_id", "domain", "=", "new_state", ".", "domain", "state", "=", "new_state", ".", "state", "registry", "=", "self", ".", "hass", ".", "data", "[", "RE...
[ 686, 4 ]
[ 705, 62 ]
python
en
['en', 'en', 'en']
True
Group._async_update_group_state
(self, tr_state=None)
Update group state. Optionally you can provide the only state changed since last update allowing this method to take shortcuts. This method must be run in the event loop.
Update group state.
def _async_update_group_state(self, tr_state=None): """Update group state. Optionally you can provide the only state changed since last update allowing this method to take shortcuts. This method must be run in the event loop. """ # To store current states of group entit...
[ "def", "_async_update_group_state", "(", "self", ",", "tr_state", "=", "None", ")", ":", "# To store current states of group entities. Might not be needed.", "if", "tr_state", ":", "self", ".", "_see_state", "(", "tr_state", ")", "if", "not", "self", ".", "_on_off", ...
[ 708, 4 ]
[ 752, 74 ]
python
en
['en', 'en', 'en']
True
async_get_engine
(hass, config, discovery_info=None)
Set up VoiceRSS speech component.
Set up VoiceRSS speech component.
async def async_get_engine(hass, config, discovery_info=None): """Set up VoiceRSS speech component.""" return YandexSpeechKitProvider(hass, config)
[ "async", "def", "async_get_engine", "(", "hass", ",", "config", ",", "discovery_info", "=", "None", ")", ":", "return", "YandexSpeechKitProvider", "(", "hass", ",", "config", ")" ]
[ 81, 0 ]
[ 83, 48 ]
python
en
['en', 'lb', 'en']
True
YandexSpeechKitProvider.__init__
(self, hass, conf)
Init VoiceRSS TTS service.
Init VoiceRSS TTS service.
def __init__(self, hass, conf): """Init VoiceRSS TTS service.""" self.hass = hass self._codec = conf.get(CONF_CODEC) self._key = conf.get(CONF_API_KEY) self._speaker = conf.get(CONF_VOICE) self._language = conf.get(CONF_LANG) self._emotion = conf.get(CONF_EMOTION)...
[ "def", "__init__", "(", "self", ",", "hass", ",", "conf", ")", ":", "self", ".", "hass", "=", "hass", "self", ".", "_codec", "=", "conf", ".", "get", "(", "CONF_CODEC", ")", "self", ".", "_key", "=", "conf", ".", "get", "(", "CONF_API_KEY", ")", ...
[ 89, 4 ]
[ 98, 31 ]
python
de
['de', 'fr', 'en']
False
YandexSpeechKitProvider.default_language
(self)
Return the default language.
Return the default language.
def default_language(self): """Return the default language.""" return self._language
[ "def", "default_language", "(", "self", ")", ":", "return", "self", ".", "_language" ]
[ 101, 4 ]
[ 103, 29 ]
python
en
['en', 'et', 'en']
True
YandexSpeechKitProvider.supported_languages
(self)
Return list of supported languages.
Return list of supported languages.
def supported_languages(self): """Return list of supported languages.""" return SUPPORT_LANGUAGES
[ "def", "supported_languages", "(", "self", ")", ":", "return", "SUPPORT_LANGUAGES" ]
[ 106, 4 ]
[ 108, 32 ]
python
en
['en', 'en', 'en']
True
YandexSpeechKitProvider.supported_options
(self)
Return list of supported options.
Return list of supported options.
def supported_options(self): """Return list of supported options.""" return SUPPORTED_OPTIONS
[ "def", "supported_options", "(", "self", ")", ":", "return", "SUPPORTED_OPTIONS" ]
[ 111, 4 ]
[ 113, 32 ]
python
en
['en', 'en', 'en']
True
YandexSpeechKitProvider.async_get_tts_audio
(self, message, language, options=None)
Load TTS from yandex.
Load TTS from yandex.
async def async_get_tts_audio(self, message, language, options=None): """Load TTS from yandex.""" websession = async_get_clientsession(self.hass) actual_language = language options = options or {} try: with async_timeout.timeout(10): url_param = { ...
[ "async", "def", "async_get_tts_audio", "(", "self", ",", "message", ",", "language", ",", "options", "=", "None", ")", ":", "websession", "=", "async_get_clientsession", "(", "self", ".", "hass", ")", "actual_language", "=", "language", "options", "=", "option...
[ 115, 4 ]
[ 146, 34 ]
python
en
['en', 'en', 'en']
True
setup_bp
(hass)
Fixture to set up the blueprint component.
Fixture to set up the blueprint component.
async def setup_bp(hass): """Fixture to set up the blueprint component.""" assert await async_setup_component(hass, "blueprint", {}) # Trigger registration of automation blueprints await async_setup_component(hass, "automation", {})
[ "async", "def", "setup_bp", "(", "hass", ")", ":", "assert", "await", "async_setup_component", "(", "hass", ",", "\"blueprint\"", ",", "{", "}", ")", "# Trigger registration of automation blueprints", "await", "async_setup_component", "(", "hass", ",", "\"automation\"...
[ 11, 0 ]
[ 16, 55 ]
python
en
['en', 'en', 'en']
True
test_list_blueprints
(hass, hass_ws_client)
Test listing blueprints.
Test listing blueprints.
async def test_list_blueprints(hass, hass_ws_client): """Test listing blueprints.""" client = await hass_ws_client(hass) await client.send_json({"id": 5, "type": "blueprint/list", "domain": "automation"}) msg = await client.receive_json() assert msg["id"] == 5 assert msg["success"] bluepri...
[ "async", "def", "test_list_blueprints", "(", "hass", ",", "hass_ws_client", ")", ":", "client", "=", "await", "hass_ws_client", "(", "hass", ")", "await", "client", ".", "send_json", "(", "{", "\"id\"", ":", "5", ",", "\"type\"", ":", "\"blueprint/list\"", "...
[ 19, 0 ]
[ 44, 5 ]
python
fr
['fr', 'fr', 'en']
True
test_list_blueprints_non_existing_domain
(hass, hass_ws_client)
Test listing blueprints.
Test listing blueprints.
async def test_list_blueprints_non_existing_domain(hass, hass_ws_client): """Test listing blueprints.""" client = await hass_ws_client(hass) await client.send_json( {"id": 5, "type": "blueprint/list", "domain": "not_existsing"} ) msg = await client.receive_json() assert msg["id"] == 5 ...
[ "async", "def", "test_list_blueprints_non_existing_domain", "(", "hass", ",", "hass_ws_client", ")", ":", "client", "=", "await", "hass_ws_client", "(", "hass", ")", "await", "client", ".", "send_json", "(", "{", "\"id\"", ":", "5", ",", "\"type\"", ":", "\"bl...
[ 47, 0 ]
[ 59, 27 ]
python
fr
['fr', 'fr', 'en']
True
test_import_blueprint
(hass, aioclient_mock, hass_ws_client)
Test importing blueprints.
Test importing blueprints.
async def test_import_blueprint(hass, aioclient_mock, hass_ws_client): """Test importing blueprints.""" raw_data = Path( hass.config.path("blueprints/automation/test_event_service.yaml") ).read_text() aioclient_mock.get( "https://raw.githubusercontent.com/balloob/home-assistant-config/m...
[ "async", "def", "test_import_blueprint", "(", "hass", ",", "aioclient_mock", ",", "hass_ws_client", ")", ":", "raw_data", "=", "Path", "(", "hass", ".", "config", ".", "path", "(", "\"blueprints/automation/test_event_service.yaml\"", ")", ")", ".", "read_text", "(...
[ 62, 0 ]
[ 98, 5 ]
python
en
['fr', 'en', 'en']
True
test_save_blueprint
(hass, aioclient_mock, hass_ws_client)
Test saving blueprints.
Test saving blueprints.
async def test_save_blueprint(hass, aioclient_mock, hass_ws_client): """Test saving blueprints.""" raw_data = Path( hass.config.path("blueprints/automation/test_event_service.yaml") ).read_text() with patch("pathlib.Path.write_text") as write_mock: client = await hass_ws_client(hass) ...
[ "async", "def", "test_save_blueprint", "(", "hass", ",", "aioclient_mock", ",", "hass_ws_client", ")", ":", "raw_data", "=", "Path", "(", "hass", ".", "config", ".", "path", "(", "\"blueprints/automation/test_event_service.yaml\"", ")", ")", ".", "read_text", "(",...
[ 101, 0 ]
[ 127, 9 ]
python
en
['en', 'hu', 'en']
True
test_save_existing_file
(hass, aioclient_mock, hass_ws_client)
Test saving blueprints.
Test saving blueprints.
async def test_save_existing_file(hass, aioclient_mock, hass_ws_client): """Test saving blueprints.""" client = await hass_ws_client(hass) await client.send_json( { "id": 7, "type": "blueprint/save", "path": "test_event_service", "yaml": 'blueprint: {...
[ "async", "def", "test_save_existing_file", "(", "hass", ",", "aioclient_mock", ",", "hass_ws_client", ")", ":", "client", "=", "await", "hass_ws_client", "(", "hass", ")", "await", "client", ".", "send_json", "(", "{", "\"id\"", ":", "7", ",", "\"type\"", ":...
[ 130, 0 ]
[ 149, 87 ]
python
en
['en', 'hu', 'en']
True
test_save_file_error
(hass, aioclient_mock, hass_ws_client)
Test saving blueprints with OS error.
Test saving blueprints with OS error.
async def test_save_file_error(hass, aioclient_mock, hass_ws_client): """Test saving blueprints with OS error.""" with patch("pathlib.Path.write_text", side_effect=OSError): client = await hass_ws_client(hass) await client.send_json( { "id": 8, "type":...
[ "async", "def", "test_save_file_error", "(", "hass", ",", "aioclient_mock", ",", "hass_ws_client", ")", ":", "with", "patch", "(", "\"pathlib.Path.write_text\"", ",", "side_effect", "=", "OSError", ")", ":", "client", "=", "await", "hass_ws_client", "(", "hass", ...
[ 152, 0 ]
[ 170, 33 ]
python
en
['en', 'el-Latn', 'en']
True
test_save_invalid_blueprint
(hass, aioclient_mock, hass_ws_client)
Test saving invalid blueprints.
Test saving invalid blueprints.
async def test_save_invalid_blueprint(hass, aioclient_mock, hass_ws_client): """Test saving invalid blueprints.""" client = await hass_ws_client(hass) await client.send_json( { "id": 8, "type": "blueprint/save", "path": "test_wrong", "yaml": "wrong_bl...
[ "async", "def", "test_save_invalid_blueprint", "(", "hass", ",", "aioclient_mock", ",", "hass_ws_client", ")", ":", "client", "=", "await", "hass_ws_client", "(", "hass", ")", "await", "client", ".", "send_json", "(", "{", "\"id\"", ":", "8", ",", "\"type\"", ...
[ 173, 0 ]
[ 195, 5 ]
python
en
['en', 'et', 'en']
True
test_delete_blueprint
(hass, aioclient_mock, hass_ws_client)
Test deleting blueprints.
Test deleting blueprints.
async def test_delete_blueprint(hass, aioclient_mock, hass_ws_client): """Test deleting blueprints.""" with patch("pathlib.Path.unlink", return_value=Mock()) as unlink_mock: client = await hass_ws_client(hass) await client.send_json( { "id": 9, "type"...
[ "async", "def", "test_delete_blueprint", "(", "hass", ",", "aioclient_mock", ",", "hass_ws_client", ")", ":", "with", "patch", "(", "\"pathlib.Path.unlink\"", ",", "return_value", "=", "Mock", "(", ")", ")", "as", "unlink_mock", ":", "client", "=", "await", "h...
[ 198, 0 ]
[ 216, 29 ]
python
da
['fr', 'da', 'en']
False
test_delete_non_exist_file_blueprint
(hass, aioclient_mock, hass_ws_client)
Test deleting non existing blueprints.
Test deleting non existing blueprints.
async def test_delete_non_exist_file_blueprint(hass, aioclient_mock, hass_ws_client): """Test deleting non existing blueprints.""" client = await hass_ws_client(hass) await client.send_json( { "id": 9, "type": "blueprint/delete", "path": "none_existing", ...
[ "async", "def", "test_delete_non_exist_file_blueprint", "(", "hass", ",", "aioclient_mock", ",", "hass_ws_client", ")", ":", "client", "=", "await", "hass_ws_client", "(", "hass", ")", "await", "client", ".", "send_json", "(", "{", "\"id\"", ":", "9", ",", "\"...
[ 219, 0 ]
[ 235, 29 ]
python
en
['fr', 'en', 'en']
True
get_scanner
(hass, config)
Return a BT Home Hub 5 scanner if successful.
Return a BT Home Hub 5 scanner if successful.
def get_scanner(hass, config): """Return a BT Home Hub 5 scanner if successful.""" scanner = BTHomeHub5DeviceScanner(config[DOMAIN]) return scanner if scanner.success_init else None
[ "def", "get_scanner", "(", "hass", ",", "config", ")", ":", "scanner", "=", "BTHomeHub5DeviceScanner", "(", "config", "[", "DOMAIN", "]", ")", "return", "scanner", "if", "scanner", ".", "success_init", "else", "None" ]
[ 23, 0 ]
[ 27, 52 ]
python
en
['en', 'co', 'en']
True
BTHomeHub5DeviceScanner.__init__
(self, config)
Initialise the scanner.
Initialise the scanner.
def __init__(self, config): """Initialise the scanner.""" _LOGGER.info("Initialising BT Home Hub 5") self.host = config[CONF_HOST] self.last_results = {} # Test the router is accessible data = bthomehub5_devicelist.get_devicelist(self.host) self.success_init = d...
[ "def", "__init__", "(", "self", ",", "config", ")", ":", "_LOGGER", ".", "info", "(", "\"Initialising BT Home Hub 5\"", ")", "self", ".", "host", "=", "config", "[", "CONF_HOST", "]", "self", ".", "last_results", "=", "{", "}", "# Test the router is accessible...
[ 33, 4 ]
[ 42, 44 ]
python
en
['en', 'en', 'en']
True
BTHomeHub5DeviceScanner.scan_devices
(self)
Scan for new devices and return a list with found device IDs.
Scan for new devices and return a list with found device IDs.
def scan_devices(self): """Scan for new devices and return a list with found device IDs.""" self.update_info() return (device for device in self.last_results)
[ "def", "scan_devices", "(", "self", ")", ":", "self", ".", "update_info", "(", ")", "return", "(", "device", "for", "device", "in", "self", ".", "last_results", ")" ]
[ 44, 4 ]
[ 48, 55 ]
python
en
['en', 'en', 'en']
True
BTHomeHub5DeviceScanner.get_device_name
(self, device)
Return the name of the given device or None if we don't know.
Return the name of the given device or None if we don't know.
def get_device_name(self, device): """Return the name of the given device or None if we don't know.""" # If not initialised and not already scanned and not found. if device not in self.last_results: self.update_info() if not self.last_results: return None...
[ "def", "get_device_name", "(", "self", ",", "device", ")", ":", "# If not initialised and not already scanned and not found.", "if", "device", "not", "in", "self", ".", "last_results", ":", "self", ".", "update_info", "(", ")", "if", "not", "self", ".", "last_resu...
[ 50, 4 ]
[ 59, 44 ]
python
en
['en', 'en', 'en']
True
BTHomeHub5DeviceScanner.update_info
(self)
Ensure the information from the BT Home Hub 5 is up to date.
Ensure the information from the BT Home Hub 5 is up to date.
def update_info(self): """Ensure the information from the BT Home Hub 5 is up to date.""" _LOGGER.info("Scanning") data = bthomehub5_devicelist.get_devicelist(self.host) if not data: _LOGGER.warning("Error scanning devices") return self.last_results = ...
[ "def", "update_info", "(", "self", ")", ":", "_LOGGER", ".", "info", "(", "\"Scanning\"", ")", "data", "=", "bthomehub5_devicelist", ".", "get_devicelist", "(", "self", ".", "host", ")", "if", "not", "data", ":", "_LOGGER", ".", "warning", "(", "\"Error sc...
[ 61, 4 ]
[ 72, 32 ]
python
en
['en', 'en', 'en']
True
setup_component
(hass)
Hue component.
Hue component.
async def setup_component(hass): """Hue component.""" with patch.object(hue, "async_setup_entry", return_value=True): assert ( await async_setup_component( hass, hue.DOMAIN, {}, ) is True )
[ "async", "def", "setup_component", "(", "hass", ")", ":", "with", "patch", ".", "object", "(", "hue", ",", "\"async_setup_entry\"", ",", "return_value", "=", "True", ")", ":", "assert", "(", "await", "async_setup_component", "(", "hass", ",", "hue", ".", "...
[ 16, 0 ]
[ 26, 9 ]
python
ca
['de', 'ca', 'en']
False
test_hue_activate_scene_both_responds
( hass, mock_bridge1, mock_bridge2, mock_config_entry1, mock_config_entry2 )
Test that makes both bridges successfully activate a scene.
Test that makes both bridges successfully activate a scene.
async def test_hue_activate_scene_both_responds( hass, mock_bridge1, mock_bridge2, mock_config_entry1, mock_config_entry2 ): """Test that makes both bridges successfully activate a scene.""" await setup_component(hass) await setup_bridge(hass, mock_bridge1, mock_config_entry1) await setup_bridge(h...
[ "async", "def", "test_hue_activate_scene_both_responds", "(", "hass", ",", "mock_bridge1", ",", "mock_bridge2", ",", "mock_config_entry1", ",", "mock_config_entry2", ")", ":", "await", "setup_component", "(", "hass", ")", "await", "setup_bridge", "(", "hass", ",", "...
[ 29, 0 ]
[ 52, 49 ]
python
en
['en', 'en', 'en']
True
test_hue_activate_scene_one_responds
( hass, mock_bridge1, mock_bridge2, mock_config_entry1, mock_config_entry2 )
Test that makes only one bridge successfully activate a scene.
Test that makes only one bridge successfully activate a scene.
async def test_hue_activate_scene_one_responds( hass, mock_bridge1, mock_bridge2, mock_config_entry1, mock_config_entry2 ): """Test that makes only one bridge successfully activate a scene.""" await setup_component(hass) await setup_bridge(hass, mock_bridge1, mock_config_entry1) await setup_bridge...
[ "async", "def", "test_hue_activate_scene_one_responds", "(", "hass", ",", "mock_bridge1", ",", "mock_bridge2", ",", "mock_config_entry1", ",", "mock_config_entry2", ")", ":", "await", "setup_component", "(", "hass", ")", "await", "setup_bridge", "(", "hass", ",", "m...
[ 55, 0 ]
[ 78, 49 ]
python
en
['en', 'en', 'en']
True
test_hue_activate_scene_zero_responds
( hass, mock_bridge1, mock_bridge2, mock_config_entry1, mock_config_entry2 )
Test that makes no bridge successfully activate a scene.
Test that makes no bridge successfully activate a scene.
async def test_hue_activate_scene_zero_responds( hass, mock_bridge1, mock_bridge2, mock_config_entry1, mock_config_entry2 ): """Test that makes no bridge successfully activate a scene.""" await setup_component(hass) await setup_bridge(hass, mock_bridge1, mock_config_entry1) await setup_bridge(hass...
[ "async", "def", "test_hue_activate_scene_zero_responds", "(", "hass", ",", "mock_bridge1", ",", "mock_bridge2", ",", "mock_config_entry1", ",", "mock_config_entry2", ")", ":", "await", "setup_component", "(", "hass", ")", "await", "setup_bridge", "(", "hass", ",", "...
[ 81, 0 ]
[ 105, 51 ]
python
en
['en', 'en', 'en']
True
setup_bridge
(hass, mock_bridge, config_entry)
Load the Hue light platform with the provided bridge.
Load the Hue light platform with the provided bridge.
async def setup_bridge(hass, mock_bridge, config_entry): """Load the Hue light platform with the provided bridge.""" mock_bridge.config_entry = config_entry hass.data[hue.DOMAIN][config_entry.entry_id] = mock_bridge await hass.config_entries.async_forward_entry_setup(config_entry, "light") # To flus...
[ "async", "def", "setup_bridge", "(", "hass", ",", "mock_bridge", ",", "config_entry", ")", ":", "mock_bridge", ".", "config_entry", "=", "config_entry", "hass", ".", "data", "[", "hue", ".", "DOMAIN", "]", "[", "config_entry", ".", "entry_id", "]", "=", "m...
[ 108, 0 ]
[ 114, 38 ]
python
en
['en', 'en', 'en']
True
mock_config_entry1
(hass)
Mock a config entry.
Mock a config entry.
def mock_config_entry1(hass): """Mock a config entry.""" return create_config_entry()
[ "def", "mock_config_entry1", "(", "hass", ")", ":", "return", "create_config_entry", "(", ")" ]
[ 118, 0 ]
[ 120, 32 ]
python
en
['en', 'gl', 'en']
True
mock_config_entry2
(hass)
Mock a config entry.
Mock a config entry.
def mock_config_entry2(hass): """Mock a config entry.""" return create_config_entry()
[ "def", "mock_config_entry2", "(", "hass", ")", ":", "return", "create_config_entry", "(", ")" ]
[ 124, 0 ]
[ 126, 32 ]
python
en
['en', 'gl', 'en']
True
create_config_entry
()
Mock a config entry.
Mock a config entry.
def create_config_entry(): """Mock a config entry.""" return config_entries.ConfigEntry( 1, hue.DOMAIN, "Mock Title", {"host": "mock-host"}, "test", config_entries.CONN_CLASS_LOCAL_POLL, system_options={}, )
[ "def", "create_config_entry", "(", ")", ":", "return", "config_entries", ".", "ConfigEntry", "(", "1", ",", "hue", ".", "DOMAIN", ",", "\"Mock Title\"", ",", "{", "\"host\"", ":", "\"mock-host\"", "}", ",", "\"test\"", ",", "config_entries", ".", "CONN_CLASS_L...
[ 129, 0 ]
[ 139, 5 ]
python
en
['en', 'gl', 'en']
True
mock_bridge1
(hass)
Mock a Hue bridge.
Mock a Hue bridge.
def mock_bridge1(hass): """Mock a Hue bridge.""" return create_mock_bridge(hass)
[ "def", "mock_bridge1", "(", "hass", ")", ":", "return", "create_mock_bridge", "(", "hass", ")" ]
[ 143, 0 ]
[ 145, 35 ]
python
en
['en', 'st', 'en']
True
mock_bridge2
(hass)
Mock a Hue bridge.
Mock a Hue bridge.
def mock_bridge2(hass): """Mock a Hue bridge.""" return create_mock_bridge(hass)
[ "def", "mock_bridge2", "(", "hass", ")", ":", "return", "create_mock_bridge", "(", "hass", ")" ]
[ 149, 0 ]
[ 151, 35 ]
python
en
['en', 'st', 'en']
True
create_mock_bridge
(hass)
Create a mock Hue bridge.
Create a mock Hue bridge.
def create_mock_bridge(hass): """Create a mock Hue bridge.""" bridge = Mock( hass=hass, available=True, authorized=True, allow_unreachable=False, allow_groups=False, api=Mock(), reset_jobs=[], spec=hue.HueBridge, ) bridge.sensor_manager = h...
[ "def", "create_mock_bridge", "(", "hass", ")", ":", "bridge", "=", "Mock", "(", "hass", "=", "hass", ",", "available", "=", "True", ",", "authorized", "=", "True", ",", "allow_unreachable", "=", "False", ",", "allow_groups", "=", "False", ",", "api", "="...
[ 154, 0 ]
[ 184, 17 ]
python
en
['en', 'st', 'en']
True
setup_platform
(hass, config, add_entities, discovery_info=None)
Set up the Dlib Face detection platform.
Set up the Dlib Face detection platform.
def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Dlib Face detection platform.""" entities = [] for camera in config[CONF_SOURCE]: entities.append( DlibFaceIdentifyEntity( camera[CONF_ENTITY_ID], config[CONF_FACES], ...
[ "def", "setup_platform", "(", "hass", ",", "config", ",", "add_entities", ",", "discovery_info", "=", "None", ")", ":", "entities", "=", "[", "]", "for", "camera", "in", "config", "[", "CONF_SOURCE", "]", ":", "entities", ".", "append", "(", "DlibFaceIdent...
[ 32, 0 ]
[ 45, 26 ]
python
en
['en', 'da', 'en']
True
DlibFaceIdentifyEntity.__init__
(self, camera_entity, faces, name, tolerance)
Initialize Dlib face identify entry.
Initialize Dlib face identify entry.
def __init__(self, camera_entity, faces, name, tolerance): """Initialize Dlib face identify entry.""" super().__init__() self._camera = camera_entity if name: self._name = name else: self._name = f"Dlib Face {split_entity_id(camera_entity)[1]}" ...
[ "def", "__init__", "(", "self", ",", "camera_entity", ",", "faces", ",", "name", ",", "tolerance", ")", ":", "super", "(", ")", ".", "__init__", "(", ")", "self", ".", "_camera", "=", "camera_entity", "if", "name", ":", "self", ".", "_name", "=", "na...
[ 51, 4 ]
[ 71, 35 ]
python
en
['en', 'en', 'en']
True
DlibFaceIdentifyEntity.camera_entity
(self)
Return camera entity id from process pictures.
Return camera entity id from process pictures.
def camera_entity(self): """Return camera entity id from process pictures.""" return self._camera
[ "def", "camera_entity", "(", "self", ")", ":", "return", "self", ".", "_camera" ]
[ 74, 4 ]
[ 76, 27 ]
python
en
['en', 'en', 'en']
True
DlibFaceIdentifyEntity.name
(self)
Return the name of the entity.
Return the name of the entity.
def name(self): """Return the name of the entity.""" return self._name
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "_name" ]
[ 79, 4 ]
[ 81, 25 ]
python
en
['en', 'en', 'en']
True
DlibFaceIdentifyEntity.process_image
(self, image)
Process image.
Process image.
def process_image(self, image): """Process image.""" fak_file = io.BytesIO(image) fak_file.name = "snapshot.jpg" fak_file.seek(0) image = face_recognition.load_image_file(fak_file) unknowns = face_recognition.face_encodings(image) found = [] for unknown...
[ "def", "process_image", "(", "self", ",", "image", ")", ":", "fak_file", "=", "io", ".", "BytesIO", "(", "image", ")", "fak_file", ".", "name", "=", "\"snapshot.jpg\"", "fak_file", ".", "seek", "(", "0", ")", "image", "=", "face_recognition", ".", "load_...
[ 83, 4 ]
[ 102, 48 ]
python
en
['en', 'ny', 'en']
False
async_setup
(hass: HomeAssistantType, config: ConfigType)
Set up climate entities.
Set up climate entities.
async def async_setup(hass: HomeAssistantType, config: ConfigType) -> bool: """Set up climate entities.""" component = hass.data[DOMAIN] = EntityComponent( _LOGGER, DOMAIN, hass, SCAN_INTERVAL ) await component.async_setup(config) component.async_register_entity_service(SERVICE_TURN_ON, {},...
[ "async", "def", "async_setup", "(", "hass", ":", "HomeAssistantType", ",", "config", ":", "ConfigType", ")", "->", "bool", ":", "component", "=", "hass", ".", "data", "[", "DOMAIN", "]", "=", "EntityComponent", "(", "_LOGGER", ",", "DOMAIN", ",", "hass", ...
[ 102, 0 ]
[ 153, 15 ]
python
en
['en', 'en', 'en']
True
async_setup_entry
(hass: HomeAssistantType, entry)
Set up a config entry.
Set up a config entry.
async def async_setup_entry(hass: HomeAssistantType, entry): """Set up a config entry.""" return await hass.data[DOMAIN].async_setup_entry(entry)
[ "async", "def", "async_setup_entry", "(", "hass", ":", "HomeAssistantType", ",", "entry", ")", ":", "return", "await", "hass", ".", "data", "[", "DOMAIN", "]", ".", "async_setup_entry", "(", "entry", ")" ]
[ 156, 0 ]
[ 158, 59 ]
python
en
['en', 'en', 'en']
True
async_unload_entry
(hass: HomeAssistantType, entry)
Unload a config entry.
Unload a config entry.
async def async_unload_entry(hass: HomeAssistantType, entry): """Unload a config entry.""" return await hass.data[DOMAIN].async_unload_entry(entry)
[ "async", "def", "async_unload_entry", "(", "hass", ":", "HomeAssistantType", ",", "entry", ")", ":", "return", "await", "hass", ".", "data", "[", "DOMAIN", "]", ".", "async_unload_entry", "(", "entry", ")" ]
[ 161, 0 ]
[ 163, 60 ]
python
en
['en', 'es', 'en']
True
async_service_aux_heat
( entity: ClimateEntity, service: ServiceDataType )
Handle aux heat service.
Handle aux heat service.
async def async_service_aux_heat( entity: ClimateEntity, service: ServiceDataType ) -> None: """Handle aux heat service.""" if service.data[ATTR_AUX_HEAT]: await entity.async_turn_aux_heat_on() else: await entity.async_turn_aux_heat_off()
[ "async", "def", "async_service_aux_heat", "(", "entity", ":", "ClimateEntity", ",", "service", ":", "ServiceDataType", ")", "->", "None", ":", "if", "service", ".", "data", "[", "ATTR_AUX_HEAT", "]", ":", "await", "entity", ".", "async_turn_aux_heat_on", "(", ...
[ 518, 0 ]
[ 525, 46 ]
python
fr
['fr', 'fr', 'fr']
True
async_service_temperature_set
( entity: ClimateEntity, service: ServiceDataType )
Handle set temperature service.
Handle set temperature service.
async def async_service_temperature_set( entity: ClimateEntity, service: ServiceDataType ) -> None: """Handle set temperature service.""" hass = entity.hass kwargs = {} for value, temp in service.data.items(): if value in CONVERTIBLE_ATTRIBUTE: kwargs[value] = convert_temperatur...
[ "async", "def", "async_service_temperature_set", "(", "entity", ":", "ClimateEntity", ",", "service", ":", "ServiceDataType", ")", "->", "None", ":", "hass", "=", "entity", ".", "hass", "kwargs", "=", "{", "}", "for", "value", ",", "temp", "in", "service", ...
[ 528, 0 ]
[ 543, 48 ]
python
ca
['es', 'ca', 'en']
False
ClimateEntity.state
(self)
Return the current state.
Return the current state.
def state(self) -> str: """Return the current state.""" return self.hvac_mode
[ "def", "state", "(", "self", ")", "->", "str", ":", "return", "self", ".", "hvac_mode" ]
[ 170, 4 ]
[ 172, 29 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.precision
(self)
Return the precision of the system.
Return the precision of the system.
def precision(self) -> float: """Return the precision of the system.""" if self.hass.config.units.temperature_unit == TEMP_CELSIUS: return PRECISION_TENTHS return PRECISION_WHOLE
[ "def", "precision", "(", "self", ")", "->", "float", ":", "if", "self", ".", "hass", ".", "config", ".", "units", ".", "temperature_unit", "==", "TEMP_CELSIUS", ":", "return", "PRECISION_TENTHS", "return", "PRECISION_WHOLE" ]
[ 175, 4 ]
[ 179, 30 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.capability_attributes
(self)
Return the capability attributes.
Return the capability attributes.
def capability_attributes(self) -> Optional[Dict[str, Any]]: """Return the capability attributes.""" supported_features = self.supported_features data = { ATTR_HVAC_MODES: self.hvac_modes, ATTR_MIN_TEMP: show_temp( self.hass, self.min_temp, self.temperatur...
[ "def", "capability_attributes", "(", "self", ")", "->", "Optional", "[", "Dict", "[", "str", ",", "Any", "]", "]", ":", "supported_features", "=", "self", ".", "supported_features", "data", "=", "{", "ATTR_HVAC_MODES", ":", "self", ".", "hvac_modes", ",", ...
[ 182, 4 ]
[ 211, 19 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.state_attributes
(self)
Return the optional state attributes.
Return the optional state attributes.
def state_attributes(self) -> Dict[str, Any]: """Return the optional state attributes.""" supported_features = self.supported_features data = { ATTR_CURRENT_TEMPERATURE: show_temp( self.hass, self.current_temperature, self.temperature_u...
[ "def", "state_attributes", "(", "self", ")", "->", "Dict", "[", "str", ",", "Any", "]", ":", "supported_features", "=", "self", ".", "supported_features", "data", "=", "{", "ATTR_CURRENT_TEMPERATURE", ":", "show_temp", "(", "self", ".", "hass", ",", "self", ...
[ 214, 4 ]
[ 269, 19 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.temperature_unit
(self)
Return the unit of measurement used by the platform.
Return the unit of measurement used by the platform.
def temperature_unit(self) -> str: """Return the unit of measurement used by the platform.""" raise NotImplementedError()
[ "def", "temperature_unit", "(", "self", ")", "->", "str", ":", "raise", "NotImplementedError", "(", ")" ]
[ 272, 4 ]
[ 274, 35 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.current_humidity
(self)
Return the current humidity.
Return the current humidity.
def current_humidity(self) -> Optional[int]: """Return the current humidity.""" return None
[ "def", "current_humidity", "(", "self", ")", "->", "Optional", "[", "int", "]", ":", "return", "None" ]
[ 277, 4 ]
[ 279, 19 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.target_humidity
(self)
Return the humidity we try to reach.
Return the humidity we try to reach.
def target_humidity(self) -> Optional[int]: """Return the humidity we try to reach.""" return None
[ "def", "target_humidity", "(", "self", ")", "->", "Optional", "[", "int", "]", ":", "return", "None" ]
[ 282, 4 ]
[ 284, 19 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.hvac_mode
(self)
Return hvac operation ie. heat, cool mode. Need to be one of HVAC_MODE_*.
Return hvac operation ie. heat, cool mode.
def hvac_mode(self) -> str: """Return hvac operation ie. heat, cool mode. Need to be one of HVAC_MODE_*. """
[ "def", "hvac_mode", "(", "self", ")", "->", "str", ":" ]
[ 288, 4 ]
[ 292, 11 ]
python
bg
['en', 'bg', 'bg']
True
ClimateEntity.hvac_modes
(self)
Return the list of available hvac operation modes. Need to be a subset of HVAC_MODES.
Return the list of available hvac operation modes.
def hvac_modes(self) -> List[str]: """Return the list of available hvac operation modes. Need to be a subset of HVAC_MODES. """
[ "def", "hvac_modes", "(", "self", ")", "->", "List", "[", "str", "]", ":" ]
[ 296, 4 ]
[ 300, 11 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.hvac_action
(self)
Return the current running hvac operation if supported. Need to be one of CURRENT_HVAC_*.
Return the current running hvac operation if supported.
def hvac_action(self) -> Optional[str]: """Return the current running hvac operation if supported. Need to be one of CURRENT_HVAC_*. """ return None
[ "def", "hvac_action", "(", "self", ")", "->", "Optional", "[", "str", "]", ":", "return", "None" ]
[ 303, 4 ]
[ 308, 19 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.current_temperature
(self)
Return the current temperature.
Return the current temperature.
def current_temperature(self) -> Optional[float]: """Return the current temperature.""" return None
[ "def", "current_temperature", "(", "self", ")", "->", "Optional", "[", "float", "]", ":", "return", "None" ]
[ 311, 4 ]
[ 313, 19 ]
python
en
['en', 'la', 'en']
True
ClimateEntity.target_temperature
(self)
Return the temperature we try to reach.
Return the temperature we try to reach.
def target_temperature(self) -> Optional[float]: """Return the temperature we try to reach.""" return None
[ "def", "target_temperature", "(", "self", ")", "->", "Optional", "[", "float", "]", ":", "return", "None" ]
[ 316, 4 ]
[ 318, 19 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.target_temperature_step
(self)
Return the supported step of target temperature.
Return the supported step of target temperature.
def target_temperature_step(self) -> Optional[float]: """Return the supported step of target temperature.""" return None
[ "def", "target_temperature_step", "(", "self", ")", "->", "Optional", "[", "float", "]", ":", "return", "None" ]
[ 321, 4 ]
[ 323, 19 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.target_temperature_high
(self)
Return the highbound target temperature we try to reach. Requires SUPPORT_TARGET_TEMPERATURE_RANGE.
Return the highbound target temperature we try to reach.
def target_temperature_high(self) -> Optional[float]: """Return the highbound target temperature we try to reach. Requires SUPPORT_TARGET_TEMPERATURE_RANGE. """ raise NotImplementedError
[ "def", "target_temperature_high", "(", "self", ")", "->", "Optional", "[", "float", "]", ":", "raise", "NotImplementedError" ]
[ 326, 4 ]
[ 331, 33 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.target_temperature_low
(self)
Return the lowbound target temperature we try to reach. Requires SUPPORT_TARGET_TEMPERATURE_RANGE.
Return the lowbound target temperature we try to reach.
def target_temperature_low(self) -> Optional[float]: """Return the lowbound target temperature we try to reach. Requires SUPPORT_TARGET_TEMPERATURE_RANGE. """ raise NotImplementedError
[ "def", "target_temperature_low", "(", "self", ")", "->", "Optional", "[", "float", "]", ":", "raise", "NotImplementedError" ]
[ 334, 4 ]
[ 339, 33 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.preset_mode
(self)
Return the current preset mode, e.g., home, away, temp. Requires SUPPORT_PRESET_MODE.
Return the current preset mode, e.g., home, away, temp.
def preset_mode(self) -> Optional[str]: """Return the current preset mode, e.g., home, away, temp. Requires SUPPORT_PRESET_MODE. """ raise NotImplementedError
[ "def", "preset_mode", "(", "self", ")", "->", "Optional", "[", "str", "]", ":", "raise", "NotImplementedError" ]
[ 342, 4 ]
[ 347, 33 ]
python
en
['en', 'pt', 'en']
True
ClimateEntity.preset_modes
(self)
Return a list of available preset modes. Requires SUPPORT_PRESET_MODE.
Return a list of available preset modes.
def preset_modes(self) -> Optional[List[str]]: """Return a list of available preset modes. Requires SUPPORT_PRESET_MODE. """ raise NotImplementedError
[ "def", "preset_modes", "(", "self", ")", "->", "Optional", "[", "List", "[", "str", "]", "]", ":", "raise", "NotImplementedError" ]
[ 350, 4 ]
[ 355, 33 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.is_aux_heat
(self)
Return true if aux heater. Requires SUPPORT_AUX_HEAT.
Return true if aux heater.
def is_aux_heat(self) -> Optional[bool]: """Return true if aux heater. Requires SUPPORT_AUX_HEAT. """ raise NotImplementedError
[ "def", "is_aux_heat", "(", "self", ")", "->", "Optional", "[", "bool", "]", ":", "raise", "NotImplementedError" ]
[ 358, 4 ]
[ 363, 33 ]
python
fr
['fr', 'co', 'fr']
True
ClimateEntity.fan_mode
(self)
Return the fan setting. Requires SUPPORT_FAN_MODE.
Return the fan setting.
def fan_mode(self) -> Optional[str]: """Return the fan setting. Requires SUPPORT_FAN_MODE. """ raise NotImplementedError
[ "def", "fan_mode", "(", "self", ")", "->", "Optional", "[", "str", "]", ":", "raise", "NotImplementedError" ]
[ 366, 4 ]
[ 371, 33 ]
python
en
['en', 'fy', 'en']
True
ClimateEntity.fan_modes
(self)
Return the list of available fan modes. Requires SUPPORT_FAN_MODE.
Return the list of available fan modes.
def fan_modes(self) -> Optional[List[str]]: """Return the list of available fan modes. Requires SUPPORT_FAN_MODE. """ raise NotImplementedError
[ "def", "fan_modes", "(", "self", ")", "->", "Optional", "[", "List", "[", "str", "]", "]", ":", "raise", "NotImplementedError" ]
[ 374, 4 ]
[ 379, 33 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.swing_mode
(self)
Return the swing setting. Requires SUPPORT_SWING_MODE.
Return the swing setting.
def swing_mode(self) -> Optional[str]: """Return the swing setting. Requires SUPPORT_SWING_MODE. """ raise NotImplementedError
[ "def", "swing_mode", "(", "self", ")", "->", "Optional", "[", "str", "]", ":", "raise", "NotImplementedError" ]
[ 382, 4 ]
[ 387, 33 ]
python
en
['en', 'ig', 'en']
True
ClimateEntity.swing_modes
(self)
Return the list of available swing modes. Requires SUPPORT_SWING_MODE.
Return the list of available swing modes.
def swing_modes(self) -> Optional[List[str]]: """Return the list of available swing modes. Requires SUPPORT_SWING_MODE. """ raise NotImplementedError
[ "def", "swing_modes", "(", "self", ")", "->", "Optional", "[", "List", "[", "str", "]", "]", ":", "raise", "NotImplementedError" ]
[ 390, 4 ]
[ 395, 33 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.set_temperature
(self, **kwargs)
Set new target temperature.
Set new target temperature.
def set_temperature(self, **kwargs) -> None: """Set new target temperature.""" raise NotImplementedError()
[ "def", "set_temperature", "(", "self", ",", "*", "*", "kwargs", ")", "->", "None", ":", "raise", "NotImplementedError", "(", ")" ]
[ 397, 4 ]
[ 399, 35 ]
python
en
['en', 'ca', 'en']
True
ClimateEntity.async_set_temperature
(self, **kwargs)
Set new target temperature.
Set new target temperature.
async def async_set_temperature(self, **kwargs) -> None: """Set new target temperature.""" await self.hass.async_add_executor_job( ft.partial(self.set_temperature, **kwargs) )
[ "async", "def", "async_set_temperature", "(", "self", ",", "*", "*", "kwargs", ")", "->", "None", ":", "await", "self", ".", "hass", ".", "async_add_executor_job", "(", "ft", ".", "partial", "(", "self", ".", "set_temperature", ",", "*", "*", "kwargs", "...
[ 401, 4 ]
[ 405, 9 ]
python
en
['en', 'ca', 'en']
True
ClimateEntity.set_humidity
(self, humidity: int)
Set new target humidity.
Set new target humidity.
def set_humidity(self, humidity: int) -> None: """Set new target humidity.""" raise NotImplementedError()
[ "def", "set_humidity", "(", "self", ",", "humidity", ":", "int", ")", "->", "None", ":", "raise", "NotImplementedError", "(", ")" ]
[ 407, 4 ]
[ 409, 35 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.async_set_humidity
(self, humidity: int)
Set new target humidity.
Set new target humidity.
async def async_set_humidity(self, humidity: int) -> None: """Set new target humidity.""" await self.hass.async_add_executor_job(self.set_humidity, humidity)
[ "async", "def", "async_set_humidity", "(", "self", ",", "humidity", ":", "int", ")", "->", "None", ":", "await", "self", ".", "hass", ".", "async_add_executor_job", "(", "self", ".", "set_humidity", ",", "humidity", ")" ]
[ 411, 4 ]
[ 413, 75 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.set_fan_mode
(self, fan_mode: str)
Set new target fan mode.
Set new target fan mode.
def set_fan_mode(self, fan_mode: str) -> None: """Set new target fan mode.""" raise NotImplementedError()
[ "def", "set_fan_mode", "(", "self", ",", "fan_mode", ":", "str", ")", "->", "None", ":", "raise", "NotImplementedError", "(", ")" ]
[ 415, 4 ]
[ 417, 35 ]
python
en
['sv', 'fy', 'en']
False
ClimateEntity.async_set_fan_mode
(self, fan_mode: str)
Set new target fan mode.
Set new target fan mode.
async def async_set_fan_mode(self, fan_mode: str) -> None: """Set new target fan mode.""" await self.hass.async_add_executor_job(self.set_fan_mode, fan_mode)
[ "async", "def", "async_set_fan_mode", "(", "self", ",", "fan_mode", ":", "str", ")", "->", "None", ":", "await", "self", ".", "hass", ".", "async_add_executor_job", "(", "self", ".", "set_fan_mode", ",", "fan_mode", ")" ]
[ 419, 4 ]
[ 421, 75 ]
python
en
['sv', 'fy', 'en']
False
ClimateEntity.set_hvac_mode
(self, hvac_mode: str)
Set new target hvac mode.
Set new target hvac mode.
def set_hvac_mode(self, hvac_mode: str) -> None: """Set new target hvac mode.""" raise NotImplementedError()
[ "def", "set_hvac_mode", "(", "self", ",", "hvac_mode", ":", "str", ")", "->", "None", ":", "raise", "NotImplementedError", "(", ")" ]
[ 423, 4 ]
[ 425, 35 ]
python
da
['da', 'su', 'en']
False
ClimateEntity.async_set_hvac_mode
(self, hvac_mode: str)
Set new target hvac mode.
Set new target hvac mode.
async def async_set_hvac_mode(self, hvac_mode: str) -> None: """Set new target hvac mode.""" await self.hass.async_add_executor_job(self.set_hvac_mode, hvac_mode)
[ "async", "def", "async_set_hvac_mode", "(", "self", ",", "hvac_mode", ":", "str", ")", "->", "None", ":", "await", "self", ".", "hass", ".", "async_add_executor_job", "(", "self", ".", "set_hvac_mode", ",", "hvac_mode", ")" ]
[ 427, 4 ]
[ 429, 77 ]
python
da
['da', 'su', 'en']
False
ClimateEntity.set_swing_mode
(self, swing_mode: str)
Set new target swing operation.
Set new target swing operation.
def set_swing_mode(self, swing_mode: str) -> None: """Set new target swing operation.""" raise NotImplementedError()
[ "def", "set_swing_mode", "(", "self", ",", "swing_mode", ":", "str", ")", "->", "None", ":", "raise", "NotImplementedError", "(", ")" ]
[ 431, 4 ]
[ 433, 35 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.async_set_swing_mode
(self, swing_mode: str)
Set new target swing operation.
Set new target swing operation.
async def async_set_swing_mode(self, swing_mode: str) -> None: """Set new target swing operation.""" await self.hass.async_add_executor_job(self.set_swing_mode, swing_mode)
[ "async", "def", "async_set_swing_mode", "(", "self", ",", "swing_mode", ":", "str", ")", "->", "None", ":", "await", "self", ".", "hass", ".", "async_add_executor_job", "(", "self", ".", "set_swing_mode", ",", "swing_mode", ")" ]
[ 435, 4 ]
[ 437, 79 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.set_preset_mode
(self, preset_mode: str)
Set new preset mode.
Set new preset mode.
def set_preset_mode(self, preset_mode: str) -> None: """Set new preset mode.""" raise NotImplementedError()
[ "def", "set_preset_mode", "(", "self", ",", "preset_mode", ":", "str", ")", "->", "None", ":", "raise", "NotImplementedError", "(", ")" ]
[ 439, 4 ]
[ 441, 35 ]
python
en
['en', 'sr', 'en']
True
ClimateEntity.async_set_preset_mode
(self, preset_mode: str)
Set new preset mode.
Set new preset mode.
async def async_set_preset_mode(self, preset_mode: str) -> None: """Set new preset mode.""" await self.hass.async_add_executor_job(self.set_preset_mode, preset_mode)
[ "async", "def", "async_set_preset_mode", "(", "self", ",", "preset_mode", ":", "str", ")", "->", "None", ":", "await", "self", ".", "hass", ".", "async_add_executor_job", "(", "self", ".", "set_preset_mode", ",", "preset_mode", ")" ]
[ 443, 4 ]
[ 445, 81 ]
python
en
['en', 'sr', 'en']
True
ClimateEntity.turn_aux_heat_on
(self)
Turn auxiliary heater on.
Turn auxiliary heater on.
def turn_aux_heat_on(self) -> None: """Turn auxiliary heater on.""" raise NotImplementedError()
[ "def", "turn_aux_heat_on", "(", "self", ")", "->", "None", ":", "raise", "NotImplementedError", "(", ")" ]
[ 447, 4 ]
[ 449, 35 ]
python
en
['fr', 'fi', 'en']
False
ClimateEntity.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.""" await self.hass.async_add_executor_job(self.turn_aux_heat_on)
[ "async", "def", "async_turn_aux_heat_on", "(", "self", ")", "->", "None", ":", "await", "self", ".", "hass", ".", "async_add_executor_job", "(", "self", ".", "turn_aux_heat_on", ")" ]
[ 451, 4 ]
[ 453, 69 ]
python
en
['fr', 'fi', 'en']
False
ClimateEntity.turn_aux_heat_off
(self)
Turn auxiliary heater off.
Turn auxiliary heater off.
def turn_aux_heat_off(self) -> None: """Turn auxiliary heater off.""" raise NotImplementedError()
[ "def", "turn_aux_heat_off", "(", "self", ")", "->", "None", ":", "raise", "NotImplementedError", "(", ")" ]
[ 455, 4 ]
[ 457, 35 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.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.""" await self.hass.async_add_executor_job(self.turn_aux_heat_off)
[ "async", "def", "async_turn_aux_heat_off", "(", "self", ")", "->", "None", ":", "await", "self", ".", "hass", ".", "async_add_executor_job", "(", "self", ".", "turn_aux_heat_off", ")" ]
[ 459, 4 ]
[ 461, 70 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.async_turn_on
(self)
Turn the entity on.
Turn the entity on.
async def async_turn_on(self) -> None: """Turn the entity on.""" if hasattr(self, "turn_on"): # pylint: disable=no-member await self.hass.async_add_executor_job(self.turn_on) return # Fake turn on for mode in (HVAC_MODE_HEAT_COOL, HVAC_MODE_HEAT, HVAC...
[ "async", "def", "async_turn_on", "(", "self", ")", "->", "None", ":", "if", "hasattr", "(", "self", ",", "\"turn_on\"", ")", ":", "# pylint: disable=no-member", "await", "self", ".", "hass", ".", "async_add_executor_job", "(", "self", ".", "turn_on", ")", "r...
[ 463, 4 ]
[ 475, 17 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.async_turn_off
(self)
Turn the entity off.
Turn the entity off.
async def async_turn_off(self) -> None: """Turn the entity off.""" if hasattr(self, "turn_off"): # pylint: disable=no-member await self.hass.async_add_executor_job(self.turn_off) return # Fake turn off if HVAC_MODE_OFF in self.hvac_modes: ...
[ "async", "def", "async_turn_off", "(", "self", ")", "->", "None", ":", "if", "hasattr", "(", "self", ",", "\"turn_off\"", ")", ":", "# pylint: disable=no-member", "await", "self", ".", "hass", ".", "async_add_executor_job", "(", "self", ".", "turn_off", ")", ...
[ 477, 4 ]
[ 486, 57 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.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.""" raise NotImplementedError()
[ "def", "supported_features", "(", "self", ")", "->", "int", ":", "raise", "NotImplementedError", "(", ")" ]
[ 489, 4 ]
[ 491, 35 ]
python
en
['en', 'en', 'en']
True
ClimateEntity.min_temp
(self)
Return the minimum temperature.
Return the minimum temperature.
def min_temp(self) -> float: """Return the minimum temperature.""" return convert_temperature( DEFAULT_MIN_TEMP, TEMP_CELSIUS, self.temperature_unit )
[ "def", "min_temp", "(", "self", ")", "->", "float", ":", "return", "convert_temperature", "(", "DEFAULT_MIN_TEMP", ",", "TEMP_CELSIUS", ",", "self", ".", "temperature_unit", ")" ]
[ 494, 4 ]
[ 498, 9 ]
python
en
['en', 'la', 'en']
True
ClimateEntity.max_temp
(self)
Return the maximum temperature.
Return the maximum temperature.
def max_temp(self) -> float: """Return the maximum temperature.""" return convert_temperature( DEFAULT_MAX_TEMP, TEMP_CELSIUS, self.temperature_unit )
[ "def", "max_temp", "(", "self", ")", "->", "float", ":", "return", "convert_temperature", "(", "DEFAULT_MAX_TEMP", ",", "TEMP_CELSIUS", ",", "self", ".", "temperature_unit", ")" ]
[ 501, 4 ]
[ 505, 9 ]
python
en
['en', 'la', 'en']
True
ClimateEntity.min_humidity
(self)
Return the minimum humidity.
Return the minimum humidity.
def min_humidity(self) -> int: """Return the minimum humidity.""" return DEFAULT_MIN_HUMIDITY
[ "def", "min_humidity", "(", "self", ")", "->", "int", ":", "return", "DEFAULT_MIN_HUMIDITY" ]
[ 508, 4 ]
[ 510, 35 ]
python
en
['en', 'et', 'en']
True
ClimateEntity.max_humidity
(self)
Return the maximum humidity.
Return the maximum humidity.
def max_humidity(self) -> int: """Return the maximum humidity.""" return DEFAULT_MAX_HUMIDITY
[ "def", "max_humidity", "(", "self", ")", "->", "int", ":", "return", "DEFAULT_MAX_HUMIDITY" ]
[ 513, 4 ]
[ 515, 35 ]
python
en
['en', 'la', 'en']
True
ClimateDevice.__init_subclass__
(cls, **kwargs)
Print deprecation warning.
Print deprecation warning.
def __init_subclass__(cls, **kwargs): """Print deprecation warning.""" super().__init_subclass__(**kwargs) _LOGGER.warning( "ClimateDevice is deprecated, modify %s to extend ClimateEntity", cls.__name__, )
[ "def", "__init_subclass__", "(", "cls", ",", "*", "*", "kwargs", ")", ":", "super", "(", ")", ".", "__init_subclass__", "(", "*", "*", "kwargs", ")", "_LOGGER", ".", "warning", "(", "\"ClimateDevice is deprecated, modify %s to extend ClimateEntity\"", ",", "cls", ...
[ 549, 4 ]
[ 555, 9 ]
python
de
['de', 'sv', 'en']
False
async_setup
(hass, config)
Set up the Plex component.
Set up the Plex component.
async def async_setup(hass, config): """Set up the Plex component.""" hass.data.setdefault( PLEX_DOMAIN, {SERVERS: {}, DISPATCHERS: {}, WEBSOCKETS: {}, PLATFORMS_COMPLETED: {}}, ) await async_setup_services(hass) gdm = hass.data[PLEX_DOMAIN][GDM_SCANNER] = GDM() hass.data[PLEX...
[ "async", "def", "async_setup", "(", "hass", ",", "config", ")", ":", "hass", ".", "data", ".", "setdefault", "(", "PLEX_DOMAIN", ",", "{", "SERVERS", ":", "{", "}", ",", "DISPATCHERS", ":", "{", "}", ",", "WEBSOCKETS", ":", "{", "}", ",", "PLATFORMS_...
[ 64, 0 ]
[ 83, 15 ]
python
en
['en', 'fr', 'en']
True
async_setup_entry
(hass, entry)
Set up Plex from a config entry.
Set up Plex from a config entry.
async def async_setup_entry(hass, entry): """Set up Plex from a config entry.""" server_config = entry.data[PLEX_SERVER_CONFIG] if entry.unique_id is None: hass.config_entries.async_update_entry( entry, unique_id=entry.data[CONF_SERVER_IDENTIFIER] ) if MP_DOMAIN not in entr...
[ "async", "def", "async_setup_entry", "(", "hass", ",", "entry", ")", ":", "server_config", "=", "entry", ".", "data", "[", "PLEX_SERVER_CONFIG", "]", "if", "entry", ".", "unique_id", "is", "None", ":", "hass", ".", "config_entries", ".", "async_update_entry", ...
[ 86, 0 ]
[ 249, 15 ]
python
en
['en', 'en', 'en']
True
async_unload_entry
(hass, entry)
Unload a config entry.
Unload a config entry.
async def async_unload_entry(hass, entry): """Unload a config entry.""" server_id = entry.data[CONF_SERVER_IDENTIFIER] websocket = hass.data[PLEX_DOMAIN][WEBSOCKETS].pop(server_id) websocket.close() dispatchers = hass.data[PLEX_DOMAIN][DISPATCHERS].pop(server_id) for unsub in dispatchers: ...
[ "async", "def", "async_unload_entry", "(", "hass", ",", "entry", ")", ":", "server_id", "=", "entry", ".", "data", "[", "CONF_SERVER_IDENTIFIER", "]", "websocket", "=", "hass", ".", "data", "[", "PLEX_DOMAIN", "]", "[", "WEBSOCKETS", "]", ".", "pop", "(", ...
[ 252, 0 ]
[ 271, 15 ]
python
en
['en', 'es', 'en']
True
async_options_updated
(hass, entry)
Triggered by config entry options updates.
Triggered by config entry options updates.
async def async_options_updated(hass, entry): """Triggered by config entry options updates.""" server_id = entry.data[CONF_SERVER_IDENTIFIER] # Guard incomplete setup during reauth flows if server_id in hass.data[PLEX_DOMAIN][SERVERS]: hass.data[PLEX_DOMAIN][SERVERS][server_id].options = entry....
[ "async", "def", "async_options_updated", "(", "hass", ",", "entry", ")", ":", "server_id", "=", "entry", ".", "data", "[", "CONF_SERVER_IDENTIFIER", "]", "# Guard incomplete setup during reauth flows", "if", "server_id", "in", "hass", ".", "data", "[", "PLEX_DOMAIN"...
[ 274, 0 ]
[ 280, 74 ]
python
en
['en', 'en', 'en']
True
play_on_sonos
(hass, service_call)
Play Plex media on a linked Sonos device.
Play Plex media on a linked Sonos device.
def play_on_sonos(hass, service_call): """Play Plex media on a linked Sonos device.""" entity_id = service_call.data[ATTR_ENTITY_ID] content_id = service_call.data[ATTR_MEDIA_CONTENT_ID] content_type = service_call.data.get(ATTR_MEDIA_CONTENT_TYPE) sonos = hass.components.sonos try: son...
[ "def", "play_on_sonos", "(", "hass", ",", "service_call", ")", ":", "entity_id", "=", "service_call", ".", "data", "[", "ATTR_ENTITY_ID", "]", "content_id", "=", "service_call", ".", "data", "[", "ATTR_MEDIA_CONTENT_ID", "]", "content_type", "=", "service_call", ...
[ 283, 0 ]
[ 307, 34 ]
python
en
['es', 'sk', 'en']
False
setup_comp
(hass, mqtt_mock)
Set up mqtt component.
Set up mqtt component.
def setup_comp(hass, mqtt_mock): """Set up mqtt component.""" pass
[ "def", "setup_comp", "(", "hass", ",", "mqtt_mock", ")", ":", "pass" ]
[ 12, 0 ]
[ 14, 8 ]
python
en
['en', 'lb', 'it']
False
test_ensure_device_tracker_platform_validation
(hass)
Test if platform validation was done.
Test if platform validation was done.
async def test_ensure_device_tracker_platform_validation(hass): """Test if platform validation was done.""" async def mock_setup_scanner(hass, config, see, discovery_info=None): """Check that Qos was added by validation.""" assert "qos" in config with patch( "homeassistant.componen...
[ "async", "def", "test_ensure_device_tracker_platform_validation", "(", "hass", ")", ":", "async", "def", "mock_setup_scanner", "(", "hass", ",", "config", ",", "see", ",", "discovery_info", "=", "None", ")", ":", "\"\"\"Check that Qos was added by validation.\"\"\"", "a...
[ 17, 0 ]
[ 35, 38 ]
python
en
['en', 'de', 'en']
True
test_new_message
(hass, mock_device_tracker_conf)
Test new message.
Test new message.
async def test_new_message(hass, mock_device_tracker_conf): """Test new message.""" dev_id = "paulus" entity_id = f"{DOMAIN}.{dev_id}" topic = "/location/paulus" location = "work" hass.config.components = {"mqtt", "zone"} assert await async_setup_component( hass, DOMAIN, {DOMAIN: {C...
[ "async", "def", "test_new_message", "(", "hass", ",", "mock_device_tracker_conf", ")", ":", "dev_id", "=", "\"paulus\"", "entity_id", "=", "f\"{DOMAIN}.{dev_id}\"", "topic", "=", "\"/location/paulus\"", "location", "=", "\"work\"", "hass", ".", "config", ".", "compo...
[ 38, 0 ]
[ 51, 55 ]
python
en
['en', 'en', 'en']
True
test_single_level_wildcard_topic
(hass, mock_device_tracker_conf)
Test single level wildcard topic.
Test single level wildcard topic.
async def test_single_level_wildcard_topic(hass, mock_device_tracker_conf): """Test single level wildcard topic.""" dev_id = "paulus" entity_id = f"{DOMAIN}.{dev_id}" subscription = "/location/+/paulus" topic = "/location/room/paulus" location = "work" hass.config.components = {"mqtt", "zon...
[ "async", "def", "test_single_level_wildcard_topic", "(", "hass", ",", "mock_device_tracker_conf", ")", ":", "dev_id", "=", "\"paulus\"", "entity_id", "=", "f\"{DOMAIN}.{dev_id}\"", "subscription", "=", "\"/location/+/paulus\"", "topic", "=", "\"/location/room/paulus\"", "lo...
[ 54, 0 ]
[ 70, 55 ]
python
en
['en', 'en', 'en']
True