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_config_setup | (hass, loop) | Test it sets up hassbian. | Test it sets up hassbian. | async def test_config_setup(hass, loop):
"""Test it sets up hassbian."""
await async_setup_component(hass, "config", {})
assert "config" in hass.config.components | [
"async",
"def",
"test_config_setup",
"(",
"hass",
",",
"loop",
")",
":",
"await",
"async_setup_component",
"(",
"hass",
",",
"\"config\"",
",",
"{",
"}",
")",
"assert",
"\"config\"",
"in",
"hass",
".",
"config",
".",
"components"
] | [
11,
0
] | [
14,
45
] | python | en | ['en', 'fr', 'en'] | True |
test_load_on_demand_already_loaded | (hass, aiohttp_client) | Test getting suites. | Test getting suites. | async def test_load_on_demand_already_loaded(hass, aiohttp_client):
"""Test getting suites."""
mock_component(hass, "zwave")
with patch.object(config, "SECTIONS", []), patch.object(
config, "ON_DEMAND", ["zwave"]
), patch(
"homeassistant.components.config.zwave.async_setup", return_valu... | [
"async",
"def",
"test_load_on_demand_already_loaded",
"(",
"hass",
",",
"aiohttp_client",
")",
":",
"mock_component",
"(",
"hass",
",",
"\"zwave\"",
")",
"with",
"patch",
".",
"object",
"(",
"config",
",",
"\"SECTIONS\"",
",",
"[",
"]",
")",
",",
"patch",
".... | [
17,
0
] | [
30,
21
] | python | en | ['nl', 'en', 'en'] | True |
test_load_on_demand_on_load | (hass, aiohttp_client) | Test getting suites. | Test getting suites. | async def test_load_on_demand_on_load(hass, aiohttp_client):
"""Test getting suites."""
with patch.object(config, "SECTIONS", []), patch.object(
config, "ON_DEMAND", ["zwave"]
):
await async_setup_component(hass, "config", {})
assert "config.zwave" not in hass.config.components
wit... | [
"async",
"def",
"test_load_on_demand_on_load",
"(",
"hass",
",",
"aiohttp_client",
")",
":",
"with",
"patch",
".",
"object",
"(",
"config",
",",
"\"SECTIONS\"",
",",
"[",
"]",
")",
",",
"patch",
".",
"object",
"(",
"config",
",",
"\"ON_DEMAND\"",
",",
"[",... | [
33,
0
] | [
48,
21
] | python | en | ['nl', 'en', 'en'] | True |
test_setup_no_devices | (hass, numato_fixture, monkeypatch) | Test handling of an 'empty' discovery.
Platform setups are expected to return after handling errors locally
without raising.
| Test handling of an 'empty' discovery. | async def test_setup_no_devices(hass, numato_fixture, monkeypatch):
"""Test handling of an 'empty' discovery.
Platform setups are expected to return after handling errors locally
without raising.
"""
monkeypatch.setattr(numato_fixture, "discover", mockup_return)
assert await async_setup_compone... | [
"async",
"def",
"test_setup_no_devices",
"(",
"hass",
",",
"numato_fixture",
",",
"monkeypatch",
")",
":",
"monkeypatch",
".",
"setattr",
"(",
"numato_fixture",
",",
"\"discover\"",
",",
"mockup_return",
")",
"assert",
"await",
"async_setup_component",
"(",
"hass",
... | [
10,
0
] | [
18,
43
] | python | en | ['en', 'en', 'en'] | True |
test_fail_setup_raising_discovery | (hass, numato_fixture, caplog, monkeypatch) | Test handling of an exception during discovery.
Setup shall return False.
| Test handling of an exception during discovery. | async def test_fail_setup_raising_discovery(hass, numato_fixture, caplog, monkeypatch):
"""Test handling of an exception during discovery.
Setup shall return False.
"""
monkeypatch.setattr(numato_fixture, "discover", mockup_raise)
assert not await async_setup_component(hass, "numato", NUMATO_CFG)
... | [
"async",
"def",
"test_fail_setup_raising_discovery",
"(",
"hass",
",",
"numato_fixture",
",",
"caplog",
",",
"monkeypatch",
")",
":",
"monkeypatch",
".",
"setattr",
"(",
"numato_fixture",
",",
"\"discover\"",
",",
"mockup_raise",
")",
"assert",
"not",
"await",
"as... | [
21,
0
] | [
28,
38
] | python | en | ['en', 'en', 'en'] | True |
test_hass_numato_api_wrong_port_directions | (hass, numato_fixture) | Test handling of wrong port directions.
This won't happen in the current platform implementation but would raise
in case of an introduced bug in the platforms.
| Test handling of wrong port directions. | async def test_hass_numato_api_wrong_port_directions(hass, numato_fixture):
"""Test handling of wrong port directions.
This won't happen in the current platform implementation but would raise
in case of an introduced bug in the platforms.
"""
numato_fixture.discover()
api = numato.NumatoAPI()
... | [
"async",
"def",
"test_hass_numato_api_wrong_port_directions",
"(",
"hass",
",",
"numato_fixture",
")",
":",
"numato_fixture",
".",
"discover",
"(",
")",
"api",
"=",
"numato",
".",
"NumatoAPI",
"(",
")",
"api",
".",
"setup_output",
"(",
"0",
",",
"5",
")",
"a... | [
31,
0
] | [
45,
33
] | python | en | ['en', 'en', 'en'] | True |
test_hass_numato_api_errors | (hass, numato_fixture, monkeypatch) | Test whether Home Assistant numato API (re-)raises errors. | Test whether Home Assistant numato API (re-)raises errors. | async def test_hass_numato_api_errors(hass, numato_fixture, monkeypatch):
"""Test whether Home Assistant numato API (re-)raises errors."""
numato_fixture.discover()
monkeypatch.setattr(numato_fixture.devices[0], "setup", mockup_raise)
monkeypatch.setattr(numato_fixture.devices[0], "adc_read", mockup_rai... | [
"async",
"def",
"test_hass_numato_api_errors",
"(",
"hass",
",",
"numato_fixture",
",",
"monkeypatch",
")",
":",
"numato_fixture",
".",
"discover",
"(",
")",
"monkeypatch",
".",
"setattr",
"(",
"numato_fixture",
".",
"devices",
"[",
"0",
"]",
",",
"\"setup\"",
... | [
48,
0
] | [
60,
33
] | python | en | ['en', 'fr', 'pt'] | False |
test_invalid_port_number | (hass, numato_fixture, config) | Test validation of ADC port number type. | Test validation of ADC port number type. | async def test_invalid_port_number(hass, numato_fixture, config):
"""Test validation of ADC port number type."""
sensorports_cfg = config["numato"]["devices"][0]["sensors"]["ports"]
port1_config = sensorports_cfg["1"]
sensorports_cfg["one"] = port1_config
del sensorports_cfg["1"]
assert not awai... | [
"async",
"def",
"test_invalid_port_number",
"(",
"hass",
",",
"numato_fixture",
",",
"config",
")",
":",
"sensorports_cfg",
"=",
"config",
"[",
"\"numato\"",
"]",
"[",
"\"devices\"",
"]",
"[",
"0",
"]",
"[",
"\"sensors\"",
"]",
"[",
"\"ports\"",
"]",
"port1_... | [
63,
0
] | [
71,
37
] | python | en | ['en', 'en', 'en'] | True |
test_too_low_adc_port_number | (hass, numato_fixture, config) | Test handling of failing component setup.
Tries setting up an ADC on a port below (0) the allowed range.
| Test handling of failing component setup. | async def test_too_low_adc_port_number(hass, numato_fixture, config):
"""Test handling of failing component setup.
Tries setting up an ADC on a port below (0) the allowed range.
"""
sensorports_cfg = config["numato"]["devices"][0]["sensors"]["ports"]
sensorports_cfg.update({0: {"name": "toolow"}})... | [
"async",
"def",
"test_too_low_adc_port_number",
"(",
"hass",
",",
"numato_fixture",
",",
"config",
")",
":",
"sensorports_cfg",
"=",
"config",
"[",
"\"numato\"",
"]",
"[",
"\"devices\"",
"]",
"[",
"0",
"]",
"[",
"\"sensors\"",
"]",
"[",
"\"ports\"",
"]",
"se... | [
74,
0
] | [
83,
37
] | python | en | ['en', 'bg', 'en'] | True |
test_too_high_adc_port_number | (hass, numato_fixture, config) | Test handling of failing component setup.
Tries setting up an ADC on a port above (8) the allowed range.
| Test handling of failing component setup. | async def test_too_high_adc_port_number(hass, numato_fixture, config):
"""Test handling of failing component setup.
Tries setting up an ADC on a port above (8) the allowed range.
"""
sensorports_cfg = config["numato"]["devices"][0]["sensors"]["ports"]
sensorports_cfg.update({8: {"name": "toohigh"}}... | [
"async",
"def",
"test_too_high_adc_port_number",
"(",
"hass",
",",
"numato_fixture",
",",
"config",
")",
":",
"sensorports_cfg",
"=",
"config",
"[",
"\"numato\"",
"]",
"[",
"\"devices\"",
"]",
"[",
"0",
"]",
"[",
"\"sensors\"",
"]",
"[",
"\"ports\"",
"]",
"s... | [
86,
0
] | [
94,
37
] | python | en | ['en', 'bg', 'en'] | True |
test_invalid_adc_range_value_type | (hass, numato_fixture, config) | Test validation of ADC range config's types.
Replaces the source range beginning by a string.
| Test validation of ADC range config's types. | async def test_invalid_adc_range_value_type(hass, numato_fixture, config):
"""Test validation of ADC range config's types.
Replaces the source range beginning by a string.
"""
sensorports_cfg = config["numato"]["devices"][0]["sensors"]["ports"]
sensorports_cfg["1"]["source_range"][0] = "zero"
a... | [
"async",
"def",
"test_invalid_adc_range_value_type",
"(",
"hass",
",",
"numato_fixture",
",",
"config",
")",
":",
"sensorports_cfg",
"=",
"config",
"[",
"\"numato\"",
"]",
"[",
"\"devices\"",
"]",
"[",
"0",
"]",
"[",
"\"sensors\"",
"]",
"[",
"\"ports\"",
"]",
... | [
97,
0
] | [
105,
37
] | python | en | ['en', 'en', 'en'] | True |
test_invalid_adc_source_range_length | (hass, numato_fixture, config) | Test validation of ADC range config's length.
Adds an element to the source range.
| Test validation of ADC range config's length. | async def test_invalid_adc_source_range_length(hass, numato_fixture, config):
"""Test validation of ADC range config's length.
Adds an element to the source range.
"""
sensorports_cfg = config["numato"]["devices"][0]["sensors"]["ports"]
sensorports_cfg["1"]["source_range"].append(42)
assert not... | [
"async",
"def",
"test_invalid_adc_source_range_length",
"(",
"hass",
",",
"numato_fixture",
",",
"config",
")",
":",
"sensorports_cfg",
"=",
"config",
"[",
"\"numato\"",
"]",
"[",
"\"devices\"",
"]",
"[",
"0",
"]",
"[",
"\"sensors\"",
"]",
"[",
"\"ports\"",
"]... | [
108,
0
] | [
116,
37
] | python | en | ['en', 'en', 'en'] | True |
test_invalid_adc_source_range_order | (hass, numato_fixture, config) | Test validation of ADC range config's order.
Sets the source range to a decreasing [2, 1].
| Test validation of ADC range config's order. | async def test_invalid_adc_source_range_order(hass, numato_fixture, config):
"""Test validation of ADC range config's order.
Sets the source range to a decreasing [2, 1].
"""
sensorports_cfg = config["numato"]["devices"][0]["sensors"]["ports"]
sensorports_cfg["1"]["source_range"] = [2, 1]
asser... | [
"async",
"def",
"test_invalid_adc_source_range_order",
"(",
"hass",
",",
"numato_fixture",
",",
"config",
")",
":",
"sensorports_cfg",
"=",
"config",
"[",
"\"numato\"",
"]",
"[",
"\"devices\"",
"]",
"[",
"0",
"]",
"[",
"\"sensors\"",
"]",
"[",
"\"ports\"",
"]"... | [
119,
0
] | [
127,
37
] | python | en | ['en', 'da', 'en'] | True |
test_invalid_adc_destination_range_value_type | (hass, numato_fixture, config) | Test validation of ADC range .
Replaces the destination range beginning by a string.
| Test validation of ADC range . | async def test_invalid_adc_destination_range_value_type(hass, numato_fixture, config):
"""Test validation of ADC range .
Replaces the destination range beginning by a string.
"""
sensorports_cfg = config["numato"]["devices"][0]["sensors"]["ports"]
sensorports_cfg["1"]["destination_range"][0] = "zer... | [
"async",
"def",
"test_invalid_adc_destination_range_value_type",
"(",
"hass",
",",
"numato_fixture",
",",
"config",
")",
":",
"sensorports_cfg",
"=",
"config",
"[",
"\"numato\"",
"]",
"[",
"\"devices\"",
"]",
"[",
"0",
"]",
"[",
"\"sensors\"",
"]",
"[",
"\"ports... | [
130,
0
] | [
138,
37
] | python | en | ['en', 'zu', 'en'] | True |
test_invalid_adc_destination_range_length | (hass, numato_fixture, config) | Test validation of ADC range config's length.
Adds an element to the destination range.
| Test validation of ADC range config's length. | async def test_invalid_adc_destination_range_length(hass, numato_fixture, config):
"""Test validation of ADC range config's length.
Adds an element to the destination range.
"""
sensorports_cfg = config["numato"]["devices"][0]["sensors"]["ports"]
sensorports_cfg["1"]["destination_range"].append(42)... | [
"async",
"def",
"test_invalid_adc_destination_range_length",
"(",
"hass",
",",
"numato_fixture",
",",
"config",
")",
":",
"sensorports_cfg",
"=",
"config",
"[",
"\"numato\"",
"]",
"[",
"\"devices\"",
"]",
"[",
"0",
"]",
"[",
"\"sensors\"",
"]",
"[",
"\"ports\"",... | [
141,
0
] | [
149,
37
] | python | en | ['en', 'en', 'en'] | True |
test_invalid_adc_destination_range_order | (hass, numato_fixture, config) | Test validation of ADC range config's order.
Sets the destination range to a decreasing [2, 1].
| Test validation of ADC range config's order. | async def test_invalid_adc_destination_range_order(hass, numato_fixture, config):
"""Test validation of ADC range config's order.
Sets the destination range to a decreasing [2, 1].
"""
sensorports_cfg = config["numato"]["devices"][0]["sensors"]["ports"]
sensorports_cfg["1"]["destination_range"] = [... | [
"async",
"def",
"test_invalid_adc_destination_range_order",
"(",
"hass",
",",
"numato_fixture",
",",
"config",
")",
":",
"sensorports_cfg",
"=",
"config",
"[",
"\"numato\"",
"]",
"[",
"\"devices\"",
"]",
"[",
"0",
"]",
"[",
"\"sensors\"",
"]",
"[",
"\"ports\"",
... | [
152,
0
] | [
160,
37
] | python | en | ['en', 'da', 'en'] | True |
mock_client_fixture | () | Mock the azure event hub producer client. | Mock the azure event hub producer client. | def mock_client_fixture():
"""Mock the azure event hub producer client."""
with patch(f"{PRODUCER_PATH}.send_batch") as mock_send_batch, patch(
f"{PRODUCER_PATH}.close"
) as mock_close, patch(f"{PRODUCER_PATH}.__init__", return_value=None) as mock_init:
yield (
mock_init,
... | [
"def",
"mock_client_fixture",
"(",
")",
":",
"with",
"patch",
"(",
"f\"{PRODUCER_PATH}.send_batch\"",
")",
"as",
"mock_send_batch",
",",
"patch",
"(",
"f\"{PRODUCER_PATH}.close\"",
")",
"as",
"mock_close",
",",
"patch",
"(",
"f\"{PRODUCER_PATH}.__init__\"",
",",
"retu... | [
29,
0
] | [
38,
9
] | python | en | ['en', 'en', 'en'] | True |
mock_batch_fixture | () | Mock batch creator and return mocked batch object. | Mock batch creator and return mocked batch object. | def mock_batch_fixture():
"""Mock batch creator and return mocked batch object."""
mock_batch = MagicMock()
with patch(f"{PRODUCER_PATH}.create_batch", return_value=mock_batch):
yield mock_batch | [
"def",
"mock_batch_fixture",
"(",
")",
":",
"mock_batch",
"=",
"MagicMock",
"(",
")",
"with",
"patch",
"(",
"f\"{PRODUCER_PATH}.create_batch\"",
",",
"return_value",
"=",
"mock_batch",
")",
":",
"yield",
"mock_batch"
] | [
42,
0
] | [
46,
24
] | python | en | ['en', 'cy', 'en'] | True |
mock_policy_fixture | () | Mock azure shared key credential. | Mock azure shared key credential. | def mock_policy_fixture():
"""Mock azure shared key credential."""
with patch(f"{AZURE_EVENT_HUB_PATH}.EventHubSharedKeyCredential") as policy:
yield policy | [
"def",
"mock_policy_fixture",
"(",
")",
":",
"with",
"patch",
"(",
"f\"{AZURE_EVENT_HUB_PATH}.EventHubSharedKeyCredential\"",
")",
"as",
"policy",
":",
"yield",
"policy"
] | [
50,
0
] | [
53,
20
] | python | da | ['eu', 'da', 'en'] | False |
mock_event_data_fixture | () | Mock the azure event data component. | Mock the azure event data component. | def mock_event_data_fixture():
"""Mock the azure event data component."""
with patch(f"{AZURE_EVENT_HUB_PATH}.EventData") as event_data:
yield event_data | [
"def",
"mock_event_data_fixture",
"(",
")",
":",
"with",
"patch",
"(",
"f\"{AZURE_EVENT_HUB_PATH}.EventData\"",
")",
"as",
"event_data",
":",
"yield",
"event_data"
] | [
57,
0
] | [
60,
24
] | python | en | ['en', 'en', 'en'] | True |
mock_call_later_fixture | () | Mock async_call_later to allow queue processing on demand. | Mock async_call_later to allow queue processing on demand. | def mock_call_later_fixture():
"""Mock async_call_later to allow queue processing on demand."""
with patch(f"{AZURE_EVENT_HUB_PATH}.async_call_later") as mock_call_later:
yield mock_call_later | [
"def",
"mock_call_later_fixture",
"(",
")",
":",
"with",
"patch",
"(",
"f\"{AZURE_EVENT_HUB_PATH}.async_call_later\"",
")",
"as",
"mock_call_later",
":",
"yield",
"mock_call_later"
] | [
64,
0
] | [
67,
29
] | python | en | ['en', 'en', 'en'] | True |
test_minimal_config | (hass) | Test the minimal config and defaults of component. | Test the minimal config and defaults of component. | async def test_minimal_config(hass):
"""Test the minimal config and defaults of component."""
config = {azure_event_hub.DOMAIN: MIN_CONFIG}
assert await async_setup_component(hass, azure_event_hub.DOMAIN, config) | [
"async",
"def",
"test_minimal_config",
"(",
"hass",
")",
":",
"config",
"=",
"{",
"azure_event_hub",
".",
"DOMAIN",
":",
"MIN_CONFIG",
"}",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"azure_event_hub",
".",
"DOMAIN",
",",
"config",
")"
] | [
70,
0
] | [
73,
76
] | python | en | ['en', 'en', 'en'] | True |
test_full_config | (hass) | Test the full config of component. | Test the full config of component. | async def test_full_config(hass):
"""Test the full config of component."""
config = {
azure_event_hub.DOMAIN: {
"send_interval": 10,
"max_delay": 10,
"filter": {
"include_domains": ["light"],
"include_entity_globs": ["sensor.included_*"... | [
"async",
"def",
"test_full_config",
"(",
"hass",
")",
":",
"config",
"=",
"{",
"azure_event_hub",
".",
"DOMAIN",
":",
"{",
"\"send_interval\"",
":",
"10",
",",
"\"max_delay\"",
":",
"10",
",",
"\"filter\"",
":",
"{",
"\"include_domains\"",
":",
"[",
"\"light... | [
76,
0
] | [
93,
76
] | python | en | ['en', 'en', 'en'] | True |
_setup | (hass, mock_call_later, filter_config) | Shared set up for filtering tests. | Shared set up for filtering tests. | async def _setup(hass, mock_call_later, filter_config):
"""Shared set up for filtering tests."""
config = {azure_event_hub.DOMAIN: {"filter": filter_config}}
config[azure_event_hub.DOMAIN].update(MIN_CONFIG)
assert await async_setup_component(hass, azure_event_hub.DOMAIN, config)
await hass.async_b... | [
"async",
"def",
"_setup",
"(",
"hass",
",",
"mock_call_later",
",",
"filter_config",
")",
":",
"config",
"=",
"{",
"azure_event_hub",
".",
"DOMAIN",
":",
"{",
"\"filter\"",
":",
"filter_config",
"}",
"}",
"config",
"[",
"azure_event_hub",
".",
"DOMAIN",
"]",... | [
96,
0
] | [
104,
42
] | python | en | ['en', 'da', 'en'] | True |
_run_filter_tests | (hass, tests, process_queue, mock_batch) | Run a series of filter tests on azure event hub. | Run a series of filter tests on azure event hub. | async def _run_filter_tests(hass, tests, process_queue, mock_batch):
"""Run a series of filter tests on azure event hub."""
for test in tests:
hass.states.async_set(test.id, STATE_ON)
await hass.async_block_till_done()
await process_queue(None)
if test.should_pass:
m... | [
"async",
"def",
"_run_filter_tests",
"(",
"hass",
",",
"tests",
",",
"process_queue",
",",
"mock_batch",
")",
":",
"for",
"test",
"in",
"tests",
":",
"hass",
".",
"states",
".",
"async_set",
"(",
"test",
".",
"id",
",",
"STATE_ON",
")",
"await",
"hass",
... | [
107,
0
] | [
118,
46
] | python | en | ['en', 'en', 'en'] | True |
test_allowlist | (hass, mock_batch, mock_call_later) | Test an allowlist only config. | Test an allowlist only config. | async def test_allowlist(hass, mock_batch, mock_call_later):
"""Test an allowlist only config."""
process_queue = await _setup(
hass,
mock_call_later,
{
"include_domains": ["light"],
"include_entity_globs": ["sensor.included_*"],
"include_entities": ["... | [
"async",
"def",
"test_allowlist",
"(",
"hass",
",",
"mock_batch",
",",
"mock_call_later",
")",
":",
"process_queue",
"=",
"await",
"_setup",
"(",
"hass",
",",
"mock_call_later",
",",
"{",
"\"include_domains\"",
":",
"[",
"\"light\"",
"]",
",",
"\"include_entity_... | [
121,
0
] | [
142,
67
] | python | en | ['en', 'lb', 'en'] | True |
test_denylist | (hass, mock_batch, mock_call_later) | Test a denylist only config. | Test a denylist only config. | async def test_denylist(hass, mock_batch, mock_call_later):
"""Test a denylist only config."""
process_queue = await _setup(
hass,
mock_call_later,
{
"exclude_domains": ["climate"],
"exclude_entity_globs": ["sensor.excluded_*"],
"exclude_entities": ["b... | [
"async",
"def",
"test_denylist",
"(",
"hass",
",",
"mock_batch",
",",
"mock_call_later",
")",
":",
"process_queue",
"=",
"await",
"_setup",
"(",
"hass",
",",
"mock_call_later",
",",
"{",
"\"exclude_domains\"",
":",
"[",
"\"climate\"",
"]",
",",
"\"exclude_entity... | [
145,
0
] | [
166,
67
] | python | en | ['en', 'en', 'en'] | True |
test_filtered_allowlist | (hass, mock_batch, mock_call_later) | Test an allowlist config with a filtering denylist. | Test an allowlist config with a filtering denylist. | async def test_filtered_allowlist(hass, mock_batch, mock_call_later):
"""Test an allowlist config with a filtering denylist."""
process_queue = await _setup(
hass,
mock_call_later,
{
"include_domains": ["light"],
"include_entity_globs": ["*.included_*"],
... | [
"async",
"def",
"test_filtered_allowlist",
"(",
"hass",
",",
"mock_batch",
",",
"mock_call_later",
")",
":",
"process_queue",
"=",
"await",
"_setup",
"(",
"hass",
",",
"mock_call_later",
",",
"{",
"\"include_domains\"",
":",
"[",
"\"light\"",
"]",
",",
"\"includ... | [
169,
0
] | [
191,
67
] | python | en | ['en', 'en', 'en'] | True |
test_filtered_denylist | (hass, mock_batch, mock_call_later) | Test a denylist config with a filtering allowlist. | Test a denylist config with a filtering allowlist. | async def test_filtered_denylist(hass, mock_batch, mock_call_later):
"""Test a denylist config with a filtering allowlist."""
process_queue = await _setup(
hass,
mock_call_later,
{
"include_entities": ["climate.included", "sensor.excluded_test"],
"exclude_domains"... | [
"async",
"def",
"test_filtered_denylist",
"(",
"hass",
",",
"mock_batch",
",",
"mock_call_later",
")",
":",
"process_queue",
"=",
"await",
"_setup",
"(",
"hass",
",",
"mock_call_later",
",",
"{",
"\"include_entities\"",
":",
"[",
"\"climate.included\"",
",",
"\"se... | [
194,
0
] | [
216,
67
] | python | en | ['en', 'en', 'en'] | True |
geometry_2_bokeh_format | (geometry: base, coord_output_format: str = "xy") |
geometry_2_bokeh_format
To convert the geometry to display it with the bokeh library
:type geometry: shapely.geometry.*
:type coord_output_format: str, default: xy (x or y)
:return: float or list of tuple
|
geometry_2_bokeh_format | def geometry_2_bokeh_format(geometry: base, coord_output_format: str = "xy") -> List:
"""
geometry_2_bokeh_format
To convert the geometry to display it with the bokeh library
:type geometry: shapely.geometry.*
:type coord_output_format: str, default: xy (x or y)
:return: float or list of tupl... | [
"def",
"geometry_2_bokeh_format",
"(",
"geometry",
":",
"base",
",",
"coord_output_format",
":",
"str",
"=",
"\"xy\"",
")",
"->",
"List",
":",
"assert",
"coord_output_format",
"in",
"[",
"\"xy\"",
",",
"\"x\"",
",",
"\"y\"",
"]",
",",
"f\"coordinates output form... | [
22,
0
] | [
72,
23
] | python | en | ['en', 'error', 'th'] | False |
wkt_to_gpd | (geom_wkt: str, geom_epsg: int = 3857) |
wkt_to_gpd
To convert a wkt into a geodataframe
:type geom_wkt: str
:type geom_epsg: int
:return: float or list of tuple
|
wkt_to_gpd | def wkt_to_gpd(geom_wkt: str, geom_epsg: int = 3857) -> gpd.GeoDataFrame:
"""
wkt_to_gpd
To convert a wkt into a geodataframe
:type geom_wkt: str
:type geom_epsg: int
:return: float or list of tuple
"""
df = pd.DataFrame([{
"geometry": loads(geom_wkt),
}])
geometry = d... | [
"def",
"wkt_to_gpd",
"(",
"geom_wkt",
":",
"str",
",",
"geom_epsg",
":",
"int",
"=",
"3857",
")",
"->",
"gpd",
".",
"GeoDataFrame",
":",
"df",
"=",
"pd",
".",
"DataFrame",
"(",
"[",
"{",
"\"geometry\"",
":",
"loads",
"(",
"geom_wkt",
")",
",",
"}",
... | [
75,
0
] | [
96,
5
] | python | en | ['en', 'error', 'th'] | False |
check_multilinestring_continuity | (input_geometry: Union[LineString, MultiLineString]) |
check_if_multilinestring_is_not_continuous
If multilinestring continuity is not valid, we convert all of its elements to linestring, in order to display them
correctly on bokeh
:type input_geometry: shapely.geometry.lineString or shapely.geometry.MultiLineString
:return: list of shapely.geometry... |
check_if_multilinestring_is_not_continuous | def check_multilinestring_continuity(input_geometry: Union[LineString, MultiLineString]) -> list:
"""
check_if_multilinestring_is_not_continuous
If multilinestring continuity is not valid, we convert all of its elements to linestring, in order to display them
correctly on bokeh
:type input_geometr... | [
"def",
"check_multilinestring_continuity",
"(",
"input_geometry",
":",
"Union",
"[",
"LineString",
",",
"MultiLineString",
"]",
")",
"->",
"list",
":",
"if",
"isinstance",
"(",
"input_geometry",
",",
"MultiLineString",
")",
":",
"dict_line",
"=",
"{",
"key",
":"... | [
99,
0
] | [
122,
27
] | python | en | ['en', 'error', 'th'] | False |
test_cpu_vulns_meltdown_exp1 | () |
Here test the examples cause expections
|
Here test the examples cause expections
| def test_cpu_vulns_meltdown_exp1():
"""
Here test the examples cause expections
"""
with pytest.raises(SkipException) as sc1:
CpuVulns(context_wrap('', path='/sys/devices/system/cpu/vulnerabilities/meltdown'))
assert "Input content is empty" in str(sc1) | [
"def",
"test_cpu_vulns_meltdown_exp1",
"(",
")",
":",
"with",
"pytest",
".",
"raises",
"(",
"SkipException",
")",
"as",
"sc1",
":",
"CpuVulns",
"(",
"context_wrap",
"(",
"''",
",",
"path",
"=",
"'/sys/devices/system/cpu/vulnerabilities/meltdown'",
")",
")",
"asser... | [
76,
0
] | [
82,
47
] | python | en | ['en', 'error', 'th'] | False |
test_cpu_vulns_spec_store_bypass_exp1 | () |
Here test the examples cause expections
|
Here test the examples cause expections
| def test_cpu_vulns_spec_store_bypass_exp1():
"""
Here test the examples cause expections
"""
with pytest.raises(SkipException) as sc1:
CpuVulns(context_wrap('', path='meltdown'))
assert "Input content is empty" in str(sc1) | [
"def",
"test_cpu_vulns_spec_store_bypass_exp1",
"(",
")",
":",
"with",
"pytest",
".",
"raises",
"(",
"SkipException",
")",
"as",
"sc1",
":",
"CpuVulns",
"(",
"context_wrap",
"(",
"''",
",",
"path",
"=",
"'meltdown'",
")",
")",
"assert",
"\"Input content is empty... | [
104,
0
] | [
110,
47
] | python | en | ['en', 'error', 'th'] | False |
test_cpu_vulns_spectre_v1_exp1 | () |
Here test the examples cause expections
|
Here test the examples cause expections
| def test_cpu_vulns_spectre_v1_exp1():
"""
Here test the examples cause expections
"""
with pytest.raises(SkipException) as sc1:
CpuVulns(context_wrap(''))
assert "Input content is empty" in str(sc1) | [
"def",
"test_cpu_vulns_spectre_v1_exp1",
"(",
")",
":",
"with",
"pytest",
".",
"raises",
"(",
"SkipException",
")",
"as",
"sc1",
":",
"CpuVulns",
"(",
"context_wrap",
"(",
"''",
")",
")",
"assert",
"\"Input content is empty\"",
"in",
"str",
"(",
"sc1",
")"
] | [
120,
0
] | [
126,
47
] | python | en | ['en', 'error', 'th'] | False |
test_cpu_vulns_spectre_v2_rhel7 | () |
Here test the examples for spectre_v2
|
Here test the examples for spectre_v2
| def test_cpu_vulns_spectre_v2_rhel7():
"""
Here test the examples for spectre_v2
"""
spectre = CpuVulns(context_wrap(INPUT_SPECTRE_V2_RHEL_7, path='/sys/devices/system/cpu/vulnerabilities/spectre_v2'))
assert spectre.value == INPUT_SPECTRE_V2_RHEL_7
assert spectre.file_name == 'spectre_v2' | [
"def",
"test_cpu_vulns_spectre_v2_rhel7",
"(",
")",
":",
"spectre",
"=",
"CpuVulns",
"(",
"context_wrap",
"(",
"INPUT_SPECTRE_V2_RHEL_7",
",",
"path",
"=",
"'/sys/devices/system/cpu/vulnerabilities/spectre_v2'",
")",
")",
"assert",
"spectre",
".",
"value",
"==",
"INPUT_... | [
130,
0
] | [
136,
44
] | python | en | ['en', 'error', 'th'] | False |
test_cpu_vulns_spectre_v2_rhel6 | () |
Here test the examples for spectre_v2
|
Here test the examples for spectre_v2
| def test_cpu_vulns_spectre_v2_rhel6():
"""
Here test the examples for spectre_v2
"""
spectre = CpuVulns(context_wrap(INPUT_SPECTRE_V2_RHEL_6, path='/sys/devices/system/cpu/vulnerabilities/spectre_v2'))
assert spectre.value == INPUT_SPECTRE_V2_RHEL_6
assert spectre.file_name == 'spectre_v2' | [
"def",
"test_cpu_vulns_spectre_v2_rhel6",
"(",
")",
":",
"spectre",
"=",
"CpuVulns",
"(",
"context_wrap",
"(",
"INPUT_SPECTRE_V2_RHEL_6",
",",
"path",
"=",
"'/sys/devices/system/cpu/vulnerabilities/spectre_v2'",
")",
")",
"assert",
"spectre",
".",
"value",
"==",
"INPUT_... | [
139,
0
] | [
145,
44
] | python | en | ['en', 'error', 'th'] | False |
test_cpu_vulns_spectre_v2_exp1 | () |
Here test the examples cause expections
|
Here test the examples cause expections
| def test_cpu_vulns_spectre_v2_exp1():
"""
Here test the examples cause expections
"""
with pytest.raises(SkipException) as sc1:
CpuVulns(context_wrap(''))
assert "Input content is empty" in str(sc1) | [
"def",
"test_cpu_vulns_spectre_v2_exp1",
"(",
")",
":",
"with",
"pytest",
".",
"raises",
"(",
"SkipException",
")",
"as",
"sc1",
":",
"CpuVulns",
"(",
"context_wrap",
"(",
"''",
")",
")",
"assert",
"\"Input content is empty\"",
"in",
"str",
"(",
"sc1",
")"
] | [
148,
0
] | [
154,
47
] | python | en | ['en', 'error', 'th'] | False |
test_cpu_vulns_documentation | () |
Here we test the examples in the documentation automatically using doctest.
We set up an environment which is similar to what a rule writer might see -
a '/sys/devices/system/cpu/vulnerabilities/*' output that has been
passed in as a parameter to the rule declaration.
|
Here we test the examples in the documentation automatically using doctest.
We set up an environment which is similar to what a rule writer might see -
a '/sys/devices/system/cpu/vulnerabilities/*' output that has been
passed in as a parameter to the rule declaration.
| def test_cpu_vulns_documentation():
"""
Here we test the examples in the documentation automatically using doctest.
We set up an environment which is similar to what a rule writer might see -
a '/sys/devices/system/cpu/vulnerabilities/*' output that has been
passed in as a parameter to the rule decl... | [
"def",
"test_cpu_vulns_documentation",
"(",
")",
":",
"env",
"=",
"{",
"'sp_v1'",
":",
"CpuVulns",
"(",
"context_wrap",
"(",
"INPUT_SPECTRE_V1",
",",
"path",
"=",
"'/sys/devices/system/cpu/vulnerabilities/spectre_v1'",
")",
")",
",",
"'sp_v2'",
":",
"CpuVulns",
"(",... | [
157,
0
] | [
175,
22
] | python | en | ['en', 'error', 'th'] | False |
async_setup_entry | (
hass: HomeAssistant,
entry: ConfigEntry,
async_add_entities: AddEntitiesCallback,
) | Set up the sensor config entry. | Set up the sensor config entry. | async def async_setup_entry(
hass: HomeAssistant,
entry: ConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the sensor config entry."""
controller_data = get_controller_data(hass, entry)
async_add_entities(
[
VeraSensor(device, controller_data)
... | [
"async",
"def",
"async_setup_entry",
"(",
"hass",
":",
"HomeAssistant",
",",
"entry",
":",
"ConfigEntry",
",",
"async_add_entities",
":",
"AddEntitiesCallback",
",",
")",
"->",
"None",
":",
"controller_data",
"=",
"get_controller_data",
"(",
"hass",
",",
"entry",
... | [
25,
0
] | [
38,
5
] | python | en | ['en', 'pt', 'en'] | True |
VeraSensor.__init__ | (
self, vera_device: veraApi.VeraSensor, controller_data: ControllerData
) | Initialize the sensor. | Initialize the sensor. | def __init__(
self, vera_device: veraApi.VeraSensor, controller_data: ControllerData
) -> None:
"""Initialize the sensor."""
self.current_value = None
self._temperature_units = None
self.last_changed_time = None
VeraDevice.__init__(self, vera_device, controller_data)
... | [
"def",
"__init__",
"(",
"self",
",",
"vera_device",
":",
"veraApi",
".",
"VeraSensor",
",",
"controller_data",
":",
"ControllerData",
")",
"->",
"None",
":",
"self",
".",
"current_value",
"=",
"None",
"self",
".",
"_temperature_units",
"=",
"None",
"self",
"... | [
44,
4
] | [
52,
62
] | python | en | ['en', 'en', 'en'] | True |
VeraSensor.native_value | (self) | Return the name of the sensor. | Return the name of the sensor. | def native_value(self) -> str:
"""Return the name of the sensor."""
return self.current_value | [
"def",
"native_value",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"current_value"
] | [
55,
4
] | [
57,
33
] | python | en | ['en', 'mi', 'en'] | True |
VeraSensor.native_unit_of_measurement | (self) | Return the unit of measurement of this entity, if any. | Return the unit of measurement of this entity, if any. | def native_unit_of_measurement(self) -> str | None:
"""Return the unit of measurement of this entity, if any."""
if self.vera_device.category == veraApi.CATEGORY_TEMPERATURE_SENSOR:
return self._temperature_units
if self.vera_device.category == veraApi.CATEGORY_LIGHT_SENSOR:
... | [
"def",
"native_unit_of_measurement",
"(",
"self",
")",
"->",
"str",
"|",
"None",
":",
"if",
"self",
".",
"vera_device",
".",
"category",
"==",
"veraApi",
".",
"CATEGORY_TEMPERATURE_SENSOR",
":",
"return",
"self",
".",
"_temperature_units",
"if",
"self",
".",
"... | [
60,
4
] | [
72,
26
] | python | en | ['en', 'en', 'en'] | True |
VeraSensor.update | (self) | Update the state. | Update the state. | def update(self) -> None:
"""Update the state."""
super().update()
if self.vera_device.category == veraApi.CATEGORY_TEMPERATURE_SENSOR:
self.current_value = self.vera_device.temperature
vera_temp_units = self.vera_device.vera_controller.temperature_units
if ... | [
"def",
"update",
"(",
"self",
")",
"->",
"None",
":",
"super",
"(",
")",
".",
"update",
"(",
")",
"if",
"self",
".",
"vera_device",
".",
"category",
"==",
"veraApi",
".",
"CATEGORY_TEMPERATURE_SENSOR",
":",
"self",
".",
"current_value",
"=",
"self",
".",... | [
74,
4
] | [
109,
42
] | python | en | ['en', 'en', 'en'] | True |
async_setup_entry | (hass, config_entry, async_add_entities) | Set up the Zigbee Home Automation alarm control panel from config entry. | Set up the Zigbee Home Automation alarm control panel from config entry. | async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up the Zigbee Home Automation alarm control panel from config entry."""
entities_to_create = hass.data[DATA_ZHA][DOMAIN]
unsub = async_dispatcher_connect(
hass,
SIGNAL_ADD_ENTITIES,
functools.partial(
... | [
"async",
"def",
"async_setup_entry",
"(",
"hass",
",",
"config_entry",
",",
"async_add_entities",
")",
":",
"entities_to_create",
"=",
"hass",
".",
"data",
"[",
"DATA_ZHA",
"]",
"[",
"DOMAIN",
"]",
"unsub",
"=",
"async_dispatcher_connect",
"(",
"hass",
",",
"S... | [
60,
0
] | [
71,
59
] | python | en | ['en', 'en', 'en'] | True |
configured_servers | (hass) | Return a set of the configured servers. | Return a set of the configured servers. | def configured_servers(hass):
"""Return a set of the configured servers."""
return {
entry.data[CONF_NAME] for entry in hass.config_entries.async_entries(DOMAIN)
} | [
"def",
"configured_servers",
"(",
"hass",
")",
":",
"return",
"{",
"entry",
".",
"data",
"[",
"CONF_NAME",
"]",
"for",
"entry",
"in",
"hass",
".",
"config_entries",
".",
"async_entries",
"(",
"DOMAIN",
")",
"}"
] | [
11,
0
] | [
15,
5
] | python | en | ['en', 'en', 'en'] | True |
EmulatedRokuFlowHandler.async_step_user | (self, user_input=None) | Handle a flow initialized by the user. | Handle a flow initialized by the user. | async def async_step_user(self, user_input=None):
"""Handle a flow initialized by the user."""
errors = {}
if user_input is not None:
self._async_abort_entries_match({CONF_NAME: user_input[CONF_NAME]})
return self.async_create_entry(title=user_input[CONF_NAME], data=user... | [
"async",
"def",
"async_step_user",
"(",
"self",
",",
"user_input",
"=",
"None",
")",
":",
"errors",
"=",
"{",
"}",
"if",
"user_input",
"is",
"not",
"None",
":",
"self",
".",
"_async_abort_entries_match",
"(",
"{",
"CONF_NAME",
":",
"user_input",
"[",
"CONF... | [
23,
4
] | [
51,
9
] | python | en | ['en', 'en', 'en'] | True |
EmulatedRokuFlowHandler.async_step_import | (self, import_config) | Handle a flow import. | Handle a flow import. | async def async_step_import(self, import_config):
"""Handle a flow import."""
return await self.async_step_user(import_config) | [
"async",
"def",
"async_step_import",
"(",
"self",
",",
"import_config",
")",
":",
"return",
"await",
"self",
".",
"async_step_user",
"(",
"import_config",
")"
] | [
53,
4
] | [
55,
56
] | python | en | ['en', 'fr', 'en'] | True |
setup_integration | (
hass: HomeAssistant,
) | Mock ConfigEntry in Home Assistant. | Mock ConfigEntry in Home Assistant. | async def setup_integration(
hass: HomeAssistant,
) -> MockConfigEntry:
"""Mock ConfigEntry in Home Assistant."""
entry = MockConfigEntry(
domain=DOMAIN,
unique_id=WILIGHT_ID,
data={
CONF_HOST: HOST,
CONF_SERIAL_NUMBER: UPNP_SERIAL,
CONF_MODEL_NAM... | [
"async",
"def",
"setup_integration",
"(",
"hass",
":",
"HomeAssistant",
",",
")",
"->",
"MockConfigEntry",
":",
"entry",
"=",
"MockConfigEntry",
"(",
"domain",
"=",
"DOMAIN",
",",
"unique_id",
"=",
"WILIGHT_ID",
",",
"data",
"=",
"{",
"CONF_HOST",
":",
"HOST... | [
59,
0
] | [
79,
16
] | python | en | ['en', 'en', 'en'] | True |
test_flow_non_encrypted | (hass) | Test flow without encryption. | Test flow without encryption. | async def test_flow_non_encrypted(hass):
"""Test flow without encryption."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
assert result["type"] == "form"
assert result["step_id"] == "user"
mock_remote = get_mock_remote(en... | [
"async",
"def",
"test_flow_non_encrypted",
"(",
"hass",
")",
":",
"result",
"=",
"await",
"hass",
".",
"config_entries",
".",
"flow",
".",
"async_init",
"(",
"DOMAIN",
",",
"context",
"=",
"{",
"\"source\"",
":",
"config_entries",
".",
"SOURCE_USER",
"}",
")... | [
25,
0
] | [
48,
85
] | python | en | ['en', 'en', 'en'] | True |
test_flow_not_connected_error | (hass) | Test flow with connection error. | Test flow with connection error. | async def test_flow_not_connected_error(hass):
"""Test flow with connection error."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
assert result["type"] == "form"
assert result["step_id"] == "user"
with patch(
"ho... | [
"async",
"def",
"test_flow_not_connected_error",
"(",
"hass",
")",
":",
"result",
"=",
"await",
"hass",
".",
"config_entries",
".",
"flow",
".",
"async_init",
"(",
"DOMAIN",
",",
"context",
"=",
"{",
"\"source\"",
":",
"config_entries",
".",
"SOURCE_USER",
"}"... | [
51,
0
] | [
72,
57
] | python | en | ['en', 'en', 'en'] | True |
test_flow_unknown_abort | (hass) | Test flow with unknown error abortion. | Test flow with unknown error abortion. | async def test_flow_unknown_abort(hass):
"""Test flow with unknown error abortion."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
assert result["type"] == "form"
assert result["step_id"] == "user"
with patch(
"ho... | [
"async",
"def",
"test_flow_unknown_abort",
"(",
"hass",
")",
":",
"result",
"=",
"await",
"hass",
".",
"config_entries",
".",
"flow",
".",
"async_init",
"(",
"DOMAIN",
",",
"context",
"=",
"{",
"\"source\"",
":",
"config_entries",
".",
"SOURCE_USER",
"}",
")... | [
75,
0
] | [
95,
40
] | python | en | ['en', 'de', 'en'] | True |
test_flow_encrypted_not_connected_pin_code_request | (hass) | Test flow with encryption and PIN code request connection error abortion during pairing request step. | Test flow with encryption and PIN code request connection error abortion during pairing request step. | async def test_flow_encrypted_not_connected_pin_code_request(hass):
"""Test flow with encryption and PIN code request connection error abortion during pairing request step."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
assert re... | [
"async",
"def",
"test_flow_encrypted_not_connected_pin_code_request",
"(",
"hass",
")",
":",
"result",
"=",
"await",
"hass",
".",
"config_entries",
".",
"flow",
".",
"async_init",
"(",
"DOMAIN",
",",
"context",
"=",
"{",
"\"source\"",
":",
"config_entries",
".",
... | [
98,
0
] | [
120,
47
] | python | en | ['en', 'en', 'en'] | True |
test_flow_encrypted_unknown_pin_code_request | (hass) | Test flow with encryption and PIN code request unknown error abortion during pairing request step. | Test flow with encryption and PIN code request unknown error abortion during pairing request step. | async def test_flow_encrypted_unknown_pin_code_request(hass):
"""Test flow with encryption and PIN code request unknown error abortion during pairing request step."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
assert result["typ... | [
"async",
"def",
"test_flow_encrypted_unknown_pin_code_request",
"(",
"hass",
")",
":",
"result",
"=",
"await",
"hass",
".",
"config_entries",
".",
"flow",
".",
"async_init",
"(",
"DOMAIN",
",",
"context",
"=",
"{",
"\"source\"",
":",
"config_entries",
".",
"SOUR... | [
123,
0
] | [
145,
40
] | python | en | ['en', 'en', 'en'] | True |
test_flow_encrypted_valid_pin_code | (hass) | Test flow with encryption and valid PIN code. | Test flow with encryption and valid PIN code. | async def test_flow_encrypted_valid_pin_code(hass):
"""Test flow with encryption and valid PIN code."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
assert result["type"] == "form"
assert result["step_id"] == "user"
mock_... | [
"async",
"def",
"test_flow_encrypted_valid_pin_code",
"(",
"hass",
")",
":",
"result",
"=",
"await",
"hass",
".",
"config_entries",
".",
"flow",
".",
"async_init",
"(",
"DOMAIN",
",",
"context",
"=",
"{",
"\"source\"",
":",
"config_entries",
".",
"SOURCE_USER",
... | [
148,
0
] | [
187,
5
] | python | en | ['en', 'en', 'en'] | True |
test_flow_encrypted_invalid_pin_code_error | (hass) | Test flow with encryption and invalid PIN code error during pairing step. | Test flow with encryption and invalid PIN code error during pairing step. | async def test_flow_encrypted_invalid_pin_code_error(hass):
"""Test flow with encryption and invalid PIN code error during pairing step."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
assert result["type"] == "form"
assert re... | [
"async",
"def",
"test_flow_encrypted_invalid_pin_code_error",
"(",
"hass",
")",
":",
"result",
"=",
"await",
"hass",
".",
"config_entries",
".",
"flow",
".",
"async_init",
"(",
"DOMAIN",
",",
"context",
"=",
"{",
"\"source\"",
":",
"config_entries",
".",
"SOURCE... | [
190,
0
] | [
225,
63
] | python | en | ['en', 'en', 'en'] | True |
test_flow_encrypted_not_connected_abort | (hass) | Test flow with encryption and PIN code connection error abortion during pairing step. | Test flow with encryption and PIN code connection error abortion during pairing step. | async def test_flow_encrypted_not_connected_abort(hass):
"""Test flow with encryption and PIN code connection error abortion during pairing step."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
assert result["type"] == "form"
... | [
"async",
"def",
"test_flow_encrypted_not_connected_abort",
"(",
"hass",
")",
":",
"result",
"=",
"await",
"hass",
".",
"config_entries",
".",
"flow",
".",
"async_init",
"(",
"DOMAIN",
",",
"context",
"=",
"{",
"\"source\"",
":",
"config_entries",
".",
"SOURCE_US... | [
228,
0
] | [
258,
47
] | python | en | ['en', 'en', 'en'] | True |
test_flow_encrypted_unknown_abort | (hass) | Test flow with encryption and PIN code unknown error abortion during pairing step. | Test flow with encryption and PIN code unknown error abortion during pairing step. | async def test_flow_encrypted_unknown_abort(hass):
"""Test flow with encryption and PIN code unknown error abortion during pairing step."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
assert result["type"] == "form"
assert re... | [
"async",
"def",
"test_flow_encrypted_unknown_abort",
"(",
"hass",
")",
":",
"result",
"=",
"await",
"hass",
".",
"config_entries",
".",
"flow",
".",
"async_init",
"(",
"DOMAIN",
",",
"context",
"=",
"{",
"\"source\"",
":",
"config_entries",
".",
"SOURCE_USER",
... | [
261,
0
] | [
291,
40
] | python | en | ['en', 'en', 'en'] | True |
test_flow_non_encrypted_already_configured_abort | (hass) | Test flow without encryption and existing config entry abortion. | Test flow without encryption and existing config entry abortion. | async def test_flow_non_encrypted_already_configured_abort(hass):
"""Test flow without encryption and existing config entry abortion."""
MockConfigEntry(
domain=DOMAIN,
unique_id="0.0.0.0",
data=MOCK_CONFIG_DATA,
).add_to_hass(hass)
result = await hass.config_entries.flow.async... | [
"async",
"def",
"test_flow_non_encrypted_already_configured_abort",
"(",
"hass",
")",
":",
"MockConfigEntry",
"(",
"domain",
"=",
"DOMAIN",
",",
"unique_id",
"=",
"\"0.0.0.0\"",
",",
"data",
"=",
"MOCK_CONFIG_DATA",
",",
")",
".",
"add_to_hass",
"(",
"hass",
")",
... | [
294,
0
] | [
310,
51
] | python | en | ['en', 'en', 'en'] | True |
test_flow_encrypted_already_configured_abort | (hass) | Test flow with encryption and existing config entry abortion. | Test flow with encryption and existing config entry abortion. | async def test_flow_encrypted_already_configured_abort(hass):
"""Test flow with encryption and existing config entry abortion."""
MockConfigEntry(
domain=DOMAIN,
unique_id="0.0.0.0",
data={**MOCK_CONFIG_DATA, **MOCK_ENCRYPTION_DATA},
).add_to_hass(hass)
result = await hass.conf... | [
"async",
"def",
"test_flow_encrypted_already_configured_abort",
"(",
"hass",
")",
":",
"MockConfigEntry",
"(",
"domain",
"=",
"DOMAIN",
",",
"unique_id",
"=",
"\"0.0.0.0\"",
",",
"data",
"=",
"{",
"*",
"*",
"MOCK_CONFIG_DATA",
",",
"*",
"*",
"MOCK_ENCRYPTION_DATA"... | [
313,
0
] | [
329,
51
] | python | en | ['en', 'en', 'en'] | True |
test_imported_flow_non_encrypted | (hass) | Test imported flow without encryption. | Test imported flow without encryption. | async def test_imported_flow_non_encrypted(hass):
"""Test imported flow without encryption."""
mock_remote = get_mock_remote(encrypted=False)
with patch(
"homeassistant.components.panasonic_viera.config_flow.RemoteControl",
return_value=mock_remote,
):
result = await hass.confi... | [
"async",
"def",
"test_imported_flow_non_encrypted",
"(",
"hass",
")",
":",
"mock_remote",
"=",
"get_mock_remote",
"(",
"encrypted",
"=",
"False",
")",
"with",
"patch",
"(",
"\"homeassistant.components.panasonic_viera.config_flow.RemoteControl\"",
",",
"return_value",
"=",
... | [
332,
0
] | [
349,
85
] | python | en | ['en', 'en', 'en'] | True |
test_imported_flow_encrypted_valid_pin_code | (hass) | Test imported flow with encryption and valid PIN code. | Test imported flow with encryption and valid PIN code. | async def test_imported_flow_encrypted_valid_pin_code(hass):
"""Test imported flow with encryption and valid PIN code."""
mock_remote = get_mock_remote(
encrypted=True,
app_id="mock-app-id",
encryption_key="mock-encryption-key",
)
with patch(
"homeassistant.components.p... | [
"async",
"def",
"test_imported_flow_encrypted_valid_pin_code",
"(",
"hass",
")",
":",
"mock_remote",
"=",
"get_mock_remote",
"(",
"encrypted",
"=",
"True",
",",
"app_id",
"=",
"\"mock-app-id\"",
",",
"encryption_key",
"=",
"\"mock-encryption-key\"",
",",
")",
"with",
... | [
352,
0
] | [
385,
5
] | python | en | ['en', 'en', 'en'] | True |
test_imported_flow_encrypted_invalid_pin_code_error | (hass) | Test imported flow with encryption and invalid PIN code error during pairing step. | Test imported flow with encryption and invalid PIN code error during pairing step. | async def test_imported_flow_encrypted_invalid_pin_code_error(hass):
"""Test imported flow with encryption and invalid PIN code error during pairing step."""
mock_remote = get_mock_remote(encrypted=True, authorize_error=SOAPError)
with patch(
"homeassistant.components.panasonic_viera.config_flow.R... | [
"async",
"def",
"test_imported_flow_encrypted_invalid_pin_code_error",
"(",
"hass",
")",
":",
"mock_remote",
"=",
"get_mock_remote",
"(",
"encrypted",
"=",
"True",
",",
"authorize_error",
"=",
"SOAPError",
")",
"with",
"patch",
"(",
"\"homeassistant.components.panasonic_v... | [
388,
0
] | [
417,
63
] | python | en | ['en', 'en', 'en'] | True |
test_imported_flow_encrypted_not_connected_abort | (hass) | Test imported flow with encryption and PIN code connection error abortion during pairing step. | Test imported flow with encryption and PIN code connection error abortion during pairing step. | async def test_imported_flow_encrypted_not_connected_abort(hass):
"""Test imported flow with encryption and PIN code connection error abortion during pairing step."""
mock_remote = get_mock_remote(encrypted=True, authorize_error=TimeoutError)
with patch(
"homeassistant.components.panasonic_viera.c... | [
"async",
"def",
"test_imported_flow_encrypted_not_connected_abort",
"(",
"hass",
")",
":",
"mock_remote",
"=",
"get_mock_remote",
"(",
"encrypted",
"=",
"True",
",",
"authorize_error",
"=",
"TimeoutError",
")",
"with",
"patch",
"(",
"\"homeassistant.components.panasonic_v... | [
420,
0
] | [
444,
47
] | python | en | ['en', 'en', 'en'] | True |
test_imported_flow_encrypted_unknown_abort | (hass) | Test imported flow with encryption and PIN code unknown error abortion during pairing step. | Test imported flow with encryption and PIN code unknown error abortion during pairing step. | async def test_imported_flow_encrypted_unknown_abort(hass):
"""Test imported flow with encryption and PIN code unknown error abortion during pairing step."""
mock_remote = get_mock_remote(encrypted=True, authorize_error=Exception)
with patch(
"homeassistant.components.panasonic_viera.config_flow.R... | [
"async",
"def",
"test_imported_flow_encrypted_unknown_abort",
"(",
"hass",
")",
":",
"mock_remote",
"=",
"get_mock_remote",
"(",
"encrypted",
"=",
"True",
",",
"authorize_error",
"=",
"Exception",
")",
"with",
"patch",
"(",
"\"homeassistant.components.panasonic_viera.conf... | [
447,
0
] | [
471,
40
] | python | en | ['en', 'en', 'en'] | True |
test_imported_flow_not_connected_error | (hass) | Test imported flow with connection error abortion. | Test imported flow with connection error abortion. | async def test_imported_flow_not_connected_error(hass):
"""Test imported flow with connection error abortion."""
with patch(
"homeassistant.components.panasonic_viera.config_flow.RemoteControl",
side_effect=TimeoutError,
):
result = await hass.config_entries.flow.async_init(
... | [
"async",
"def",
"test_imported_flow_not_connected_error",
"(",
"hass",
")",
":",
"with",
"patch",
"(",
"\"homeassistant.components.panasonic_viera.config_flow.RemoteControl\"",
",",
"side_effect",
"=",
"TimeoutError",
",",
")",
":",
"result",
"=",
"await",
"hass",
".",
... | [
474,
0
] | [
489,
57
] | python | en | ['en', 'en', 'en'] | True |
test_imported_flow_unknown_abort | (hass) | Test imported flow with unknown error abortion. | Test imported flow with unknown error abortion. | async def test_imported_flow_unknown_abort(hass):
"""Test imported flow with unknown error abortion."""
with patch(
"homeassistant.components.panasonic_viera.config_flow.RemoteControl",
side_effect=Exception,
):
result = await hass.config_entries.flow.async_init(
DOMAIN,... | [
"async",
"def",
"test_imported_flow_unknown_abort",
"(",
"hass",
")",
":",
"with",
"patch",
"(",
"\"homeassistant.components.panasonic_viera.config_flow.RemoteControl\"",
",",
"side_effect",
"=",
"Exception",
",",
")",
":",
"result",
"=",
"await",
"hass",
".",
"config_e... | [
492,
0
] | [
506,
40
] | python | en | ['en', 'en', 'en'] | True |
test_imported_flow_non_encrypted_already_configured_abort | (hass) | Test imported flow without encryption and existing config entry abortion. | Test imported flow without encryption and existing config entry abortion. | async def test_imported_flow_non_encrypted_already_configured_abort(hass):
"""Test imported flow without encryption and existing config entry abortion."""
MockConfigEntry(
domain=DOMAIN,
unique_id="0.0.0.0",
data=MOCK_CONFIG_DATA,
).add_to_hass(hass)
result = await hass.config_... | [
"async",
"def",
"test_imported_flow_non_encrypted_already_configured_abort",
"(",
"hass",
")",
":",
"MockConfigEntry",
"(",
"domain",
"=",
"DOMAIN",
",",
"unique_id",
"=",
"\"0.0.0.0\"",
",",
"data",
"=",
"MOCK_CONFIG_DATA",
",",
")",
".",
"add_to_hass",
"(",
"hass"... | [
509,
0
] | [
525,
51
] | python | en | ['en', 'en', 'en'] | True |
test_imported_flow_encrypted_already_configured_abort | (hass) | Test imported flow with encryption and existing config entry abortion. | Test imported flow with encryption and existing config entry abortion. | async def test_imported_flow_encrypted_already_configured_abort(hass):
"""Test imported flow with encryption and existing config entry abortion."""
MockConfigEntry(
domain=DOMAIN,
unique_id="0.0.0.0",
data={**MOCK_CONFIG_DATA, **MOCK_ENCRYPTION_DATA},
).add_to_hass(hass)
result... | [
"async",
"def",
"test_imported_flow_encrypted_already_configured_abort",
"(",
"hass",
")",
":",
"MockConfigEntry",
"(",
"domain",
"=",
"DOMAIN",
",",
"unique_id",
"=",
"\"0.0.0.0\"",
",",
"data",
"=",
"{",
"*",
"*",
"MOCK_CONFIG_DATA",
",",
"*",
"*",
"MOCK_ENCRYPT... | [
528,
0
] | [
544,
51
] | python | en | ['en', 'en', 'en'] | True |
test_lovelace_from_storage | (hass, hass_ws_client, hass_storage) | Test we load lovelace config from storage. | Test we load lovelace config from storage. | async def test_lovelace_from_storage(hass, hass_ws_client, hass_storage):
"""Test we load lovelace config from storage."""
assert await async_setup_component(hass, "lovelace", {})
assert hass.data[frontend.DATA_PANELS]["lovelace"].config == {"mode": "storage"}
client = await hass_ws_client(hass)
#... | [
"async",
"def",
"test_lovelace_from_storage",
"(",
"hass",
",",
"hass_ws_client",
",",
"hass_storage",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"\"lovelace\"",
",",
"{",
"}",
")",
"assert",
"hass",
".",
"data",
"[",
"frontend",
"... | [
12,
0
] | [
60,
34
] | python | en | ['en', 'en', 'en'] | True |
test_lovelace_from_storage_save_before_load | (
hass, hass_ws_client, hass_storage
) | Test we can load lovelace config from storage. | Test we can load lovelace config from storage. | async def test_lovelace_from_storage_save_before_load(
hass, hass_ws_client, hass_storage
):
"""Test we can load lovelace config from storage."""
assert await async_setup_component(hass, "lovelace", {})
client = await hass_ws_client(hass)
# Store new config
await client.send_json(
{"id"... | [
"async",
"def",
"test_lovelace_from_storage_save_before_load",
"(",
"hass",
",",
"hass_ws_client",
",",
"hass_storage",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"\"lovelace\"",
",",
"{",
"}",
")",
"client",
"=",
"await",
"hass_ws_clien... | [
63,
0
] | [
78,
5
] | python | en | ['en', 'en', 'en'] | True |
test_lovelace_from_storage_delete | (hass, hass_ws_client, hass_storage) | Test we delete lovelace config from storage. | Test we delete lovelace config from storage. | async def test_lovelace_from_storage_delete(hass, hass_ws_client, hass_storage):
"""Test we delete lovelace config from storage."""
assert await async_setup_component(hass, "lovelace", {})
client = await hass_ws_client(hass)
# Store new config
await client.send_json(
{"id": 6, "type": "love... | [
"async",
"def",
"test_lovelace_from_storage_delete",
"(",
"hass",
",",
"hass_ws_client",
",",
"hass_storage",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"\"lovelace\"",
",",
"{",
"}",
")",
"client",
"=",
"await",
"hass_ws_client",
"(",... | [
81,
0
] | [
106,
58
] | python | en | ['en', 'en', 'en'] | True |
test_lovelace_from_yaml | (hass, hass_ws_client) | Test we load lovelace config from yaml. | Test we load lovelace config from yaml. | async def test_lovelace_from_yaml(hass, hass_ws_client):
"""Test we load lovelace config from yaml."""
assert await async_setup_component(hass, "lovelace", {"lovelace": {"mode": "YAML"}})
assert hass.data[frontend.DATA_PANELS]["lovelace"].config == {"mode": "yaml"}
client = await hass_ws_client(hass)
... | [
"async",
"def",
"test_lovelace_from_yaml",
"(",
"hass",
",",
"hass_ws_client",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"\"lovelace\"",
",",
"{",
"\"lovelace\"",
":",
"{",
"\"mode\"",
":",
"\"YAML\"",
"}",
"}",
")",
"assert",
"ha... | [
109,
0
] | [
156,
27
] | python | en | ['en', 'en', 'en'] | True |
test_dashboard_from_yaml | (hass, hass_ws_client, url_path) | Test we load lovelace dashboard config from yaml. | Test we load lovelace dashboard config from yaml. | async def test_dashboard_from_yaml(hass, hass_ws_client, url_path):
"""Test we load lovelace dashboard config from yaml."""
assert await async_setup_component(
hass,
"lovelace",
{
"lovelace": {
"dashboards": {
"test-panel": {
... | [
"async",
"def",
"test_dashboard_from_yaml",
"(",
"hass",
",",
"hass_ws_client",
",",
"url_path",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"\"lovelace\"",
",",
"{",
"\"lovelace\"",
":",
"{",
"\"dashboards\"",
":",
"{",
"\"test-panel\"... | [
160,
0
] | [
262,
27
] | python | en | ['en', 'en', 'en'] | True |
test_wrong_key_dashboard_from_yaml | (hass) | Test we don't load lovelace dashboard without hyphen config from yaml. | Test we don't load lovelace dashboard without hyphen config from yaml. | async def test_wrong_key_dashboard_from_yaml(hass):
"""Test we don't load lovelace dashboard without hyphen config from yaml."""
with assert_setup_component(0):
assert not await async_setup_component(
hass,
"lovelace",
{
"lovelace": {
... | [
"async",
"def",
"test_wrong_key_dashboard_from_yaml",
"(",
"hass",
")",
":",
"with",
"assert_setup_component",
"(",
"0",
")",
":",
"assert",
"not",
"await",
"async_setup_component",
"(",
"hass",
",",
"\"lovelace\"",
",",
"{",
"\"lovelace\"",
":",
"{",
"\"dashboard... | [
265,
0
] | [
285,
9
] | python | en | ['en', 'en', 'en'] | True |
test_storage_dashboards | (hass, hass_ws_client, hass_storage) | Test we load lovelace config from storage. | Test we load lovelace config from storage. | async def test_storage_dashboards(hass, hass_ws_client, hass_storage):
"""Test we load lovelace config from storage."""
assert await async_setup_component(hass, "lovelace", {})
assert hass.data[frontend.DATA_PANELS]["lovelace"].config == {"mode": "storage"}
client = await hass_ws_client(hass)
# Fe... | [
"async",
"def",
"test_storage_dashboards",
"(",
"hass",
",",
"hass_ws_client",
",",
"hass_storage",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"\"lovelace\"",
",",
"{",
"}",
")",
"assert",
"hass",
".",
"data",
"[",
"frontend",
".",... | [
288,
0
] | [
426,
80
] | python | en | ['en', 'en', 'en'] | True |
test_storage_dashboard_migrate | (hass, hass_ws_client, hass_storage) | Test changing url path from storage config. | Test changing url path from storage config. | async def test_storage_dashboard_migrate(hass, hass_ws_client, hass_storage):
"""Test changing url path from storage config."""
hass_storage[dashboard.DASHBOARDS_STORAGE_KEY] = {
"key": "lovelace_dashboards",
"version": 1,
"data": {
"items": [
{
... | [
"async",
"def",
"test_storage_dashboard_migrate",
"(",
"hass",
",",
"hass_ws_client",
",",
"hass_storage",
")",
":",
"hass_storage",
"[",
"dashboard",
".",
"DASHBOARDS_STORAGE_KEY",
"]",
"=",
"{",
"\"key\"",
":",
"\"lovelace_dashboards\"",
",",
"\"version\"",
":",
"... | [
429,
0
] | [
479,
5
] | python | en | ['en', 'en', 'en'] | True |
test_websocket_list_dashboards | (hass, hass_ws_client) | Test listing dashboards both storage + YAML. | Test listing dashboards both storage + YAML. | async def test_websocket_list_dashboards(hass, hass_ws_client):
"""Test listing dashboards both storage + YAML."""
assert await async_setup_component(
hass,
"lovelace",
{
"lovelace": {
"dashboards": {
"test-panel-no-sidebar": {
... | [
"async",
"def",
"test_websocket_list_dashboards",
"(",
"hass",
",",
"hass_ws_client",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"\"lovelace\"",
",",
"{",
"\"lovelace\"",
":",
"{",
"\"dashboards\"",
":",
"{",
"\"test-panel-no-sidebar\"",
... | [
482,
0
] | [
528,
55
] | python | cy | ['de', 'cy', 'en'] | False |
async_setup_entry | (hass, config_entry, async_add_entities) | Set up Roon MediaPlayer from Config Entry. | Set up Roon MediaPlayer from Config Entry. | async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up Roon MediaPlayer from Config Entry."""
roon_server = hass.data[DOMAIN][config_entry.entry_id]
media_players = set()
# Register entity services
platform = entity_platform.async_get_current_platform()
platform.async_re... | [
"async",
"def",
"async_setup_entry",
"(",
"hass",
",",
"config_entry",
",",
"async_add_entities",
")",
":",
"roon_server",
"=",
"hass",
".",
"data",
"[",
"DOMAIN",
"]",
"[",
"config_entry",
".",
"entry_id",
"]",
"media_players",
"=",
"set",
"(",
")",
"# Regi... | [
68,
0
] | [
97,
82
] | python | en | ['en', 'en', 'en'] | True |
RoonDevice.__init__ | (self, server, player_data) | Initialize Roon device object. | Initialize Roon device object. | def __init__(self, server, player_data):
"""Initialize Roon device object."""
self._remove_signal_status = None
self._server = server
self._available = True
self._last_position_update = None
self._supports_standby = False
self._state = STATE_IDLE
self._uni... | [
"def",
"__init__",
"(",
"self",
",",
"server",
",",
"player_data",
")",
":",
"self",
".",
"_remove_signal_status",
"=",
"None",
"self",
".",
"_server",
"=",
"server",
"self",
".",
"_available",
"=",
"True",
"self",
".",
"_last_position_update",
"=",
"None",
... | [
103,
4
] | [
125,
37
] | python | en | ['nl', 'en', 'en'] | True |
RoonDevice.async_added_to_hass | (self) | Register callback. | Register callback. | async def async_added_to_hass(self):
"""Register callback."""
self.async_on_remove(
async_dispatcher_connect(
self.hass,
f"room_media_player_update_{self.unique_id}",
self.async_update_callback,
)
)
self._server.add_... | [
"async",
"def",
"async_added_to_hass",
"(",
"self",
")",
":",
"self",
".",
"async_on_remove",
"(",
"async_dispatcher_connect",
"(",
"self",
".",
"hass",
",",
"f\"room_media_player_update_{self.unique_id}\"",
",",
"self",
".",
"async_update_callback",
",",
")",
")",
... | [
127,
4
] | [
136,
61
] | python | en | ['en', 'no', 'en'] | False |
RoonDevice.async_update_callback | (self, player_data) | Handle device updates. | Handle device updates. | def async_update_callback(self, player_data):
"""Handle device updates."""
self.update_data(player_data)
self.async_write_ha_state() | [
"def",
"async_update_callback",
"(",
"self",
",",
"player_data",
")",
":",
"self",
".",
"update_data",
"(",
"player_data",
")",
"self",
".",
"async_write_ha_state",
"(",
")"
] | [
139,
4
] | [
142,
35
] | python | en | ['fr', 'sr', 'en'] | False |
RoonDevice.available | (self) | Return True if entity is available. | Return True if entity is available. | def available(self):
"""Return True if entity is available."""
return self._available | [
"def",
"available",
"(",
"self",
")",
":",
"return",
"self",
".",
"_available"
] | [
145,
4
] | [
147,
30
] | python | en | ['en', 'en', 'en'] | True |
RoonDevice.supported_features | (self) | Flag media player features that are supported. | Flag media player features that are supported. | def supported_features(self):
"""Flag media player features that are supported."""
return SUPPORT_ROON | [
"def",
"supported_features",
"(",
"self",
")",
":",
"return",
"SUPPORT_ROON"
] | [
150,
4
] | [
152,
27
] | python | en | ['en', 'en', 'en'] | True |
RoonDevice.group_members | (self) | Return the grouped players. | Return the grouped players. | def group_members(self):
"""Return the grouped players."""
roon_names = self._server.roonapi.grouped_zone_names(self._output_id)
return [self._server.entity_id(roon_name) for roon_name in roon_names] | [
"def",
"group_members",
"(",
"self",
")",
":",
"roon_names",
"=",
"self",
".",
"_server",
".",
"roonapi",
".",
"grouped_zone_names",
"(",
"self",
".",
"_output_id",
")",
"return",
"[",
"self",
".",
"_server",
".",
"entity_id",
"(",
"roon_name",
")",
"for",... | [
155,
4
] | [
159,
78
] | python | en | ['en', 'en', 'en'] | True |
RoonDevice.device_info | (self) | Return the device info. | Return the device info. | def device_info(self):
"""Return the device info."""
dev_model = "player"
if self.player_data.get("source_controls"):
dev_model = self.player_data["source_controls"][0].get("display_name")
return {
"identifiers": {(DOMAIN, self.unique_id)},
"name": sel... | [
"def",
"device_info",
"(",
"self",
")",
":",
"dev_model",
"=",
"\"player\"",
"if",
"self",
".",
"player_data",
".",
"get",
"(",
"\"source_controls\"",
")",
":",
"dev_model",
"=",
"self",
".",
"player_data",
"[",
"\"source_controls\"",
"]",
"[",
"0",
"]",
"... | [
162,
4
] | [
173,
9
] | python | en | ['en', 'en', 'en'] | True |
RoonDevice.update_data | (self, player_data=None) | Update session object. | Update session object. | def update_data(self, player_data=None):
"""Update session object."""
if player_data:
self.player_data = player_data
if not self.player_data["is_available"]:
# this player was removed
self._available = False
self._state = STATE_OFF
else:
... | [
"def",
"update_data",
"(",
"self",
",",
"player_data",
"=",
"None",
")",
":",
"if",
"player_data",
":",
"self",
".",
"player_data",
"=",
"player_data",
"if",
"not",
"self",
".",
"player_data",
"[",
"\"is_available\"",
"]",
":",
"# this player was removed",
"se... | [
175,
4
] | [
188,
53
] | python | en | ['en', 'en', 'en'] | True |
RoonDevice._parse_volume | (cls, player_data) | Parse volume data to determine volume levels and mute state. | Parse volume data to determine volume levels and mute state. | def _parse_volume(cls, player_data):
"""Parse volume data to determine volume levels and mute state."""
volume = {
"level": 0,
"step": 0,
"muted": False,
}
try:
volume_data = player_data["volume"]
volume_muted = volume_data["is... | [
"def",
"_parse_volume",
"(",
"cls",
",",
"player_data",
")",
":",
"volume",
"=",
"{",
"\"level\"",
":",
"0",
",",
"\"step\"",
":",
"0",
",",
"\"muted\"",
":",
"False",
",",
"}",
"try",
":",
"volume_data",
"=",
"player_data",
"[",
"\"volume\"",
"]",
"vo... | [
191,
4
] | [
218,
21
] | python | en | ['en', 'en', 'en'] | True |
RoonDevice._parse_now_playing | (self, player_data) | Parse now playing data to determine title, artist, position, duration and artwork. | Parse now playing data to determine title, artist, position, duration and artwork. | def _parse_now_playing(self, player_data):
"""Parse now playing data to determine title, artist, position, duration and artwork."""
now_playing = {
"title": None,
"artist": None,
"album": None,
"position": 0,
"duration": 0,
"image":... | [
"def",
"_parse_now_playing",
"(",
"self",
",",
"player_data",
")",
":",
"now_playing",
"=",
"{",
"\"title\"",
":",
"None",
",",
"\"artist\"",
":",
"None",
",",
"\"album\"",
":",
"None",
",",
"\"position\"",
":",
"0",
",",
"\"duration\"",
":",
"0",
",",
"... | [
220,
4
] | [
252,
26
] | python | en | ['en', 'en', 'en'] | True |
RoonDevice.update_state | (self) | Update the power state and player state. | Update the power state and player state. | def update_state(self):
"""Update the power state and player state."""
new_state = ""
# power state from source control (if supported)
if "source_controls" in self.player_data:
for source in self.player_data["source_controls"]:
if source["supports_standby"] a... | [
"def",
"update_state",
"(",
"self",
")",
":",
"new_state",
"=",
"\"\"",
"# power state from source control (if supported)",
"if",
"\"source_controls\"",
"in",
"self",
".",
"player_data",
":",
"for",
"source",
"in",
"self",
".",
"player_data",
"[",
"\"source_controls\"... | [
254,
4
] | [
297,
52
] | python | en | ['en', 'en', 'en'] | True |
RoonDevice.media_position_updated_at | (self) | When was the position of the current playing media valid. | When was the position of the current playing media valid. | def media_position_updated_at(self):
"""When was the position of the current playing media valid."""
# Returns value from homeassistant.util.dt.utcnow().
return self._last_position_update | [
"def",
"media_position_updated_at",
"(",
"self",
")",
":",
"# Returns value from homeassistant.util.dt.utcnow().",
"return",
"self",
".",
"_last_position_update"
] | [
300,
4
] | [
303,
41
] | python | en | ['en', 'en', 'en'] | True |
RoonDevice.unique_id | (self) | Return the id of this roon client. | Return the id of this roon client. | def unique_id(self):
"""Return the id of this roon client."""
return self._unique_id | [
"def",
"unique_id",
"(",
"self",
")",
":",
"return",
"self",
".",
"_unique_id"
] | [
306,
4
] | [
308,
30
] | python | en | ['en', 'en', 'en'] | True |
RoonDevice.should_poll | (self) | Return True if entity has to be polled for state. | Return True if entity has to be polled for state. | def should_poll(self):
"""Return True if entity has to be polled for state."""
return False | [
"def",
"should_poll",
"(",
"self",
")",
":",
"return",
"False"
] | [
311,
4
] | [
313,
20
] | python | en | ['en', 'en', 'en'] | True |
RoonDevice.zone_id | (self) | Return current session Id. | Return current session Id. | def zone_id(self):
"""Return current session Id."""
return self._zone_id | [
"def",
"zone_id",
"(",
"self",
")",
":",
"return",
"self",
".",
"_zone_id"
] | [
316,
4
] | [
318,
28
] | python | en | ['en', 'bg', 'en'] | True |
RoonDevice.output_id | (self) | Return current session Id. | Return current session Id. | def output_id(self):
"""Return current session Id."""
return self._output_id | [
"def",
"output_id",
"(",
"self",
")",
":",
"return",
"self",
".",
"_output_id"
] | [
321,
4
] | [
323,
30
] | python | en | ['en', 'bg', 'en'] | True |
RoonDevice.name | (self) | Return device name. | Return device name. | def name(self):
"""Return device name."""
return self._name | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
".",
"_name"
] | [
326,
4
] | [
328,
25
] | python | en | ['es', 'sl', 'en'] | False |
RoonDevice.media_title | (self) | Return title currently playing. | Return title currently playing. | def media_title(self):
"""Return title currently playing."""
return self._media_title | [
"def",
"media_title",
"(",
"self",
")",
":",
"return",
"self",
".",
"_media_title"
] | [
331,
4
] | [
333,
32
] | python | en | ['en', 'en', 'en'] | True |
RoonDevice.media_album_name | (self) | Album name of current playing media (Music track only). | Album name of current playing media (Music track only). | def media_album_name(self):
"""Album name of current playing media (Music track only)."""
return self._media_album_name | [
"def",
"media_album_name",
"(",
"self",
")",
":",
"return",
"self",
".",
"_media_album_name"
] | [
336,
4
] | [
338,
37
] | python | en | ['en', 'en', 'en'] | True |
RoonDevice.media_artist | (self) | Artist of current playing media (Music track only). | Artist of current playing media (Music track only). | def media_artist(self):
"""Artist of current playing media (Music track only)."""
return self._media_artist | [
"def",
"media_artist",
"(",
"self",
")",
":",
"return",
"self",
".",
"_media_artist"
] | [
341,
4
] | [
343,
33
] | python | en | ['en', 'en', 'en'] | True |
RoonDevice.media_album_artist | (self) | Album artist of current playing media (Music track only). | Album artist of current playing media (Music track only). | def media_album_artist(self):
"""Album artist of current playing media (Music track only)."""
return self._media_artist | [
"def",
"media_album_artist",
"(",
"self",
")",
":",
"return",
"self",
".",
"_media_artist"
] | [
346,
4
] | [
348,
33
] | python | en | ['en', 'en', 'en'] | True |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.