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_update | (hass) | Test update. | Test update. | async def test_update(hass):
"""Test update."""
with patch(
"homeassistant.components.melissa.climate._LOGGER.warning"
) as mocked_warning:
with patch("homeassistant.components.melissa"):
api = melissa_mock()
device = (await api.async_fetch_devices())[_SERIAL]
... | [
"async",
"def",
"test_update",
"(",
"hass",
")",
":",
"with",
"patch",
"(",
"\"homeassistant.components.melissa.climate._LOGGER.warning\"",
")",
"as",
"mocked_warning",
":",
"with",
"patch",
"(",
"\"homeassistant.components.melissa\"",
")",
":",
"api",
"=",
"melissa_moc... | [
286,
0
] | [
302,
13
] | python | en | ['en', 'de', 'en'] | False |
test_melissa_op_to_hass | (hass) | Test for translate melissa operations to hass. | Test for translate melissa operations to hass. | async def test_melissa_op_to_hass(hass):
"""Test for translate melissa operations to hass."""
with patch("homeassistant.components.melissa"):
api = melissa_mock()
device = (await api.async_fetch_devices())[_SERIAL]
thermostat = MelissaClimate(api, _SERIAL, device)
assert HVAC_MOD... | [
"async",
"def",
"test_melissa_op_to_hass",
"(",
"hass",
")",
":",
"with",
"patch",
"(",
"\"homeassistant.components.melissa\"",
")",
":",
"api",
"=",
"melissa_mock",
"(",
")",
"device",
"=",
"(",
"await",
"api",
".",
"async_fetch_devices",
"(",
")",
")",
"[",
... | [
305,
0
] | [
315,
55
] | python | en | ['en', 'en', 'en'] | True |
test_melissa_fan_to_hass | (hass) | Test for translate melissa fan state to hass. | Test for translate melissa fan state to hass. | async def test_melissa_fan_to_hass(hass):
"""Test for translate melissa fan state to hass."""
with patch("homeassistant.components.melissa"):
api = melissa_mock()
device = (await api.async_fetch_devices())[_SERIAL]
thermostat = MelissaClimate(api, _SERIAL, device)
assert "auto" =... | [
"async",
"def",
"test_melissa_fan_to_hass",
"(",
"hass",
")",
":",
"with",
"patch",
"(",
"\"homeassistant.components.melissa\"",
")",
":",
"api",
"=",
"melissa_mock",
"(",
")",
"device",
"=",
"(",
"await",
"api",
".",
"async_fetch_devices",
"(",
")",
")",
"[",... | [
318,
0
] | [
328,
56
] | python | en | ['en', 'en', 'en'] | True |
test_hass_mode_to_melissa | (hass) | Test for hass operations to melssa. | Test for hass operations to melssa. | async def test_hass_mode_to_melissa(hass):
"""Test for hass operations to melssa."""
with patch(
"homeassistant.components.melissa.climate._LOGGER.warning"
) as mocked_warning:
with patch("homeassistant.components.melissa"):
api = melissa_mock()
device = (await api.as... | [
"async",
"def",
"test_hass_mode_to_melissa",
"(",
"hass",
")",
":",
"with",
"patch",
"(",
"\"homeassistant.components.melissa.climate._LOGGER.warning\"",
")",
"as",
"mocked_warning",
":",
"with",
"patch",
"(",
"\"homeassistant.components.melissa\"",
")",
":",
"api",
"=",
... | [
331,
0
] | [
347,
13
] | python | en | ['en', 'en', 'en'] | True |
test_hass_fan_to_melissa | (hass) | Test for translate melissa states to hass. | Test for translate melissa states to hass. | async def test_hass_fan_to_melissa(hass):
"""Test for translate melissa states to hass."""
with patch(
"homeassistant.components.melissa.climate._LOGGER.warning"
) as mocked_warning:
with patch("homeassistant.components.melissa"):
api = melissa_mock()
device = (await ... | [
"async",
"def",
"test_hass_fan_to_melissa",
"(",
"hass",
")",
":",
"with",
"patch",
"(",
"\"homeassistant.components.melissa.climate._LOGGER.warning\"",
")",
"as",
"mocked_warning",
":",
"with",
"patch",
"(",
"\"homeassistant.components.melissa\"",
")",
":",
"api",
"=",
... | [
350,
0
] | [
366,
13
] | python | en | ['en', 'en', 'en'] | True |
async_setup | (hass, config) | Configure Gammu state machine. | Configure Gammu state machine. | async def async_setup(hass, config):
"""Configure Gammu state machine."""
hass.data.setdefault(DOMAIN, {})
sms_config = config.get(DOMAIN, {})
if not sms_config:
return True
hass.async_create_task(
hass.config_entries.flow.async_init(
DOMAIN,
context={"source... | [
"async",
"def",
"async_setup",
"(",
"hass",
",",
"config",
")",
":",
"hass",
".",
"data",
".",
"setdefault",
"(",
"DOMAIN",
",",
"{",
"}",
")",
"sms_config",
"=",
"config",
".",
"get",
"(",
"DOMAIN",
",",
"{",
"}",
")",
"if",
"not",
"sms_config",
"... | [
21,
0
] | [
36,
15
] | python | en | ['en', 'co', 'en'] | True |
async_setup_entry | (hass: HomeAssistant, entry: ConfigEntry) | Configure Gammu state machine. | Configure Gammu state machine. | async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
"""Configure Gammu state machine."""
device = entry.data[CONF_DEVICE]
config = {"Device": device, "Connection": "at"}
gateway = await create_sms_gateway(config, hass)
if not gateway:
return False
hass.data[DOMAIN][SMS... | [
"async",
"def",
"async_setup_entry",
"(",
"hass",
":",
"HomeAssistant",
",",
"entry",
":",
"ConfigEntry",
")",
":",
"device",
"=",
"entry",
".",
"data",
"[",
"CONF_DEVICE",
"]",
"config",
"=",
"{",
"\"Device\"",
":",
"device",
",",
"\"Connection\"",
":",
"... | [
39,
0
] | [
53,
15
] | python | en | ['en', 'co', 'en'] | True |
async_unload_entry | (hass: HomeAssistant, entry: ConfigEntry) | Unload a config entry. | Unload a config entry. | async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry):
"""Unload a config entry."""
unload_ok = all(
await asyncio.gather(
*[
hass.config_entries.async_forward_entry_unload(entry, component)
for component in PLATFORMS
]
)
... | [
"async",
"def",
"async_unload_entry",
"(",
"hass",
":",
"HomeAssistant",
",",
"entry",
":",
"ConfigEntry",
")",
":",
"unload_ok",
"=",
"all",
"(",
"await",
"asyncio",
".",
"gather",
"(",
"*",
"[",
"hass",
".",
"config_entries",
".",
"async_forward_entry_unload... | [
56,
0
] | [
71,
20
] | python | en | ['en', 'es', 'en'] | True |
load_from_file | (path, fmt=None, is_training=True) |
load data from file
|
load data from file
| def load_from_file(path, fmt=None, is_training=True):
'''
load data from file
'''
if fmt is None:
fmt = 'squad'
assert fmt in ['squad', 'csv'], 'input format must be squad or csv'
qp_pairs = []
if fmt == 'squad':
with open(path) as data_file:
data = json.load(data... | [
"def",
"load_from_file",
"(",
"path",
",",
"fmt",
"=",
"None",
",",
"is_training",
"=",
"True",
")",
":",
"if",
"fmt",
"is",
"None",
":",
"fmt",
"=",
"'squad'",
"assert",
"fmt",
"in",
"[",
"'squad'",
",",
"'csv'",
"]",
",",
"'input format must be squad o... | [
66,
0
] | [
103,
19
] | python | en | ['en', 'error', 'th'] | False |
tokenize | (qp_pair, tokenizer=None, is_training=False) |
tokenize function.
|
tokenize function.
| def tokenize(qp_pair, tokenizer=None, is_training=False):
'''
tokenize function.
'''
question_tokens = tokenizer.tokenize(qp_pair['question'])
passage_tokens = tokenizer.tokenize(qp_pair['passage'])
if is_training:
question_tokens = question_tokens[:300]
passage_tokens = passage_... | [
"def",
"tokenize",
"(",
"qp_pair",
",",
"tokenizer",
"=",
"None",
",",
"is_training",
"=",
"False",
")",
":",
"question_tokens",
"=",
"tokenizer",
".",
"tokenize",
"(",
"qp_pair",
"[",
"'question'",
"]",
")",
"passage_tokens",
"=",
"tokenizer",
".",
"tokeniz... | [
106,
0
] | [
120,
46
] | python | en | ['en', 'error', 'th'] | False |
collect_vocab | (qp_pairs) |
Build the vocab from corpus.
|
Build the vocab from corpus.
| def collect_vocab(qp_pairs):
'''
Build the vocab from corpus.
'''
vocab = set()
for qp_pair in qp_pairs:
for word in qp_pair['question_tokens']:
vocab.add(word['word'])
for word in qp_pair['passage_tokens']:
vocab.add(word['word'])
return vocab | [
"def",
"collect_vocab",
"(",
"qp_pairs",
")",
":",
"vocab",
"=",
"set",
"(",
")",
"for",
"qp_pair",
"in",
"qp_pairs",
":",
"for",
"word",
"in",
"qp_pair",
"[",
"'question_tokens'",
"]",
":",
"vocab",
".",
"add",
"(",
"word",
"[",
"'word'",
"]",
")",
... | [
123,
0
] | [
133,
16
] | python | en | ['en', 'error', 'th'] | False |
shuffle_step | (entries, step) |
Shuffle the step
|
Shuffle the step
| def shuffle_step(entries, step):
'''
Shuffle the step
'''
answer = []
for i in range(0, len(entries), step):
sub = entries[i:i+step]
shuffle(sub)
answer += sub
return answer | [
"def",
"shuffle_step",
"(",
"entries",
",",
"step",
")",
":",
"answer",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"0",
",",
"len",
"(",
"entries",
")",
",",
"step",
")",
":",
"sub",
"=",
"entries",
"[",
"i",
":",
"i",
"+",
"step",
"]",
"... | [
136,
0
] | [
145,
17
] | python | en | ['en', 'error', 'th'] | False |
get_batches | (qp_pairs, batch_size, need_sort=True) |
Get batches data and shuffle.
|
Get batches data and shuffle.
| def get_batches(qp_pairs, batch_size, need_sort=True):
'''
Get batches data and shuffle.
'''
if need_sort:
qp_pairs = sorted(qp_pairs, key=lambda qp: (
len(qp['passage_tokens']), qp['id']), reverse=True)
batches = [{'qp_pairs': qp_pairs[i:(i + batch_size)]}
for i i... | [
"def",
"get_batches",
"(",
"qp_pairs",
",",
"batch_size",
",",
"need_sort",
"=",
"True",
")",
":",
"if",
"need_sort",
":",
"qp_pairs",
"=",
"sorted",
"(",
"qp_pairs",
",",
"key",
"=",
"lambda",
"qp",
":",
"(",
"len",
"(",
"qp",
"[",
"'passage_tokens'",
... | [
148,
0
] | [
158,
18
] | python | en | ['en', 'error', 'th'] | False |
get_char_input | (data, char_dict, max_char_length) |
Get char input.
|
Get char input.
| def get_char_input(data, char_dict, max_char_length):
'''
Get char input.
'''
batch_size = len(data)
sequence_length = max(len(d) for d in data)
char_id = np.zeros((max_char_length, sequence_length,
batch_size), dtype=np.int32)
char_lengths = np.zeros((sequence_length... | [
"def",
"get_char_input",
"(",
"data",
",",
"char_dict",
",",
"max_char_length",
")",
":",
"batch_size",
"=",
"len",
"(",
"data",
")",
"sequence_length",
"=",
"max",
"(",
"len",
"(",
"d",
")",
"for",
"d",
"in",
"data",
")",
"char_id",
"=",
"np",
".",
... | [
161,
0
] | [
178,
32
] | python | en | ['en', 'error', 'th'] | False |
get_word_input | (data, word_dict, embed, embed_dim) |
Get word input.
|
Get word input.
| def get_word_input(data, word_dict, embed, embed_dim):
'''
Get word input.
'''
batch_size = len(data)
max_sequence_length = max(len(d) for d in data)
sequence_length = max_sequence_length
word_input = np.zeros((max_sequence_length, batch_size,
embed_dim), dtype=np.... | [
"def",
"get_word_input",
"(",
"data",
",",
"word_dict",
",",
"embed",
",",
"embed_dim",
")",
":",
"batch_size",
"=",
"len",
"(",
"data",
")",
"max_sequence_length",
"=",
"max",
"(",
"len",
"(",
"d",
")",
"for",
"d",
"in",
"data",
")",
"sequence_length",
... | [
181,
0
] | [
207,
42
] | python | en | ['en', 'error', 'th'] | False |
get_word_index | (tokens, char_index) |
Given word return word index.
|
Given word return word index.
| def get_word_index(tokens, char_index):
'''
Given word return word index.
'''
for (i, token) in enumerate(tokens):
if token['char_end'] == 0:
continue
if token['char_begin'] <= char_index and char_index <= token['char_end']:
return i
return 0 | [
"def",
"get_word_index",
"(",
"tokens",
",",
"char_index",
")",
":",
"for",
"(",
"i",
",",
"token",
")",
"in",
"enumerate",
"(",
"tokens",
")",
":",
"if",
"token",
"[",
"'char_end'",
"]",
"==",
"0",
":",
"continue",
"if",
"token",
"[",
"'char_begin'",
... | [
210,
0
] | [
219,
12
] | python | en | ['en', 'error', 'th'] | False |
get_answer_begin_end | (data) |
Get answer's index of begin and end.
|
Get answer's index of begin and end.
| def get_answer_begin_end(data):
'''
Get answer's index of begin and end.
'''
begin = []
end = []
for qa_pair in data:
tokens = qa_pair['passage_tokens']
char_begin = qa_pair['answer_begin']
char_end = qa_pair['answer_end']
word_begin = get_word_index(tokens, char_... | [
"def",
"get_answer_begin_end",
"(",
"data",
")",
":",
"begin",
"=",
"[",
"]",
"end",
"=",
"[",
"]",
"for",
"qa_pair",
"in",
"data",
":",
"tokens",
"=",
"qa_pair",
"[",
"'passage_tokens'",
"]",
"char_begin",
"=",
"qa_pair",
"[",
"'answer_begin'",
"]",
"ch... | [
222,
0
] | [
236,
45
] | python | en | ['en', 'error', 'th'] | False |
get_id | (word_dict, word) |
Given word, return word id.
|
Given word, return word id.
| def get_id(word_dict, word):
'''
Given word, return word id.
'''
return word_dict.get(word, word_dict['<unk>']) | [
"def",
"get_id",
"(",
"word_dict",
",",
"word",
")",
":",
"return",
"word_dict",
".",
"get",
"(",
"word",
",",
"word_dict",
"[",
"'<unk>'",
"]",
")"
] | [
239,
0
] | [
243,
50
] | python | en | ['en', 'error', 'th'] | False |
get_buckets | (min_length, max_length, bucket_count) |
Get bucket by length.
|
Get bucket by length.
| def get_buckets(min_length, max_length, bucket_count):
'''
Get bucket by length.
'''
if bucket_count <= 0:
return [max_length]
unit_length = int((max_length - min_length) // (bucket_count))
buckets = [min_length + unit_length *
(i + 1) for i in range(0, bucket_count)]
... | [
"def",
"get_buckets",
"(",
"min_length",
",",
"max_length",
",",
"bucket_count",
")",
":",
"if",
"bucket_count",
"<=",
"0",
":",
"return",
"[",
"max_length",
"]",
"unit_length",
"=",
"int",
"(",
"(",
"max_length",
"-",
"min_length",
")",
"//",
"(",
"bucket... | [
246,
0
] | [
256,
18
] | python | en | ['en', 'error', 'th'] | False |
find_bucket | (length, buckets) |
Find bucket.
|
Find bucket.
| def find_bucket(length, buckets):
'''
Find bucket.
'''
for bucket in buckets:
if length <= bucket:
return bucket
return buckets[-1] | [
"def",
"find_bucket",
"(",
"length",
",",
"buckets",
")",
":",
"for",
"bucket",
"in",
"buckets",
":",
"if",
"length",
"<=",
"bucket",
":",
"return",
"bucket",
"return",
"buckets",
"[",
"-",
"1",
"]"
] | [
259,
0
] | [
266,
22
] | python | en | ['en', 'error', 'th'] | False |
WhitespaceTokenizer.tokenize | (self, text) |
tokenize function in Tokenizer.
|
tokenize function in Tokenizer.
| def tokenize(self, text):
'''
tokenize function in Tokenizer.
'''
start = -1
tokens = []
for i, character in enumerate(text):
if character == ' ' or character == '\t':
if start >= 0:
word = text[start:i]
... | [
"def",
"tokenize",
"(",
"self",
",",
"text",
")",
":",
"start",
"=",
"-",
"1",
"tokens",
"=",
"[",
"]",
"for",
"i",
",",
"character",
"in",
"enumerate",
"(",
"text",
")",
":",
"if",
"character",
"==",
"' '",
"or",
"character",
"==",
"'\\t'",
":",
... | [
37,
4
] | [
63,
21
] | python | en | ['en', 'error', 'th'] | False |
async_describe_on_off_states | (
hass: HomeAssistantType, registry: GroupIntegrationRegistry
) | Describe group on off states. | Describe group on off states. | def async_describe_on_off_states(
hass: HomeAssistantType, registry: GroupIntegrationRegistry
) -> None:
"""Describe group on off states."""
registry.on_off_states(
set(HVAC_MODES) - {HVAC_MODE_OFF},
STATE_OFF,
) | [
"def",
"async_describe_on_off_states",
"(",
"hass",
":",
"HomeAssistantType",
",",
"registry",
":",
"GroupIntegrationRegistry",
")",
"->",
"None",
":",
"registry",
".",
"on_off_states",
"(",
"set",
"(",
"HVAC_MODES",
")",
"-",
"{",
"HVAC_MODE_OFF",
"}",
",",
"ST... | [
12,
0
] | [
19,
5
] | python | en | ['en', 'en', 'en'] | True |
service_update_mock | (zeroconf, services, handlers) | Call service update handler. | Call service update handler. | def service_update_mock(zeroconf, services, handlers):
"""Call service update handler."""
for service in services:
handlers[0](zeroconf, service, f"name.{service}", ServiceStateChange.Added) | [
"def",
"service_update_mock",
"(",
"zeroconf",
",",
"services",
",",
"handlers",
")",
":",
"for",
"service",
"in",
"services",
":",
"handlers",
"[",
"0",
"]",
"(",
"zeroconf",
",",
"service",
",",
"f\"name.{service}\"",
",",
"ServiceStateChange",
".",
"Added",... | [
33,
0
] | [
36,
83
] | python | en | ['en', 'lb', 'en'] | True |
get_service_info_mock | (service_type, name) | Return service info for get_service_info. | Return service info for get_service_info. | def get_service_info_mock(service_type, name):
"""Return service info for get_service_info."""
return ServiceInfo(
service_type,
name,
addresses=[b"\n\x00\x00\x14"],
port=80,
weight=0,
priority=0,
server="name.local.",
properties=PROPERTIES,
) | [
"def",
"get_service_info_mock",
"(",
"service_type",
",",
"name",
")",
":",
"return",
"ServiceInfo",
"(",
"service_type",
",",
"name",
",",
"addresses",
"=",
"[",
"b\"\\n\\x00\\x00\\x14\"",
"]",
",",
"port",
"=",
"80",
",",
"weight",
"=",
"0",
",",
"priority... | [
39,
0
] | [
50,
5
] | python | en | ['da', 'en', 'en'] | True |
get_service_info_mock_without_an_address | (service_type, name) | Return service info for get_service_info without any addresses. | Return service info for get_service_info without any addresses. | def get_service_info_mock_without_an_address(service_type, name):
"""Return service info for get_service_info without any addresses."""
return ServiceInfo(
service_type,
name,
addresses=[],
port=80,
weight=0,
priority=0,
server="name.local.",
prope... | [
"def",
"get_service_info_mock_without_an_address",
"(",
"service_type",
",",
"name",
")",
":",
"return",
"ServiceInfo",
"(",
"service_type",
",",
"name",
",",
"addresses",
"=",
"[",
"]",
",",
"port",
"=",
"80",
",",
"weight",
"=",
"0",
",",
"priority",
"=",
... | [
53,
0
] | [
64,
5
] | python | en | ['en', 'en', 'en'] | True |
get_homekit_info_mock | (model, pairing_status) | Return homekit info for get_service_info for an homekit device. | Return homekit info for get_service_info for an homekit device. | def get_homekit_info_mock(model, pairing_status):
"""Return homekit info for get_service_info for an homekit device."""
def mock_homekit_info(service_type, name):
return ServiceInfo(
service_type,
name,
addresses=[b"\n\x00\x00\x14"],
port=80,
... | [
"def",
"get_homekit_info_mock",
"(",
"model",
",",
"pairing_status",
")",
":",
"def",
"mock_homekit_info",
"(",
"service_type",
",",
"name",
")",
":",
"return",
"ServiceInfo",
"(",
"service_type",
",",
"name",
",",
"addresses",
"=",
"[",
"b\"\\n\\x00\\x00\\x14\"",... | [
67,
0
] | [
82,
28
] | python | br | ['br', 'lb', 'en'] | False |
get_zeroconf_info_mock | (macaddress) | Return info for get_service_info for an zeroconf device. | Return info for get_service_info for an zeroconf device. | def get_zeroconf_info_mock(macaddress):
"""Return info for get_service_info for an zeroconf device."""
def mock_zc_info(service_type, name):
return ServiceInfo(
service_type,
name,
addresses=[b"\n\x00\x00\x14"],
port=80,
weight=0,
... | [
"def",
"get_zeroconf_info_mock",
"(",
"macaddress",
")",
":",
"def",
"mock_zc_info",
"(",
"service_type",
",",
"name",
")",
":",
"return",
"ServiceInfo",
"(",
"service_type",
",",
"name",
",",
"addresses",
"=",
"[",
"b\"\\n\\x00\\x00\\x14\"",
"]",
",",
"port",
... | [
85,
0
] | [
100,
23
] | python | en | ['de', 'en', 'en'] | True |
test_setup | (hass, mock_zeroconf) | Test configured options for a device are loaded via config entry. | Test configured options for a device are loaded via config entry. | async def test_setup(hass, mock_zeroconf):
"""Test configured options for a device are loaded via config entry."""
with patch.object(
hass.config_entries.flow, "async_init"
) as mock_config_flow, patch.object(
zeroconf, "HaServiceBrowser", side_effect=service_update_mock
) as mock_servic... | [
"async",
"def",
"test_setup",
"(",
"hass",
",",
"mock_zeroconf",
")",
":",
"with",
"patch",
".",
"object",
"(",
"hass",
".",
"config_entries",
".",
"flow",
",",
"\"async_init\"",
")",
"as",
"mock_config_flow",
",",
"patch",
".",
"object",
"(",
"zeroconf",
... | [
103,
0
] | [
127,
79
] | python | en | ['en', 'en', 'en'] | True |
test_setup_with_overly_long_url_and_name | (hass, mock_zeroconf, caplog) | Test we still setup with long urls and names. | Test we still setup with long urls and names. | async def test_setup_with_overly_long_url_and_name(hass, mock_zeroconf, caplog):
"""Test we still setup with long urls and names."""
with patch.object(hass.config_entries.flow, "async_init"), patch.object(
zeroconf, "HaServiceBrowser", side_effect=service_update_mock
), patch(
"homeassistant... | [
"async",
"def",
"test_setup_with_overly_long_url_and_name",
"(",
"hass",
",",
"mock_zeroconf",
",",
"caplog",
")",
":",
"with",
"patch",
".",
"object",
"(",
"hass",
".",
"config_entries",
".",
"flow",
",",
"\"async_init\"",
")",
",",
"patch",
".",
"object",
"(... | [
130,
0
] | [
148,
41
] | python | en | ['en', 'en', 'en'] | True |
test_setup_with_default_interface | (hass, mock_zeroconf) | Test default interface config. | Test default interface config. | async def test_setup_with_default_interface(hass, mock_zeroconf):
"""Test default interface config."""
with patch.object(hass.config_entries.flow, "async_init"), patch.object(
zeroconf, "HaServiceBrowser", side_effect=service_update_mock
):
mock_zeroconf.get_service_info.side_effect = get_se... | [
"async",
"def",
"test_setup_with_default_interface",
"(",
"hass",
",",
"mock_zeroconf",
")",
":",
"with",
"patch",
".",
"object",
"(",
"hass",
".",
"config_entries",
".",
"flow",
",",
"\"async_init\"",
")",
",",
"patch",
".",
"object",
"(",
"zeroconf",
",",
... | [
151,
0
] | [
163,
78
] | python | fr | ['fr', 'fr', 'en'] | True |
test_setup_without_default_interface | (hass, mock_zeroconf) | Test without default interface config. | Test without default interface config. | async def test_setup_without_default_interface(hass, mock_zeroconf):
"""Test without default interface config."""
with patch.object(hass.config_entries.flow, "async_init"), patch.object(
zeroconf, "HaServiceBrowser", side_effect=service_update_mock
):
mock_zeroconf.get_service_info.side_effe... | [
"async",
"def",
"test_setup_without_default_interface",
"(",
"hass",
",",
"mock_zeroconf",
")",
":",
"with",
"patch",
".",
"object",
"(",
"hass",
".",
"config_entries",
".",
"flow",
",",
"\"async_init\"",
")",
",",
"patch",
".",
"object",
"(",
"zeroconf",
",",... | [
166,
0
] | [
176,
38
] | python | en | ['en', 'en', 'en'] | True |
test_setup_without_ipv6 | (hass, mock_zeroconf) | Test without ipv6. | Test without ipv6. | async def test_setup_without_ipv6(hass, mock_zeroconf):
"""Test without ipv6."""
with patch.object(hass.config_entries.flow, "async_init"), patch.object(
zeroconf, "HaServiceBrowser", side_effect=service_update_mock
):
mock_zeroconf.get_service_info.side_effect = get_service_info_mock
... | [
"async",
"def",
"test_setup_without_ipv6",
"(",
"hass",
",",
"mock_zeroconf",
")",
":",
"with",
"patch",
".",
"object",
"(",
"hass",
".",
"config_entries",
".",
"flow",
",",
"\"async_init\"",
")",
",",
"patch",
".",
"object",
"(",
"zeroconf",
",",
"\"HaServi... | [
179,
0
] | [
191,
65
] | python | en | ['en', 'en', 'en'] | True |
test_setup_with_ipv6 | (hass, mock_zeroconf) | Test without ipv6. | Test without ipv6. | async def test_setup_with_ipv6(hass, mock_zeroconf):
"""Test without ipv6."""
with patch.object(hass.config_entries.flow, "async_init"), patch.object(
zeroconf, "HaServiceBrowser", side_effect=service_update_mock
):
mock_zeroconf.get_service_info.side_effect = get_service_info_mock
a... | [
"async",
"def",
"test_setup_with_ipv6",
"(",
"hass",
",",
"mock_zeroconf",
")",
":",
"with",
"patch",
".",
"object",
"(",
"hass",
".",
"config_entries",
".",
"flow",
",",
"\"async_init\"",
")",
",",
"patch",
".",
"object",
"(",
"zeroconf",
",",
"\"HaServiceB... | [
194,
0
] | [
206,
38
] | python | en | ['en', 'en', 'en'] | True |
test_setup_with_ipv6_default | (hass, mock_zeroconf) | Test without ipv6 as default. | Test without ipv6 as default. | async def test_setup_with_ipv6_default(hass, mock_zeroconf):
"""Test without ipv6 as default."""
with patch.object(hass.config_entries.flow, "async_init"), patch.object(
zeroconf, "HaServiceBrowser", side_effect=service_update_mock
):
mock_zeroconf.get_service_info.side_effect = get_service_... | [
"async",
"def",
"test_setup_with_ipv6_default",
"(",
"hass",
",",
"mock_zeroconf",
")",
":",
"with",
"patch",
".",
"object",
"(",
"hass",
".",
"config_entries",
".",
"flow",
",",
"\"async_init\"",
")",
",",
"patch",
".",
"object",
"(",
"zeroconf",
",",
"\"Ha... | [
209,
0
] | [
219,
38
] | python | en | ['en', 'en', 'en'] | True |
test_service_with_invalid_name | (hass, mock_zeroconf, caplog) | Test we do not crash on service with an invalid name. | Test we do not crash on service with an invalid name. | async def test_service_with_invalid_name(hass, mock_zeroconf, caplog):
"""Test we do not crash on service with an invalid name."""
with patch.object(
zeroconf, "HaServiceBrowser", side_effect=service_update_mock
) as mock_service_browser:
mock_zeroconf.get_service_info.side_effect = BadTypeI... | [
"async",
"def",
"test_service_with_invalid_name",
"(",
"hass",
",",
"mock_zeroconf",
",",
"caplog",
")",
":",
"with",
"patch",
".",
"object",
"(",
"zeroconf",
",",
"\"HaServiceBrowser\"",
",",
"side_effect",
"=",
"service_update_mock",
")",
"as",
"mock_service_brows... | [
222,
0
] | [
233,
62
] | python | en | ['en', 'en', 'en'] | True |
test_zeroconf_match | (hass, mock_zeroconf) | Test configured options for a device are loaded via config entry. | Test configured options for a device are loaded via config entry. | async def test_zeroconf_match(hass, mock_zeroconf):
"""Test configured options for a device are loaded via config entry."""
def http_only_service_update_mock(zeroconf, services, handlers):
"""Call service update handler."""
handlers[0](
zeroconf,
"_http._tcp.local.",
... | [
"async",
"def",
"test_zeroconf_match",
"(",
"hass",
",",
"mock_zeroconf",
")",
":",
"def",
"http_only_service_update_mock",
"(",
"zeroconf",
",",
"services",
",",
"handlers",
")",
":",
"\"\"\"Call service update handler.\"\"\"",
"handlers",
"[",
"0",
"]",
"(",
"zero... | [
236,
0
] | [
266,
59
] | python | en | ['en', 'en', 'en'] | True |
test_zeroconf_no_match | (hass, mock_zeroconf) | Test configured options for a device are loaded via config entry. | Test configured options for a device are loaded via config entry. | async def test_zeroconf_no_match(hass, mock_zeroconf):
"""Test configured options for a device are loaded via config entry."""
def http_only_service_update_mock(zeroconf, services, handlers):
"""Call service update handler."""
handlers[0](
zeroconf,
"_http._tcp.local.",
... | [
"async",
"def",
"test_zeroconf_no_match",
"(",
"hass",
",",
"mock_zeroconf",
")",
":",
"def",
"http_only_service_update_mock",
"(",
"zeroconf",
",",
"services",
",",
"handlers",
")",
":",
"\"\"\"Call service update handler.\"\"\"",
"handlers",
"[",
"0",
"]",
"(",
"z... | [
269,
0
] | [
298,
48
] | python | en | ['en', 'en', 'en'] | True |
test_homekit_match_partial_space | (hass, mock_zeroconf) | Test configured options for a device are loaded via config entry. | Test configured options for a device are loaded via config entry. | async def test_homekit_match_partial_space(hass, mock_zeroconf):
"""Test configured options for a device are loaded via config entry."""
with patch.dict(
zc_gen.ZEROCONF,
{zeroconf.HOMEKIT_TYPE: [{"domain": "homekit_controller"}]},
clear=True,
), patch.object(
hass.config_ent... | [
"async",
"def",
"test_homekit_match_partial_space",
"(",
"hass",
",",
"mock_zeroconf",
")",
":",
"with",
"patch",
".",
"dict",
"(",
"zc_gen",
".",
"ZEROCONF",
",",
"{",
"zeroconf",
".",
"HOMEKIT_TYPE",
":",
"[",
"{",
"\"domain\"",
":",
"\"homekit_controller\"",
... | [
301,
0
] | [
321,
57
] | python | en | ['en', 'en', 'en'] | True |
test_homekit_match_partial_dash | (hass, mock_zeroconf) | Test configured options for a device are loaded via config entry. | Test configured options for a device are loaded via config entry. | async def test_homekit_match_partial_dash(hass, mock_zeroconf):
"""Test configured options for a device are loaded via config entry."""
with patch.dict(
zc_gen.ZEROCONF,
{zeroconf.HOMEKIT_TYPE: [{"domain": "homekit_controller"}]},
clear=True,
), patch.object(
hass.config_entr... | [
"async",
"def",
"test_homekit_match_partial_dash",
"(",
"hass",
",",
"mock_zeroconf",
")",
":",
"with",
"patch",
".",
"dict",
"(",
"zc_gen",
".",
"ZEROCONF",
",",
"{",
"zeroconf",
".",
"HOMEKIT_TYPE",
":",
"[",
"{",
"\"domain\"",
":",
"\"homekit_controller\"",
... | [
324,
0
] | [
344,
59
] | python | en | ['en', 'en', 'en'] | True |
test_homekit_match_full | (hass, mock_zeroconf) | Test configured options for a device are loaded via config entry. | Test configured options for a device are loaded via config entry. | async def test_homekit_match_full(hass, mock_zeroconf):
"""Test configured options for a device are loaded via config entry."""
with patch.dict(
zc_gen.ZEROCONF,
{zeroconf.HOMEKIT_TYPE: [{"domain": "homekit_controller"}]},
clear=True,
), patch.object(
hass.config_entries.flow... | [
"async",
"def",
"test_homekit_match_full",
"(",
"hass",
",",
"mock_zeroconf",
")",
":",
"with",
"patch",
".",
"dict",
"(",
"zc_gen",
".",
"ZEROCONF",
",",
"{",
"zeroconf",
".",
"HOMEKIT_TYPE",
":",
"[",
"{",
"\"domain\"",
":",
"\"homekit_controller\"",
"}",
... | [
347,
0
] | [
367,
56
] | python | en | ['en', 'en', 'en'] | True |
test_homekit_already_paired | (hass, mock_zeroconf) | Test that an already paired device is sent to homekit_controller. | Test that an already paired device is sent to homekit_controller. | async def test_homekit_already_paired(hass, mock_zeroconf):
"""Test that an already paired device is sent to homekit_controller."""
with patch.dict(
zc_gen.ZEROCONF,
{zeroconf.HOMEKIT_TYPE: [{"domain": "homekit_controller"}]},
clear=True,
), patch.object(
hass.config_entries.... | [
"async",
"def",
"test_homekit_already_paired",
"(",
"hass",
",",
"mock_zeroconf",
")",
":",
"with",
"patch",
".",
"dict",
"(",
"zc_gen",
".",
"ZEROCONF",
",",
"{",
"zeroconf",
".",
"HOMEKIT_TYPE",
":",
"[",
"{",
"\"domain\"",
":",
"\"homekit_controller\"",
"}"... | [
370,
0
] | [
391,
71
] | python | en | ['en', 'en', 'en'] | True |
test_homekit_invalid_paring_status | (hass, mock_zeroconf) | Test that missing paring data is not sent to homekit_controller. | Test that missing paring data is not sent to homekit_controller. | async def test_homekit_invalid_paring_status(hass, mock_zeroconf):
"""Test that missing paring data is not sent to homekit_controller."""
with patch.dict(
zc_gen.ZEROCONF,
{zeroconf.HOMEKIT_TYPE: [{"domain": "homekit_controller"}]},
clear=True,
), patch.object(
hass.config_en... | [
"async",
"def",
"test_homekit_invalid_paring_status",
"(",
"hass",
",",
"mock_zeroconf",
")",
":",
"with",
"patch",
".",
"dict",
"(",
"zc_gen",
".",
"ZEROCONF",
",",
"{",
"zeroconf",
".",
"HOMEKIT_TYPE",
":",
"[",
"{",
"\"domain\"",
":",
"\"homekit_controller\""... | [
394,
0
] | [
414,
57
] | python | en | ['en', 'en', 'en'] | True |
test_homekit_not_paired | (hass, mock_zeroconf) | Test that an not paired device is sent to homekit_controller. | Test that an not paired device is sent to homekit_controller. | async def test_homekit_not_paired(hass, mock_zeroconf):
"""Test that an not paired device is sent to homekit_controller."""
with patch.dict(
zc_gen.ZEROCONF,
{zeroconf.HOMEKIT_TYPE: [{"domain": "homekit_controller"}]},
clear=True,
), patch.object(
hass.config_entries.flow, "a... | [
"async",
"def",
"test_homekit_not_paired",
"(",
"hass",
",",
"mock_zeroconf",
")",
":",
"with",
"patch",
".",
"dict",
"(",
"zc_gen",
".",
"ZEROCONF",
",",
"{",
"zeroconf",
".",
"HOMEKIT_TYPE",
":",
"[",
"{",
"\"domain\"",
":",
"\"homekit_controller\"",
"}",
... | [
417,
0
] | [
437,
71
] | python | en | ['en', 'en', 'en'] | True |
test_info_from_service_non_utf8 | (hass) | Test info_from_service handles non UTF-8 property keys and values correctly. | Test info_from_service handles non UTF-8 property keys and values correctly. | async def test_info_from_service_non_utf8(hass):
"""Test info_from_service handles non UTF-8 property keys and values correctly."""
service_type = "_test._tcp.local."
info = zeroconf.info_from_service(
get_service_info_mock(service_type, f"test.{service_type}")
)
raw_info = info["properties"... | [
"async",
"def",
"test_info_from_service_non_utf8",
"(",
"hass",
")",
":",
"service_type",
"=",
"\"_test._tcp.local.\"",
"info",
"=",
"zeroconf",
".",
"info_from_service",
"(",
"get_service_info_mock",
"(",
"service_type",
",",
"f\"test.{service_type}\"",
")",
")",
"raw_... | [
440,
0
] | [
452,
55
] | python | en | ['en', 'en', 'en'] | True |
test_info_from_service_with_addresses | (hass) | Test info_from_service does not throw when there are no addresses. | Test info_from_service does not throw when there are no addresses. | async def test_info_from_service_with_addresses(hass):
"""Test info_from_service does not throw when there are no addresses."""
service_type = "_test._tcp.local."
info = zeroconf.info_from_service(
get_service_info_mock_without_an_address(service_type, f"test.{service_type}")
)
assert info i... | [
"async",
"def",
"test_info_from_service_with_addresses",
"(",
"hass",
")",
":",
"service_type",
"=",
"\"_test._tcp.local.\"",
"info",
"=",
"zeroconf",
".",
"info_from_service",
"(",
"get_service_info_mock_without_an_address",
"(",
"service_type",
",",
"f\"test.{service_type}\... | [
455,
0
] | [
461,
23
] | python | en | ['en', 'en', 'en'] | True |
test_get_instance | (hass, mock_zeroconf) | Test we get an instance. | Test we get an instance. | async def test_get_instance(hass, mock_zeroconf):
"""Test we get an instance."""
assert await async_setup_component(hass, zeroconf.DOMAIN, {zeroconf.DOMAIN: {}})
assert await hass.components.zeroconf.async_get_instance() is mock_zeroconf
hass.bus.async_fire(EVENT_HOMEASSISTANT_STOP)
await hass.async... | [
"async",
"def",
"test_get_instance",
"(",
"hass",
",",
"mock_zeroconf",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"zeroconf",
".",
"DOMAIN",
",",
"{",
"zeroconf",
".",
"DOMAIN",
":",
"{",
"}",
"}",
")",
"assert",
"await",
"has... | [
464,
0
] | [
470,
54
] | python | en | ['en', 'lb', 'en'] | True |
test_reproducing_states | (hass, caplog) | Test reproducing Remote states. | Test reproducing Remote states. | async def test_reproducing_states(hass, caplog):
"""Test reproducing Remote states."""
hass.states.async_set("remote.entity_off", "off", {})
hass.states.async_set("remote.entity_on", "on", {})
turn_on_calls = async_mock_service(hass, "remote", "turn_on")
turn_off_calls = async_mock_service(hass, "r... | [
"async",
"def",
"test_reproducing_states",
"(",
"hass",
",",
"caplog",
")",
":",
"hass",
".",
"states",
".",
"async_set",
"(",
"\"remote.entity_off\"",
",",
"\"off\"",
",",
"{",
"}",
")",
"hass",
".",
"states",
".",
"async_set",
"(",
"\"remote.entity_on\"",
... | [
6,
0
] | [
49,
70
] | python | en | ['en', 'en', 'en'] | True |
setup_platform | (hass, config, add_entities, discovery_info=None) | Set up Tellstick switches. | Set up Tellstick switches. | def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up Tellstick switches."""
if discovery_info is None or discovery_info[ATTR_DISCOVER_DEVICES] is None:
return
# Allow platform level override, fallback to module config
signal_repetitions = discovery_info.get(
AT... | [
"def",
"setup_platform",
"(",
"hass",
",",
"config",
",",
"add_entities",
",",
"discovery_info",
"=",
"None",
")",
":",
"if",
"discovery_info",
"is",
"None",
"or",
"discovery_info",
"[",
"ATTR_DISCOVER_DEVICES",
"]",
"is",
"None",
":",
"return",
"# Allow platfor... | [
12,
0
] | [
28,
5
] | python | en | ['en', 'en', 'en'] | True |
TellstickSwitch._parse_ha_data | (self, kwargs) | Turn the value from HA into something useful. | Turn the value from HA into something useful. | def _parse_ha_data(self, kwargs):
"""Turn the value from HA into something useful.""" | [
"def",
"_parse_ha_data",
"(",
"self",
",",
"kwargs",
")",
":"
] | [
34,
4
] | [
35,
59
] | python | en | ['en', 'en', 'en'] | True |
TellstickSwitch._parse_tellcore_data | (self, tellcore_data) | Turn the value received from tellcore into something useful. | Turn the value received from tellcore into something useful. | def _parse_tellcore_data(self, tellcore_data):
"""Turn the value received from tellcore into something useful.""" | [
"def",
"_parse_tellcore_data",
"(",
"self",
",",
"tellcore_data",
")",
":"
] | [
37,
4
] | [
38,
74
] | python | en | ['en', 'en', 'en'] | True |
TellstickSwitch._update_model | (self, new_state, data) | Update the device entity state to match the arguments. | Update the device entity state to match the arguments. | def _update_model(self, new_state, data):
"""Update the device entity state to match the arguments."""
self._state = new_state | [
"def",
"_update_model",
"(",
"self",
",",
"new_state",
",",
"data",
")",
":",
"self",
".",
"_state",
"=",
"new_state"
] | [
40,
4
] | [
42,
31
] | python | en | ['en', 'en', 'en'] | True |
TellstickSwitch._send_device_command | (self, requested_state, requested_data) | Let tellcore update the actual device to the requested state. | Let tellcore update the actual device to the requested state. | def _send_device_command(self, requested_state, requested_data):
"""Let tellcore update the actual device to the requested state."""
if requested_state:
self._tellcore_device.turn_on()
else:
self._tellcore_device.turn_off() | [
"def",
"_send_device_command",
"(",
"self",
",",
"requested_state",
",",
"requested_data",
")",
":",
"if",
"requested_state",
":",
"self",
".",
"_tellcore_device",
".",
"turn_on",
"(",
")",
"else",
":",
"self",
".",
"_tellcore_device",
".",
"turn_off",
"(",
")... | [
44,
4
] | [
49,
44
] | python | en | ['en', 'en', 'en'] | True |
TellstickSwitch.force_update | (self) | Will trigger anytime the state property is updated. | Will trigger anytime the state property is updated. | def force_update(self) -> bool:
"""Will trigger anytime the state property is updated."""
return True | [
"def",
"force_update",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"True"
] | [
52,
4
] | [
54,
19
] | python | en | ['en', 'en', 'en'] | True |
test_flow_works | (hass) | Test that config flow works. | Test that config flow works. | async def test_flow_works(hass):
"""Test that config flow works."""
flow = config_flow.EmulatedRokuFlowHandler()
flow.hass = hass
result = await flow.async_step_user(
user_input={"name": "Emulated Roku Test", "listen_port": 8060}
)
assert result["type"] == "create_entry"
assert resu... | [
"async",
"def",
"test_flow_works",
"(",
"hass",
")",
":",
"flow",
"=",
"config_flow",
".",
"EmulatedRokuFlowHandler",
"(",
")",
"flow",
".",
"hass",
"=",
"hass",
"result",
"=",
"await",
"flow",
".",
"async_step_user",
"(",
"user_input",
"=",
"{",
"\"name\"",... | [
6,
0
] | [
16,
80
] | python | en | ['en', 'en', 'en'] | True |
test_flow_already_registered_entry | (hass) | Test that config flow doesn't allow existing names. | Test that config flow doesn't allow existing names. | async def test_flow_already_registered_entry(hass):
"""Test that config flow doesn't allow existing names."""
MockConfigEntry(
domain="emulated_roku", data={"name": "Emulated Roku Test", "listen_port": 8062}
).add_to_hass(hass)
flow = config_flow.EmulatedRokuFlowHandler()
flow.hass = hass
... | [
"async",
"def",
"test_flow_already_registered_entry",
"(",
"hass",
")",
":",
"MockConfigEntry",
"(",
"domain",
"=",
"\"emulated_roku\"",
",",
"data",
"=",
"{",
"\"name\"",
":",
"\"Emulated Roku Test\"",
",",
"\"listen_port\"",
":",
"8062",
"}",
")",
".",
"add_to_h... | [
19,
0
] | [
30,
36
] | python | en | ['en', 'en', 'en'] | True |
test_fail_setup_without_state_topic | (hass, mqtt_mock) | Test for failing with no state topic. | Test for failing with no state topic. | async def test_fail_setup_without_state_topic(hass, mqtt_mock):
"""Test for failing with no state topic."""
with assert_setup_component(0) as config:
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
alarm_control_panel.DOMAIN: {
... | [
"async",
"def",
"test_fail_setup_without_state_topic",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"with",
"assert_setup_component",
"(",
"0",
")",
"as",
"config",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
... | [
26,
0
] | [
39,
53
] | python | en | ['en', 'en', 'en'] | True |
test_fail_setup_without_command_topic | (hass, mqtt_mock) | Test failing with no command topic. | Test failing with no command topic. | async def test_fail_setup_without_command_topic(hass, mqtt_mock):
"""Test failing with no command topic."""
with assert_setup_component(0):
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
alarm_control_panel.DOMAIN: {
... | [
"async",
"def",
"test_fail_setup_without_command_topic",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"with",
"assert_setup_component",
"(",
"0",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"a... | [
42,
0
] | [
54,
9
] | python | en | ['en', 'en', 'en'] | True |
test_arm_home_no_pending | (hass, mqtt_mock) | Test arm home method. | Test arm home method. | async def test_arm_home_no_pending(hass, mqtt_mock):
"""Test arm home method."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "test",
"code":... | [
"async",
"def",
"test_arm_home_no_pending",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
"\"manual_mqt... | [
57,
0
] | [
83,
69
] | python | en | ['en', 'be', 'en'] | True |
test_arm_home_no_pending_when_code_not_req | (hass, mqtt_mock) | Test arm home method. | Test arm home method. | async def test_arm_home_no_pending_when_code_not_req(hass, mqtt_mock):
"""Test arm home method."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "test",
... | [
"async",
"def",
"test_arm_home_no_pending_when_code_not_req",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":... | [
86,
0
] | [
113,
69
] | python | en | ['en', 'be', 'en'] | True |
test_arm_home_with_pending | (hass, mqtt_mock) | Test arm home method. | Test arm home method. | async def test_arm_home_with_pending(hass, mqtt_mock):
"""Test arm home method."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "test",
"code... | [
"async",
"def",
"test_arm_home_with_pending",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
"\"manual_m... | [
116,
0
] | [
155,
69
] | python | en | ['en', 'be', 'en'] | True |
test_arm_home_with_invalid_code | (hass, mqtt_mock) | Attempt to arm home without a valid code. | Attempt to arm home without a valid code. | async def test_arm_home_with_invalid_code(hass, mqtt_mock):
"""Attempt to arm home without a valid code."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "tes... | [
"async",
"def",
"test_arm_home_with_invalid_code",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
"\"man... | [
158,
0
] | [
184,
67
] | python | en | ['en', 'en', 'en'] | True |
test_arm_away_no_pending | (hass, mqtt_mock) | Test arm home method. | Test arm home method. | async def test_arm_away_no_pending(hass, mqtt_mock):
"""Test arm home method."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "test",
"code":... | [
"async",
"def",
"test_arm_away_no_pending",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
"\"manual_mqt... | [
187,
0
] | [
213,
69
] | python | en | ['en', 'be', 'en'] | True |
test_arm_away_no_pending_when_code_not_req | (hass, mqtt_mock) | Test arm home method. | Test arm home method. | async def test_arm_away_no_pending_when_code_not_req(hass, mqtt_mock):
"""Test arm home method."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "test",
... | [
"async",
"def",
"test_arm_away_no_pending_when_code_not_req",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":... | [
216,
0
] | [
243,
69
] | python | en | ['en', 'be', 'en'] | True |
test_arm_home_with_template_code | (hass, mqtt_mock) | Attempt to arm with a template-based code. | Attempt to arm with a template-based code. | async def test_arm_home_with_template_code(hass, mqtt_mock):
"""Attempt to arm with a template-based code."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "t... | [
"async",
"def",
"test_arm_home_with_template_code",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
"\"ma... | [
246,
0
] | [
273,
48
] | python | en | ['en', 'en', 'en'] | True |
test_arm_away_with_pending | (hass, mqtt_mock) | Test arm home method. | Test arm home method. | async def test_arm_away_with_pending(hass, mqtt_mock):
"""Test arm home method."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "test",
"code... | [
"async",
"def",
"test_arm_away_with_pending",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
"\"manual_m... | [
276,
0
] | [
315,
69
] | python | en | ['en', 'be', 'en'] | True |
test_arm_away_with_invalid_code | (hass, mqtt_mock) | Attempt to arm away without a valid code. | Attempt to arm away without a valid code. | async def test_arm_away_with_invalid_code(hass, mqtt_mock):
"""Attempt to arm away without a valid code."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "tes... | [
"async",
"def",
"test_arm_away_with_invalid_code",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
"\"man... | [
318,
0
] | [
344,
67
] | python | en | ['en', 'en', 'en'] | True |
test_arm_night_no_pending | (hass, mqtt_mock) | Test arm night method. | Test arm night method. | async def test_arm_night_no_pending(hass, mqtt_mock):
"""Test arm night method."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "test",
"code... | [
"async",
"def",
"test_arm_night_no_pending",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
"\"manual_mq... | [
347,
0
] | [
373,
70
] | python | en | ['en', 'et', 'en'] | True |
test_arm_night_no_pending_when_code_not_req | (hass, mqtt_mock) | Test arm night method. | Test arm night method. | async def test_arm_night_no_pending_when_code_not_req(hass, mqtt_mock):
"""Test arm night method."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "test",
... | [
"async",
"def",
"test_arm_night_no_pending_when_code_not_req",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
"... | [
376,
0
] | [
403,
70
] | python | en | ['en', 'et', 'en'] | True |
test_arm_night_with_pending | (hass, mqtt_mock) | Test arm night method. | Test arm night method. | async def test_arm_night_with_pending(hass, mqtt_mock):
"""Test arm night method."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "test",
"co... | [
"async",
"def",
"test_arm_night_with_pending",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
"\"manual_... | [
406,
0
] | [
451,
70
] | python | en | ['en', 'et', 'en'] | True |
test_arm_night_with_invalid_code | (hass, mqtt_mock) | Attempt to arm night without a valid code. | Attempt to arm night without a valid code. | async def test_arm_night_with_invalid_code(hass, mqtt_mock):
"""Attempt to arm night without a valid code."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "t... | [
"async",
"def",
"test_arm_night_with_invalid_code",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
"\"ma... | [
454,
0
] | [
480,
67
] | python | en | ['en', 'en', 'en'] | True |
test_trigger_no_pending | (hass, mqtt_mock) | Test triggering when no pending submitted method. | Test triggering when no pending submitted method. | async def test_trigger_no_pending(hass, mqtt_mock):
"""Test triggering when no pending submitted method."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "tes... | [
"async",
"def",
"test_trigger_no_pending",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
"\"manual_mqtt... | [
483,
0
] | [
518,
68
] | python | en | ['en', 'en', 'en'] | True |
test_trigger_with_delay | (hass, mqtt_mock) | Test trigger method and switch from pending to triggered. | Test trigger method and switch from pending to triggered. | async def test_trigger_with_delay(hass, mqtt_mock):
"""Test trigger method and switch from pending to triggered."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"nam... | [
"async",
"def",
"test_trigger_with_delay",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
"\"manual_mqtt... | [
521,
0
] | [
566,
47
] | python | en | ['en', 'en', 'en'] | True |
test_trigger_zero_trigger_time | (hass, mqtt_mock) | Test disabled trigger. | Test disabled trigger. | async def test_trigger_zero_trigger_time(hass, mqtt_mock):
"""Test disabled trigger."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "test",
... | [
"async",
"def",
"test_trigger_zero_trigger_time",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
"\"manu... | [
569,
0
] | [
595,
67
] | python | en | ['en', 'da', 'en'] | True |
test_trigger_zero_trigger_time_with_pending | (hass, mqtt_mock) | Test disabled trigger. | Test disabled trigger. | async def test_trigger_zero_trigger_time_with_pending(hass, mqtt_mock):
"""Test disabled trigger."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "test",
... | [
"async",
"def",
"test_trigger_zero_trigger_time_with_pending",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
"... | [
598,
0
] | [
624,
67
] | python | en | ['en', 'da', 'en'] | True |
test_trigger_with_pending | (hass, mqtt_mock) | Test arm home method. | Test arm home method. | async def test_trigger_with_pending(hass, mqtt_mock):
"""Test arm home method."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "test",
"pendi... | [
"async",
"def",
"test_trigger_with_pending",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
"\"manual_mq... | [
627,
0
] | [
676,
67
] | python | en | ['en', 'be', 'en'] | True |
test_trigger_with_disarm_after_trigger | (hass, mqtt_mock) | Test disarm after trigger. | Test disarm after trigger. | async def test_trigger_with_disarm_after_trigger(hass, mqtt_mock):
"""Test disarm after trigger."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "test",
... | [
"async",
"def",
"test_trigger_with_disarm_after_trigger",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
... | [
679,
0
] | [
715,
67
] | python | da | ['da', 'da', 'en'] | True |
test_trigger_with_zero_specific_trigger_time | (hass, mqtt_mock) | Test trigger method. | Test trigger method. | async def test_trigger_with_zero_specific_trigger_time(hass, mqtt_mock):
"""Test trigger method."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "test",
... | [
"async",
"def",
"test_trigger_with_zero_specific_trigger_time",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
... | [
718,
0
] | [
745,
67
] | python | da | ['da', 'da', 'en'] | True |
test_trigger_with_unused_zero_specific_trigger_time | (hass, mqtt_mock) | Test disarm after trigger. | Test disarm after trigger. | async def test_trigger_with_unused_zero_specific_trigger_time(hass, mqtt_mock):
"""Test disarm after trigger."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name":... | [
"async",
"def",
"test_trigger_with_unused_zero_specific_trigger_time",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform... | [
748,
0
] | [
785,
67
] | python | da | ['da', 'da', 'en'] | True |
test_trigger_with_specific_trigger_time | (hass, mqtt_mock) | Test disarm after trigger. | Test disarm after trigger. | async def test_trigger_with_specific_trigger_time(hass, mqtt_mock):
"""Test disarm after trigger."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "test",
... | [
"async",
"def",
"test_trigger_with_specific_trigger_time",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
... | [
788,
0
] | [
824,
67
] | python | da | ['da', 'da', 'en'] | True |
test_back_to_back_trigger_with_no_disarm_after_trigger | (hass, mqtt_mock) | Test no disarm after back to back trigger. | Test no disarm after back to back trigger. | async def test_back_to_back_trigger_with_no_disarm_after_trigger(hass, mqtt_mock):
"""Test no disarm after back to back trigger."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
... | [
"async",
"def",
"test_back_to_back_trigger_with_no_disarm_after_trigger",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platf... | [
827,
0
] | [
883,
69
] | python | en | ['en', 'da', 'en'] | True |
test_disarm_while_pending_trigger | (hass, mqtt_mock) | Test disarming while pending state. | Test disarming while pending state. | async def test_disarm_while_pending_trigger(hass, mqtt_mock):
"""Test disarming while pending state."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "test",
... | [
"async",
"def",
"test_disarm_while_pending_trigger",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
"\"m... | [
886,
0
] | [
926,
67
] | python | en | ['en', 'en', 'en'] | True |
test_disarm_during_trigger_with_invalid_code | (hass, mqtt_mock) | Test disarming while code is invalid. | Test disarming while code is invalid. | async def test_disarm_during_trigger_with_invalid_code(hass, mqtt_mock):
"""Test disarming while code is invalid."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"na... | [
"async",
"def",
"test_disarm_during_trigger_with_invalid_code",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
... | [
929,
0
] | [
970,
68
] | python | en | ['en', 'en', 'en'] | True |
test_trigger_with_unused_specific_delay | (hass, mqtt_mock) | Test trigger method and switch from pending to triggered. | Test trigger method and switch from pending to triggered. | async def test_trigger_with_unused_specific_delay(hass, mqtt_mock):
"""Test trigger method and switch from pending to triggered."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
... | [
"async",
"def",
"test_trigger_with_unused_specific_delay",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
... | [
973,
0
] | [
1019,
47
] | python | en | ['en', 'en', 'en'] | True |
test_trigger_with_specific_delay | (hass, mqtt_mock) | Test trigger method and switch from pending to triggered. | Test trigger method and switch from pending to triggered. | async def test_trigger_with_specific_delay(hass, mqtt_mock):
"""Test trigger method and switch from pending to triggered."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
... | [
"async",
"def",
"test_trigger_with_specific_delay",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
"\"ma... | [
1022,
0
] | [
1068,
47
] | python | en | ['en', 'en', 'en'] | True |
test_trigger_with_pending_and_delay | (hass, mqtt_mock) | Test trigger method and switch from pending to triggered. | Test trigger method and switch from pending to triggered. | async def test_trigger_with_pending_and_delay(hass, mqtt_mock):
"""Test trigger method and switch from pending to triggered."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
... | [
"async",
"def",
"test_trigger_with_pending_and_delay",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
"\... | [
1071,
0
] | [
1129,
47
] | python | en | ['en', 'en', 'en'] | True |
test_trigger_with_pending_and_specific_delay | (hass, mqtt_mock) | Test trigger method and switch from pending to triggered. | Test trigger method and switch from pending to triggered. | async def test_trigger_with_pending_and_specific_delay(hass, mqtt_mock):
"""Test trigger method and switch from pending to triggered."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",... | [
"async",
"def",
"test_trigger_with_pending_and_specific_delay",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
... | [
1132,
0
] | [
1191,
47
] | python | en | ['en', 'en', 'en'] | True |
test_armed_home_with_specific_pending | (hass, mqtt_mock) | Test arm home method. | Test arm home method. | async def test_armed_home_with_specific_pending(hass, mqtt_mock):
"""Test arm home method."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "test",
... | [
"async",
"def",
"test_armed_home_with_specific_pending",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
... | [
1194,
0
] | [
1227,
69
] | python | en | ['en', 'be', 'en'] | True |
test_armed_away_with_specific_pending | (hass, mqtt_mock) | Test arm home method. | Test arm home method. | async def test_armed_away_with_specific_pending(hass, mqtt_mock):
"""Test arm home method."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "test",
... | [
"async",
"def",
"test_armed_away_with_specific_pending",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
... | [
1230,
0
] | [
1263,
69
] | python | en | ['en', 'be', 'en'] | True |
test_armed_night_with_specific_pending | (hass, mqtt_mock) | Test arm home method. | Test arm home method. | async def test_armed_night_with_specific_pending(hass, mqtt_mock):
"""Test arm home method."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "test",
... | [
"async",
"def",
"test_armed_night_with_specific_pending",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
... | [
1266,
0
] | [
1299,
70
] | python | en | ['en', 'be', 'en'] | True |
test_trigger_with_specific_pending | (hass, mqtt_mock) | Test arm home method. | Test arm home method. | async def test_trigger_with_specific_pending(hass, mqtt_mock):
"""Test arm home method."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
"name": "test",
... | [
"async",
"def",
"test_trigger_with_specific_pending",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
"\"... | [
1302,
0
] | [
1347,
67
] | python | en | ['en', 'be', 'en'] | True |
test_arm_away_after_disabled_disarmed | (hass, legacy_patchable_time, mqtt_mock) | Test pending state with and without zero trigger time. | Test pending state with and without zero trigger time. | async def test_arm_away_after_disabled_disarmed(hass, legacy_patchable_time, mqtt_mock):
"""Test pending state with and without zero trigger time."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "... | [
"async",
"def",
"test_arm_away_after_disabled_disarmed",
"(",
"hass",
",",
"legacy_patchable_time",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
... | [
1350,
0
] | [
1420,
47
] | python | en | ['en', 'en', 'en'] | True |
test_disarm_with_template_code | (hass, mqtt_mock) | Attempt to disarm with a valid or invalid template-based code. | Attempt to disarm with a valid or invalid template-based code. | async def test_disarm_with_template_code(hass, mqtt_mock):
"""Attempt to disarm with a valid or invalid template-based code."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
"alarm_control_panel": {
"platform": "manual_mqtt",
... | [
"async",
"def",
"test_disarm_with_template_code",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"\"alarm_control_panel\"",
":",
"{",
"\"platform\"",
":",
"\"manu... | [
1423,
0
] | [
1462,
46
] | python | en | ['en', 'en', 'en'] | True |
test_arm_home_via_command_topic | (hass, mqtt_mock) | Test arming home via command topic. | Test arming home via command topic. | async def test_arm_home_via_command_topic(hass, mqtt_mock):
"""Test arming home via command topic."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
alarm_control_panel.DOMAIN: {
"platform": "manual_mqtt",
"name": "test... | [
"async",
"def",
"test_arm_home_via_command_topic",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"alarm_control_panel",
".",
"DOMAIN",
":",
"{",
"\"platform\"",
... | [
1465,
0
] | [
1501,
69
] | python | en | ['en', 'en', 'en'] | True |
test_arm_away_via_command_topic | (hass, mqtt_mock) | Test arming away via command topic. | Test arming away via command topic. | async def test_arm_away_via_command_topic(hass, mqtt_mock):
"""Test arming away via command topic."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
alarm_control_panel.DOMAIN: {
"platform": "manual_mqtt",
"name": "test... | [
"async",
"def",
"test_arm_away_via_command_topic",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"alarm_control_panel",
".",
"DOMAIN",
":",
"{",
"\"platform\"",
... | [
1504,
0
] | [
1540,
69
] | python | en | ['en', 'en', 'en'] | True |
test_arm_night_via_command_topic | (hass, mqtt_mock) | Test arming night via command topic. | Test arming night via command topic. | async def test_arm_night_via_command_topic(hass, mqtt_mock):
"""Test arming night via command topic."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
alarm_control_panel.DOMAIN: {
"platform": "manual_mqtt",
"name": "te... | [
"async",
"def",
"test_arm_night_via_command_topic",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"alarm_control_panel",
".",
"DOMAIN",
":",
"{",
"\"platform\"",... | [
1543,
0
] | [
1579,
70
] | python | en | ['en', 'en', 'en'] | True |
test_disarm_pending_via_command_topic | (hass, mqtt_mock) | Test disarming pending alarm via command topic. | Test disarming pending alarm via command topic. | async def test_disarm_pending_via_command_topic(hass, mqtt_mock):
"""Test disarming pending alarm via command topic."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
alarm_control_panel.DOMAIN: {
"platform": "manual_mqtt",
... | [
"async",
"def",
"test_disarm_pending_via_command_topic",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"alarm_control_panel",
".",
"DOMAIN",
":",
"{",
"\"platfor... | [
1582,
0
] | [
1613,
67
] | python | en | ['en', 'la', 'it'] | False |
test_state_changes_are_published_to_mqtt | (hass, mqtt_mock) | Test publishing of MQTT messages when state changes. | Test publishing of MQTT messages when state changes. | async def test_state_changes_are_published_to_mqtt(hass, mqtt_mock):
"""Test publishing of MQTT messages when state changes."""
assert await async_setup_component(
hass,
alarm_control_panel.DOMAIN,
{
alarm_control_panel.DOMAIN: {
"platform": "manual_mqtt",
... | [
"async",
"def",
"test_state_changes_are_published_to_mqtt",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"alarm_control_panel",
".",
"DOMAIN",
",",
"{",
"alarm_control_panel",
".",
"DOMAIN",
":",
"{",
"\"plat... | [
1616,
0
] | [
1706,
5
] | python | en | ['en', 'en', 'en'] | True |
add_eventstream | (hass, sub_topic=None, pub_topic=None, ignore_event=None) | Add a mqtt_eventstream component. | Add a mqtt_eventstream component. | async def add_eventstream(hass, sub_topic=None, pub_topic=None, ignore_event=None):
"""Add a mqtt_eventstream component."""
config = {}
if sub_topic:
config["subscribe_topic"] = sub_topic
if pub_topic:
config["publish_topic"] = pub_topic
if ignore_event:
config["ignore_event"... | [
"async",
"def",
"add_eventstream",
"(",
"hass",
",",
"sub_topic",
"=",
"None",
",",
"pub_topic",
"=",
"None",
",",
"ignore_event",
"=",
"None",
")",
":",
"config",
"=",
"{",
"}",
"if",
"sub_topic",
":",
"config",
"[",
"\"subscribe_topic\"",
"]",
"=",
"su... | [
18,
0
] | [
29,
5
] | python | en | ['en', 'lb', 'it'] | False |
test_setup_succeeds | (hass, mqtt_mock) | Test the success of the setup. | Test the success of the setup. | async def test_setup_succeeds(hass, mqtt_mock):
"""Test the success of the setup."""
assert await add_eventstream(hass) | [
"async",
"def",
"test_setup_succeeds",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"add_eventstream",
"(",
"hass",
")"
] | [
32,
0
] | [
34,
38
] | python | en | ['en', 'en', 'en'] | True |
test_setup_with_pub | (hass, mqtt_mock) | Test the setup with subscription. | Test the setup with subscription. | async def test_setup_with_pub(hass, mqtt_mock):
"""Test the setup with subscription."""
# Should start off with no listeners for all events
assert hass.bus.async_listeners().get("*") is None
assert await add_eventstream(hass, pub_topic="bar")
await hass.async_block_till_done()
# Verify that th... | [
"async",
"def",
"test_setup_with_pub",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"# Should start off with no listeners for all events",
"assert",
"hass",
".",
"bus",
".",
"async_listeners",
"(",
")",
".",
"get",
"(",
"\"*\"",
")",
"is",
"None",
"assert",
"await",
... | [
37,
0
] | [
46,
51
] | 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.