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_form_cannot_connect | (hass) | Test we handle cannot connect error. | Test we handle cannot connect error. | async def test_form_cannot_connect(hass):
"""Test we handle cannot connect error."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_USER}
)
with patch(
"pysma.SMA.new_session", side_effect=SmaConnectionException
), _patch_async_setup_entry() as... | [
"async",
"def",
"test_form_cannot_connect",
"(",
"hass",
")",
":",
"result",
"=",
"await",
"hass",
".",
"config_entries",
".",
"flow",
".",
"async_init",
"(",
"DOMAIN",
",",
"context",
"=",
"{",
"\"source\"",
":",
"SOURCE_USER",
"}",
")",
"with",
"patch",
... | [
53,
0
] | [
69,
48
] | python | en | ['en', 'en', 'en'] | True |
test_form_invalid_auth | (hass) | Test we handle invalid auth error. | Test we handle invalid auth error. | async def test_form_invalid_auth(hass):
"""Test we handle invalid auth error."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_USER}
)
with patch(
"pysma.SMA.new_session", side_effect=SmaAuthenticationException
), _patch_async_setup_entry() as... | [
"async",
"def",
"test_form_invalid_auth",
"(",
"hass",
")",
":",
"result",
"=",
"await",
"hass",
".",
"config_entries",
".",
"flow",
".",
"async_init",
"(",
"DOMAIN",
",",
"context",
"=",
"{",
"\"source\"",
":",
"SOURCE_USER",
"}",
")",
"with",
"patch",
"(... | [
72,
0
] | [
88,
48
] | python | de | ['de', 'et', 'en'] | False |
test_form_cannot_retrieve_device_info | (hass) | Test we handle cannot retrieve device info error. | Test we handle cannot retrieve device info error. | async def test_form_cannot_retrieve_device_info(hass):
"""Test we handle cannot retrieve device info error."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_USER}
)
with patch("pysma.SMA.new_session", return_value=True), patch(
"pysma.SMA.read", s... | [
"async",
"def",
"test_form_cannot_retrieve_device_info",
"(",
"hass",
")",
":",
"result",
"=",
"await",
"hass",
".",
"config_entries",
".",
"flow",
".",
"async_init",
"(",
"DOMAIN",
",",
"context",
"=",
"{",
"\"source\"",
":",
"SOURCE_USER",
"}",
")",
"with",
... | [
91,
0
] | [
107,
48
] | python | en | ['en', 'ro', 'en'] | True |
test_form_unexpected_exception | (hass) | Test we handle unexpected exception. | Test we handle unexpected exception. | async def test_form_unexpected_exception(hass):
"""Test we handle unexpected exception."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_USER}
)
with patch(
"pysma.SMA.new_session", side_effect=Exception
), _patch_async_setup_entry() as mock_s... | [
"async",
"def",
"test_form_unexpected_exception",
"(",
"hass",
")",
":",
"result",
"=",
"await",
"hass",
".",
"config_entries",
".",
"flow",
".",
"async_init",
"(",
"DOMAIN",
",",
"context",
"=",
"{",
"\"source\"",
":",
"SOURCE_USER",
"}",
")",
"with",
"patc... | [
110,
0
] | [
126,
48
] | python | en | ['de', 'en', 'en'] | True |
test_form_already_configured | (hass, mock_config_entry) | Test starting a flow by user when already configured. | Test starting a flow by user when already configured. | async def test_form_already_configured(hass, mock_config_entry):
"""Test starting a flow by user when already configured."""
mock_config_entry.add_to_hass(hass)
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_USER}
)
with patch("pysma.SMA.new_session",... | [
"async",
"def",
"test_form_already_configured",
"(",
"hass",
",",
"mock_config_entry",
")",
":",
"mock_config_entry",
".",
"add_to_hass",
"(",
"hass",
")",
"result",
"=",
"await",
"hass",
".",
"config_entries",
".",
"flow",
".",
"async_init",
"(",
"DOMAIN",
",",... | [
129,
0
] | [
150,
48
] | python | en | ['en', 'en', 'en'] | True |
test_import | (hass) | Test we can import. | Test we can import. | async def test_import(hass):
"""Test we can import."""
await setup.async_setup_component(hass, "persistent_notification", {})
with patch("pysma.SMA.new_session", return_value=True), patch(
"pysma.SMA.device_info", return_value=MOCK_DEVICE
), patch(
"pysma.SMA.close_session", return_valu... | [
"async",
"def",
"test_import",
"(",
"hass",
")",
":",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"persistent_notification\"",
",",
"{",
"}",
")",
"with",
"patch",
"(",
"\"pysma.SMA.new_session\"",
",",
"return_value",
"=",
"True",
")",
... | [
153,
0
] | [
171,
48
] | python | en | ['en', 'en', 'en'] | True |
test_import_sensor_dict | (hass) | Test we can import. | Test we can import. | async def test_import_sensor_dict(hass):
"""Test we can import."""
await setup.async_setup_component(hass, "persistent_notification", {})
with patch("pysma.SMA.new_session", return_value=True), patch(
"pysma.SMA.device_info", return_value=MOCK_DEVICE
), patch(
"pysma.SMA.close_session",... | [
"async",
"def",
"test_import_sensor_dict",
"(",
"hass",
")",
":",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"persistent_notification\"",
",",
"{",
"}",
")",
"with",
"patch",
"(",
"\"pysma.SMA.new_session\"",
",",
"return_value",
"=",
"Tru... | [
174,
0
] | [
192,
48
] | python | en | ['en', 'en', 'en'] | True |
NetatmoBase.__init__ | (self, data_handler: NetatmoDataHandler) | Set up Netatmo entity base. | Set up Netatmo entity base. | def __init__(self, data_handler: NetatmoDataHandler) -> None:
"""Set up Netatmo entity base."""
self.data_handler = data_handler
self._data_classes: list[dict] = []
self._listeners: list[CALLBACK_TYPE] = []
self._device_name: str = ""
self._id: str = ""
self._mod... | [
"def",
"__init__",
"(",
"self",
",",
"data_handler",
":",
"NetatmoDataHandler",
")",
"->",
"None",
":",
"self",
".",
"data_handler",
"=",
"data_handler",
"self",
".",
"_data_classes",
":",
"list",
"[",
"dict",
"]",
"=",
"[",
"]",
"self",
".",
"_listeners",... | [
21,
4
] | [
32,
83
] | python | en | ['en', 'zu', 'en'] | True |
NetatmoBase.async_added_to_hass | (self) | Entity created. | Entity created. | async def async_added_to_hass(self) -> None:
"""Entity created."""
for data_class in self._data_classes:
signal_name = data_class[SIGNAL_NAME]
if "home_id" in data_class:
await self.data_handler.register_data_class(
data_class["name"],
... | [
"async",
"def",
"async_added_to_hass",
"(",
"self",
")",
"->",
"None",
":",
"for",
"data_class",
"in",
"self",
".",
"_data_classes",
":",
"signal_name",
"=",
"data_class",
"[",
"SIGNAL_NAME",
"]",
"if",
"\"home_id\"",
"in",
"data_class",
":",
"await",
"self",
... | [
34,
4
] | [
71,
36
] | python | en | ['en', 'sm', 'en'] | False |
NetatmoBase.async_will_remove_from_hass | (self) | Run when entity will be removed from hass. | Run when entity will be removed from hass. | async def async_will_remove_from_hass(self) -> None:
"""Run when entity will be removed from hass."""
await super().async_will_remove_from_hass()
for listener in self._listeners:
listener()
for data_class in self._data_classes:
await self.data_handler.unregister... | [
"async",
"def",
"async_will_remove_from_hass",
"(",
"self",
")",
"->",
"None",
":",
"await",
"super",
"(",
")",
".",
"async_will_remove_from_hass",
"(",
")",
"for",
"listener",
"in",
"self",
".",
"_listeners",
":",
"listener",
"(",
")",
"for",
"data_class",
... | [
73,
4
] | [
83,
13
] | python | en | ['en', 'en', 'en'] | True |
NetatmoBase.async_update_callback | (self) | Update the entity's state. | Update the entity's state. | def async_update_callback(self) -> None:
"""Update the entity's state."""
raise NotImplementedError | [
"def",
"async_update_callback",
"(",
"self",
")",
"->",
"None",
":",
"raise",
"NotImplementedError"
] | [
86,
4
] | [
88,
33
] | python | en | ['en', 'en', 'en'] | True |
NetatmoBase.device_info | (self) | Return the device info for the sensor. | Return the device info for the sensor. | def device_info(self) -> DeviceInfo:
"""Return the device info for the sensor."""
return {
"identifiers": {(DOMAIN, self._id)},
"name": self._device_name,
"manufacturer": MANUFACTURER,
"model": MODELS[self._model],
} | [
"def",
"device_info",
"(",
"self",
")",
"->",
"DeviceInfo",
":",
"return",
"{",
"\"identifiers\"",
":",
"{",
"(",
"DOMAIN",
",",
"self",
".",
"_id",
")",
"}",
",",
"\"name\"",
":",
"self",
".",
"_device_name",
",",
"\"manufacturer\"",
":",
"MANUFACTURER",
... | [
91,
4
] | [
98,
9
] | python | en | ['en', 'no', 'en'] | True |
setup_platform | (hass, config, add_entities, discovery_info=None) | Set up the Demo geolocations. | Set up the Demo geolocations. | def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Demo geolocations."""
DemoManager(hass, add_entities) | [
"def",
"setup_platform",
"(",
"hass",
",",
"config",
",",
"add_entities",
",",
"discovery_info",
"=",
"None",
")",
":",
"DemoManager",
"(",
"hass",
",",
"add_entities",
")"
] | [
40,
0
] | [
42,
35
] | python | en | ['en', 'en', 'en'] | True |
DemoManager.__init__ | (self, hass, add_entities) | Initialise the demo geolocation event manager. | Initialise the demo geolocation event manager. | def __init__(self, hass, add_entities):
"""Initialise the demo geolocation event manager."""
self._hass = hass
self._add_entities = add_entities
self._managed_devices = []
self._update(count=NUMBER_OF_DEMO_DEVICES)
self._init_regular_updates() | [
"def",
"__init__",
"(",
"self",
",",
"hass",
",",
"add_entities",
")",
":",
"self",
".",
"_hass",
"=",
"hass",
"self",
".",
"_add_entities",
"=",
"add_entities",
"self",
".",
"_managed_devices",
"=",
"[",
"]",
"self",
".",
"_update",
"(",
"count",
"=",
... | [
48,
4
] | [
54,
36
] | python | en | ['en', 'en', 'en'] | True |
DemoManager._generate_random_event | (self) | Generate a random event in vicinity of this HA instance. | Generate a random event in vicinity of this HA instance. | def _generate_random_event(self):
"""Generate a random event in vicinity of this HA instance."""
home_latitude = self._hass.config.latitude
home_longitude = self._hass.config.longitude
# Approx. 111km per degree (north-south).
radius_in_degrees = random.random() * MAX_RADIUS_IN_... | [
"def",
"_generate_random_event",
"(",
"self",
")",
":",
"home_latitude",
"=",
"self",
".",
"_hass",
".",
"config",
".",
"latitude",
"home_longitude",
"=",
"self",
".",
"_hass",
".",
"config",
".",
"longitude",
"# Approx. 111km per degree (north-south).",
"radius_in_... | [
56,
4
] | [
75,
9
] | python | en | ['en', 'en', 'en'] | True |
DemoManager._init_regular_updates | (self) | Schedule regular updates based on configured time interval. | Schedule regular updates based on configured time interval. | def _init_regular_updates(self):
"""Schedule regular updates based on configured time interval."""
track_time_interval(
self._hass, lambda now: self._update(), DEFAULT_UPDATE_INTERVAL
) | [
"def",
"_init_regular_updates",
"(",
"self",
")",
":",
"track_time_interval",
"(",
"self",
".",
"_hass",
",",
"lambda",
"now",
":",
"self",
".",
"_update",
"(",
")",
",",
"DEFAULT_UPDATE_INTERVAL",
")"
] | [
77,
4
] | [
81,
9
] | python | en | ['en', 'da', 'en'] | True |
DemoManager._update | (self, count=1) | Remove events and add new random events. | Remove events and add new random events. | def _update(self, count=1):
"""Remove events and add new random events."""
# Remove devices.
for _ in range(1, count + 1):
if self._managed_devices:
device = random.choice(self._managed_devices)
if device:
_LOGGER.debug("Removing %s... | [
"def",
"_update",
"(",
"self",
",",
"count",
"=",
"1",
")",
":",
"# Remove devices.",
"for",
"_",
"in",
"range",
"(",
"1",
",",
"count",
"+",
"1",
")",
":",
"if",
"self",
".",
"_managed_devices",
":",
"device",
"=",
"random",
".",
"choice",
"(",
"s... | [
83,
4
] | [
100,
39
] | python | en | ['en', 'en', 'en'] | True |
DemoGeolocationEvent.__init__ | (self, name, distance, latitude, longitude, unit_of_measurement) | Initialize entity with data provided. | Initialize entity with data provided. | def __init__(self, name, distance, latitude, longitude, unit_of_measurement):
"""Initialize entity with data provided."""
self._name = name
self._distance = distance
self._latitude = latitude
self._longitude = longitude
self._unit_of_measurement = unit_of_measurement | [
"def",
"__init__",
"(",
"self",
",",
"name",
",",
"distance",
",",
"latitude",
",",
"longitude",
",",
"unit_of_measurement",
")",
":",
"self",
".",
"_name",
"=",
"name",
"self",
".",
"_distance",
"=",
"distance",
"self",
".",
"_latitude",
"=",
"latitude",
... | [
106,
4
] | [
112,
55
] | python | en | ['en', 'en', 'en'] | True |
DemoGeolocationEvent.source | (self) | Return source value of this external event. | Return source value of this external event. | def source(self) -> str:
"""Return source value of this external event."""
return SOURCE | [
"def",
"source",
"(",
"self",
")",
"->",
"str",
":",
"return",
"SOURCE"
] | [
115,
4
] | [
117,
21
] | python | en | ['en', 'en', 'en'] | True |
DemoGeolocationEvent.name | (self) | Return the name of the event. | Return the name of the event. | def name(self) -> str | None:
"""Return the name of the event."""
return self._name | [
"def",
"name",
"(",
"self",
")",
"->",
"str",
"|",
"None",
":",
"return",
"self",
".",
"_name"
] | [
120,
4
] | [
122,
25
] | python | en | ['en', 'en', 'en'] | True |
DemoGeolocationEvent.should_poll | (self) | No polling needed for a demo geolocation event. | No polling needed for a demo geolocation event. | def should_poll(self):
"""No polling needed for a demo geolocation event."""
return False | [
"def",
"should_poll",
"(",
"self",
")",
":",
"return",
"False"
] | [
125,
4
] | [
127,
20
] | python | en | ['en', 'en', 'en'] | True |
DemoGeolocationEvent.distance | (self) | Return distance value of this external event. | Return distance value of this external event. | def distance(self) -> float | None:
"""Return distance value of this external event."""
return self._distance | [
"def",
"distance",
"(",
"self",
")",
"->",
"float",
"|",
"None",
":",
"return",
"self",
".",
"_distance"
] | [
130,
4
] | [
132,
29
] | python | en | ['en', 'en', 'en'] | True |
DemoGeolocationEvent.latitude | (self) | Return latitude value of this external event. | Return latitude value of this external event. | def latitude(self) -> float | None:
"""Return latitude value of this external event."""
return self._latitude | [
"def",
"latitude",
"(",
"self",
")",
"->",
"float",
"|",
"None",
":",
"return",
"self",
".",
"_latitude"
] | [
135,
4
] | [
137,
29
] | python | en | ['en', 'la', 'en'] | True |
DemoGeolocationEvent.longitude | (self) | Return longitude value of this external event. | Return longitude value of this external event. | def longitude(self) -> float | None:
"""Return longitude value of this external event."""
return self._longitude | [
"def",
"longitude",
"(",
"self",
")",
"->",
"float",
"|",
"None",
":",
"return",
"self",
".",
"_longitude"
] | [
140,
4
] | [
142,
30
] | python | en | ['en', 'en', 'en'] | True |
DemoGeolocationEvent.unit_of_measurement | (self) | Return the unit of measurement. | Return the unit of measurement. | def unit_of_measurement(self):
"""Return the unit of measurement."""
return self._unit_of_measurement | [
"def",
"unit_of_measurement",
"(",
"self",
")",
":",
"return",
"self",
".",
"_unit_of_measurement"
] | [
145,
4
] | [
147,
40
] | python | en | ['en', 'la', 'en'] | True |
BaseDiscoverySchemaDataTemplate.resolve_data | (self, value: ZwaveValue) |
Resolve helper class data for a discovered value.
Can optionally be implemented by subclasses if input data needs to be
transformed once discovered Value is available.
|
Resolve helper class data for a discovered value. | def resolve_data(self, value: ZwaveValue) -> Any:
"""
Resolve helper class data for a discovered value.
Can optionally be implemented by subclasses if input data needs to be
transformed once discovered Value is available.
"""
# pylint: disable=no-self-use
return ... | [
"def",
"resolve_data",
"(",
"self",
",",
"value",
":",
"ZwaveValue",
")",
"->",
"Any",
":",
"# pylint: disable=no-self-use",
"return",
"{",
"}"
] | [
97,
4
] | [
105,
17
] | python | en | ['en', 'error', 'th'] | False |
BaseDiscoverySchemaDataTemplate.values_to_watch | (self, resolved_data: Any) |
Return list of all ZwaveValues resolved by helper that should be watched.
Should be implemented by subclasses only if there are values to watch.
|
Return list of all ZwaveValues resolved by helper that should be watched. | def values_to_watch(self, resolved_data: Any) -> Iterable[ZwaveValue]:
"""
Return list of all ZwaveValues resolved by helper that should be watched.
Should be implemented by subclasses only if there are values to watch.
"""
# pylint: disable=no-self-use
return [] | [
"def",
"values_to_watch",
"(",
"self",
",",
"resolved_data",
":",
"Any",
")",
"->",
"Iterable",
"[",
"ZwaveValue",
"]",
":",
"# pylint: disable=no-self-use",
"return",
"[",
"]"
] | [
107,
4
] | [
114,
17
] | python | en | ['en', 'error', 'th'] | False |
BaseDiscoverySchemaDataTemplate.value_ids_to_watch | (self, resolved_data: Any) |
Return list of all Value IDs resolved by helper that should be watched.
Not to be overwritten by subclasses.
|
Return list of all Value IDs resolved by helper that should be watched. | def value_ids_to_watch(self, resolved_data: Any) -> set[str]:
"""
Return list of all Value IDs resolved by helper that should be watched.
Not to be overwritten by subclasses.
"""
return {val.value_id for val in self.values_to_watch(resolved_data) if val} | [
"def",
"value_ids_to_watch",
"(",
"self",
",",
"resolved_data",
":",
"Any",
")",
"->",
"set",
"[",
"str",
"]",
":",
"return",
"{",
"val",
".",
"value_id",
"for",
"val",
"in",
"self",
".",
"values_to_watch",
"(",
"resolved_data",
")",
"if",
"val",
"}"
] | [
116,
4
] | [
122,
83
] | python | en | ['en', 'error', 'th'] | False |
BaseDiscoverySchemaDataTemplate._get_value_from_id | (
node: ZwaveNode, value_id_obj: ZwaveValueID
) | Get a ZwaveValue from a node using a ZwaveValueDict. | Get a ZwaveValue from a node using a ZwaveValueDict. | def _get_value_from_id(
node: ZwaveNode, value_id_obj: ZwaveValueID
) -> ZwaveValue | None:
"""Get a ZwaveValue from a node using a ZwaveValueDict."""
value_id = get_value_id(
node,
value_id_obj.command_class,
value_id_obj.property_,
endpoint=v... | [
"def",
"_get_value_from_id",
"(",
"node",
":",
"ZwaveNode",
",",
"value_id_obj",
":",
"ZwaveValueID",
")",
"->",
"ZwaveValue",
"|",
"None",
":",
"value_id",
"=",
"get_value_id",
"(",
"node",
",",
"value_id_obj",
".",
"command_class",
",",
"value_id_obj",
".",
... | [
125,
4
] | [
136,
40
] | python | en | ['en', 'pt', 'en'] | True |
NumericSensorDataTemplate.resolve_data | (self, value: ZwaveValue) | Resolve helper class data for a discovered value. | Resolve helper class data for a discovered value. | def resolve_data(self, value: ZwaveValue) -> str | None:
"""Resolve helper class data for a discovered value."""
if value.command_class == CommandClass.BATTERY:
return ENTITY_DESC_KEY_BATTERY
if value.command_class == CommandClass.METER:
scale_type = get_meter_scale_typ... | [
"def",
"resolve_data",
"(",
"self",
",",
"value",
":",
"ZwaveValue",
")",
"->",
"str",
"|",
"None",
":",
"if",
"value",
".",
"command_class",
"==",
"CommandClass",
".",
"BATTERY",
":",
"return",
"ENTITY_DESC_KEY_BATTERY",
"if",
"value",
".",
"command_class",
... | [
186,
4
] | [
222,
19
] | python | en | ['en', 'en', 'en'] | True |
calls | (hass) | Track calls to a mock service. | Track calls to a mock service. | def calls(hass):
"""Track calls to a mock service."""
return async_mock_service(hass, "test", "automation") | [
"def",
"calls",
"(",
"hass",
")",
":",
"return",
"async_mock_service",
"(",
"hass",
",",
"\"test\"",
",",
"\"automation\"",
")"
] | [
39,
0
] | [
41,
57
] | python | en | ['en', 'en', 'en'] | True |
test_missing_optional_config | (hass, calls) | Test: missing optional template is ok. | Test: missing optional template is ok. | async def test_missing_optional_config(hass, calls):
"""Test: missing optional template is ok."""
with assert_setup_component(1, "template"):
assert await setup.async_setup_component(
hass,
"template",
{
"template": {
"number": {
... | [
"async",
"def",
"test_missing_optional_config",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"template\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"template\"",
",",
"{",
... | [
44,
0
] | [
65,
35
] | python | en | ['en', 'en', 'en'] | True |
test_missing_required_keys | (hass, calls) | Test: missing required fields will fail. | Test: missing required fields will fail. | async def test_missing_required_keys(hass, calls):
"""Test: missing required fields will fail."""
with assert_setup_component(0, "template"):
assert await setup.async_setup_component(
hass,
"template",
{
"template": {
"number": {
... | [
"async",
"def",
"test_missing_required_keys",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"0",
",",
"\"template\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"template\"",
",",
"{",
... | [
68,
0
] | [
100,
40
] | python | en | ['en', 'en', 'en'] | True |
test_all_optional_config | (hass, calls) | Test: including all optional templates is ok. | Test: including all optional templates is ok. | async def test_all_optional_config(hass, calls):
"""Test: including all optional templates is ok."""
with assert_setup_component(1, "template"):
assert await setup.async_setup_component(
hass,
"template",
{
"template": {
"number": {... | [
"async",
"def",
"test_all_optional_config",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"template\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"template\"",
",",
"{",
"\... | [
103,
0
] | [
126,
29
] | python | en | ['en', 'en', 'en'] | True |
test_templates_with_entities | (hass, calls) | Test tempalates with values from other entities. | Test tempalates with values from other entities. | async def test_templates_with_entities(hass, calls):
"""Test tempalates with values from other entities."""
with assert_setup_component(4, "input_number"):
assert await setup.async_setup_component(
hass,
"input_number",
{
"input_number": {
... | [
"async",
"def",
"test_templates_with_entities",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"4",
",",
"\"input_number\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"input_number\"",
",",... | [
129,
0
] | [
253,
29
] | python | en | ['en', 'en', 'en'] | True |
test_trigger_number | (hass) | Test trigger based template number. | Test trigger based template number. | async def test_trigger_number(hass):
"""Test trigger based template number."""
events = async_capture_events(hass, "test_number_event")
assert await setup.async_setup_component(
hass,
"template",
{
"template": [
{"invalid": "config"},
# Con... | [
"async",
"def",
"test_trigger_number",
"(",
"hass",
")",
":",
"events",
"=",
"async_capture_events",
"(",
"hass",
",",
"\"test_number_event\"",
")",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"template\"",
",",
"{",
"\"template\"... | [
256,
0
] | [
319,
54
] | python | en | ['en', 'da', 'en'] | True |
_verify | (
hass,
expected_value,
expected_step,
expected_minimum,
expected_maximum,
) | Verify number's state. | Verify number's state. | def _verify(
hass,
expected_value,
expected_step,
expected_minimum,
expected_maximum,
):
"""Verify number's state."""
state = hass.states.get(_TEST_NUMBER)
attributes = state.attributes
assert state.state == str(float(expected_value))
assert attributes.get(ATTR_STEP) == float(exp... | [
"def",
"_verify",
"(",
"hass",
",",
"expected_value",
",",
"expected_step",
",",
"expected_minimum",
",",
"expected_maximum",
",",
")",
":",
"state",
"=",
"hass",
".",
"states",
".",
"get",
"(",
"_TEST_NUMBER",
")",
"attributes",
"=",
"state",
".",
"attribut... | [
322,
0
] | [
335,
62
] | python | en | ['en', 'en', 'en'] | True |
TestPetController.test_add_pet | (self) | Test case for add_pet
Add a new pet to the store
| Test case for add_pet | def test_add_pet(self):
"""Test case for add_pet
Add a new pet to the store
"""
body = {
"photoUrls" : [ "photoUrls", "photoUrls" ],
"name" : "doggie",
"id" : 0,
"category" : {
"name" : "name",
"id" : 6
},
"tags" : [ {
"name" : "name",
"id" : 1
}, {
"na... | [
"def",
"test_add_pet",
"(",
"self",
")",
":",
"body",
"=",
"{",
"\"photoUrls\"",
":",
"[",
"\"photoUrls\"",
",",
"\"photoUrls\"",
"]",
",",
"\"name\"",
":",
"\"doggie\"",
",",
"\"id\"",
":",
"0",
",",
"\"category\"",
":",
"{",
"\"name\"",
":",
"\"name\"",
... | [
17,
4
] | [
50,
77
] | python | en | ['en', 'en', 'en'] | True |
TestPetController.test_delete_pet | (self) | Test case for delete_pet
Deletes a pet
| Test case for delete_pet | def test_delete_pet(self):
"""Test case for delete_pet
Deletes a pet
"""
headers = {
'api_key': 'api_key_example',
'Authorization': 'Bearer special-key',
}
response = self.client.open(
'/v2/pet/{pet_id}'.format(pet_id=56),
... | [
"def",
"test_delete_pet",
"(",
"self",
")",
":",
"headers",
"=",
"{",
"'api_key'",
":",
"'api_key_example'",
",",
"'Authorization'",
":",
"'Bearer special-key'",
",",
"}",
"response",
"=",
"self",
".",
"client",
".",
"open",
"(",
"'/v2/pet/{pet_id}'",
".",
"fo... | [
52,
4
] | [
66,
77
] | python | da | ['da', 'fr', 'en'] | False |
TestPetController.test_find_pets_by_status | (self) | Test case for find_pets_by_status
Finds Pets by status
| Test case for find_pets_by_status | def test_find_pets_by_status(self):
"""Test case for find_pets_by_status
Finds Pets by status
"""
query_string = [('status', 'available')]
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer special-key',
}
response = self.... | [
"def",
"test_find_pets_by_status",
"(",
"self",
")",
":",
"query_string",
"=",
"[",
"(",
"'status'",
",",
"'available'",
")",
"]",
"headers",
"=",
"{",
"'Accept'",
":",
"'application/json'",
",",
"'Authorization'",
":",
"'Bearer special-key'",
",",
"}",
"respons... | [
68,
4
] | [
84,
77
] | python | en | ['en', 'en', 'en'] | True |
TestPetController.test_find_pets_by_tags | (self) | Test case for find_pets_by_tags
Finds Pets by tags
| Test case for find_pets_by_tags | def test_find_pets_by_tags(self):
"""Test case for find_pets_by_tags
Finds Pets by tags
"""
query_string = [('tags', 'tags_example')]
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer special-key',
}
response = self.clien... | [
"def",
"test_find_pets_by_tags",
"(",
"self",
")",
":",
"query_string",
"=",
"[",
"(",
"'tags'",
",",
"'tags_example'",
")",
"]",
"headers",
"=",
"{",
"'Accept'",
":",
"'application/json'",
",",
"'Authorization'",
":",
"'Bearer special-key'",
",",
"}",
"response... | [
86,
4
] | [
102,
77
] | python | en | ['en', 'en', 'en'] | True |
TestPetController.test_get_pet_by_id | (self) | Test case for get_pet_by_id
Find pet by ID
| Test case for get_pet_by_id | def test_get_pet_by_id(self):
"""Test case for get_pet_by_id
Find pet by ID
"""
headers = {
'Accept': 'application/json',
'api_key': 'special-key',
}
response = self.client.open(
'/v2/pet/{pet_id}'.format(pet_id=56),
metho... | [
"def",
"test_get_pet_by_id",
"(",
"self",
")",
":",
"headers",
"=",
"{",
"'Accept'",
":",
"'application/json'",
",",
"'api_key'",
":",
"'special-key'",
",",
"}",
"response",
"=",
"self",
".",
"client",
".",
"open",
"(",
"'/v2/pet/{pet_id}'",
".",
"format",
"... | [
104,
4
] | [
118,
77
] | python | en | ['da', 'en', 'en'] | True |
TestPetController.test_update_pet | (self) | Test case for update_pet
Update an existing pet
| Test case for update_pet | def test_update_pet(self):
"""Test case for update_pet
Update an existing pet
"""
body = {
"photoUrls" : [ "photoUrls", "photoUrls" ],
"name" : "doggie",
"id" : 0,
"category" : {
"name" : "name",
"id" : 6
},
"tags" : [ {
"name" : "name",
"id" : 1
}, {
"... | [
"def",
"test_update_pet",
"(",
"self",
")",
":",
"body",
"=",
"{",
"\"photoUrls\"",
":",
"[",
"\"photoUrls\"",
",",
"\"photoUrls\"",
"]",
",",
"\"name\"",
":",
"\"doggie\"",
",",
"\"id\"",
":",
"0",
",",
"\"category\"",
":",
"{",
"\"name\"",
":",
"\"name\"... | [
121,
4
] | [
154,
77
] | python | en | ['en', 'en', 'en'] | True |
TestPetController.test_update_pet_with_form | (self) | Test case for update_pet_with_form
Updates a pet in the store with form data
| Test case for update_pet_with_form | def test_update_pet_with_form(self):
"""Test case for update_pet_with_form
Updates a pet in the store with form data
"""
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': 'Bearer special-key',
}
data = dict(name='n... | [
"def",
"test_update_pet_with_form",
"(",
"self",
")",
":",
"headers",
"=",
"{",
"'Content-Type'",
":",
"'application/x-www-form-urlencoded'",
",",
"'Authorization'",
":",
"'Bearer special-key'",
",",
"}",
"data",
"=",
"dict",
"(",
"name",
"=",
"'name_example'",
",",... | [
157,
4
] | [
175,
77
] | python | en | ['en', 'en', 'en'] | True |
TestPetController.test_upload_file | (self) | Test case for upload_file
uploads an image
| Test case for upload_file | def test_upload_file(self):
"""Test case for upload_file
uploads an image
"""
headers = {
'Accept': 'application/json',
'Content-Type': 'multipart/form-data',
'Authorization': 'Bearer special-key',
}
data = dict(additional_metadata='a... | [
"def",
"test_upload_file",
"(",
"self",
")",
":",
"headers",
"=",
"{",
"'Accept'",
":",
"'application/json'",
",",
"'Content-Type'",
":",
"'multipart/form-data'",
",",
"'Authorization'",
":",
"'Bearer special-key'",
",",
"}",
"data",
"=",
"dict",
"(",
"additional_... | [
178,
4
] | [
197,
77
] | python | en | ['en', 'da', 'en'] | True |
get_scanner | (hass, config) | Return a router scanner instance. | Return a router scanner instance. | def get_scanner(hass, config):
"""Return a router scanner instance."""
scanner = EEBrightBoxScanner(config[DOMAIN])
return scanner if scanner.check_config() else None | [
"def",
"get_scanner",
"(",
"hass",
",",
"config",
")",
":",
"scanner",
"=",
"EEBrightBoxScanner",
"(",
"config",
"[",
"DOMAIN",
"]",
")",
"return",
"scanner",
"if",
"scanner",
".",
"check_config",
"(",
")",
"else",
"None"
] | [
33,
0
] | [
37,
54
] | python | en | ['en', 'en', 'en'] | True |
EEBrightBoxScanner.__init__ | (self, config) | Initialise the scanner. | Initialise the scanner. | def __init__(self, config):
"""Initialise the scanner."""
self.config = config
self.devices = {} | [
"def",
"__init__",
"(",
"self",
",",
"config",
")",
":",
"self",
".",
"config",
"=",
"config",
"self",
".",
"devices",
"=",
"{",
"}"
] | [
43,
4
] | [
46,
25
] | python | en | ['en', 'en', 'en'] | True |
EEBrightBoxScanner.check_config | (self) | Check if provided configuration and credentials are correct. | Check if provided configuration and credentials are correct. | def check_config(self):
"""Check if provided configuration and credentials are correct."""
try:
with EEBrightBox(self.config) as ee_brightbox:
return bool(ee_brightbox.get_devices())
except EEBrightBoxException:
_LOGGER.exception("Failed to connect to the ... | [
"def",
"check_config",
"(",
"self",
")",
":",
"try",
":",
"with",
"EEBrightBox",
"(",
"self",
".",
"config",
")",
"as",
"ee_brightbox",
":",
"return",
"bool",
"(",
"ee_brightbox",
".",
"get_devices",
"(",
")",
")",
"except",
"EEBrightBoxException",
":",
"_... | [
48,
4
] | [
55,
24
] | python | en | ['en', 'en', 'en'] | True |
EEBrightBoxScanner.scan_devices | (self) | Scan for devices. | Scan for devices. | def scan_devices(self):
"""Scan for devices."""
with EEBrightBox(self.config) as ee_brightbox:
self.devices = {d["mac"]: d for d in ee_brightbox.get_devices()}
macs = [d["mac"] for d in self.devices.values() if d["activity_ip"]]
_LOGGER.debug("Scan devices %s", macs)
... | [
"def",
"scan_devices",
"(",
"self",
")",
":",
"with",
"EEBrightBox",
"(",
"self",
".",
"config",
")",
"as",
"ee_brightbox",
":",
"self",
".",
"devices",
"=",
"{",
"d",
"[",
"\"mac\"",
"]",
":",
"d",
"for",
"d",
"in",
"ee_brightbox",
".",
"get_devices",... | [
57,
4
] | [
66,
19
] | python | en | ['no', 'en', 'en'] | True |
EEBrightBoxScanner.get_device_name | (self, device) | Get the name of a device from hostname. | Get the name of a device from hostname. | def get_device_name(self, device):
"""Get the name of a device from hostname."""
if device in self.devices:
return self.devices[device]["hostname"] or None
return None | [
"def",
"get_device_name",
"(",
"self",
",",
"device",
")",
":",
"if",
"device",
"in",
"self",
".",
"devices",
":",
"return",
"self",
".",
"devices",
"[",
"device",
"]",
"[",
"\"hostname\"",
"]",
"or",
"None",
"return",
"None"
] | [
68,
4
] | [
73,
19
] | python | en | ['en', 'en', 'en'] | True |
EEBrightBoxScanner.get_extra_attributes | (self, device) |
Get the extra attributes of a device.
Extra attributes include:
- ip
- mac
- port - ethX or wifiX
- last_active
|
Get the extra attributes of a device. | def get_extra_attributes(self, device):
"""
Get the extra attributes of a device.
Extra attributes include:
- ip
- mac
- port - ethX or wifiX
- last_active
"""
port_map = {
"wl1": "wifi5Ghz",
"wl0": "wifi2.4Ghz",
... | [
"def",
"get_extra_attributes",
"(",
"self",
",",
"device",
")",
":",
"port_map",
"=",
"{",
"\"wl1\"",
":",
"\"wifi5Ghz\"",
",",
"\"wl0\"",
":",
"\"wifi2.4Ghz\"",
",",
"\"eth0\"",
":",
"\"eth0\"",
",",
"\"eth1\"",
":",
"\"eth1\"",
",",
"\"eth2\"",
":",
"\"eth... | [
75,
4
] | [
102,
17
] | python | en | ['en', 'error', 'th'] | False |
test_sensors_ev_imperial | (hass, ev_entry) | Test sensors supporting imperial units. | Test sensors supporting imperial units. | async def test_sensors_ev_imperial(hass, ev_entry):
"""Test sensors supporting imperial units."""
hass.config.units = IMPERIAL_SYSTEM
with patch(MOCK_API_FETCH), patch(
MOCK_API_GET_DATA, return_value=VEHICLE_STATUS_EV
):
advance_time_to_next_fetch(hass)
await hass.async_block_t... | [
"async",
"def",
"test_sensors_ev_imperial",
"(",
"hass",
",",
"ev_entry",
")",
":",
"hass",
".",
"config",
".",
"units",
"=",
"IMPERIAL_SYSTEM",
"with",
"patch",
"(",
"MOCK_API_FETCH",
")",
",",
"patch",
"(",
"MOCK_API_GET_DATA",
",",
"return_value",
"=",
"VEH... | [
32,
0
] | [
42,
50
] | python | en | ['en', 'en', 'en'] | True |
test_sensors_ev_metric | (hass, ev_entry) | Test sensors supporting metric units. | Test sensors supporting metric units. | async def test_sensors_ev_metric(hass, ev_entry):
"""Test sensors supporting metric units."""
_assert_data(hass, EXPECTED_STATE_EV_METRIC) | [
"async",
"def",
"test_sensors_ev_metric",
"(",
"hass",
",",
"ev_entry",
")",
":",
"_assert_data",
"(",
"hass",
",",
"EXPECTED_STATE_EV_METRIC",
")"
] | [
45,
0
] | [
47,
48
] | python | en | ['en', 'en', 'en'] | True |
test_sensors_missing_vin_data | (hass, ev_entry) | Test for missing VIN dataset. | Test for missing VIN dataset. | async def test_sensors_missing_vin_data(hass, ev_entry):
"""Test for missing VIN dataset."""
with patch(MOCK_API_FETCH), patch(MOCK_API_GET_DATA, return_value=None):
advance_time_to_next_fetch(hass)
await hass.async_block_till_done()
_assert_data(hass, EXPECTED_STATE_EV_UNAVAILABLE) | [
"async",
"def",
"test_sensors_missing_vin_data",
"(",
"hass",
",",
"ev_entry",
")",
":",
"with",
"patch",
"(",
"MOCK_API_FETCH",
")",
",",
"patch",
"(",
"MOCK_API_GET_DATA",
",",
"return_value",
"=",
"None",
")",
":",
"advance_time_to_next_fetch",
"(",
"hass",
"... | [
50,
0
] | [
56,
53
] | python | en | ['en', 'no', 'en'] | True |
test_manually_configured_platform | (hass) | Test that we do not set up an access point. | Test that we do not set up an access point. | async def test_manually_configured_platform(hass):
"""Test that we do not set up an access point."""
assert await async_setup_component(
hass, SWITCH_DOMAIN, {SWITCH_DOMAIN: {"platform": HMIPC_DOMAIN}}
)
assert not hass.data.get(HMIPC_DOMAIN) | [
"async",
"def",
"test_manually_configured_platform",
"(",
"hass",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"SWITCH_DOMAIN",
",",
"{",
"SWITCH_DOMAIN",
":",
"{",
"\"platform\"",
":",
"HMIPC_DOMAIN",
"}",
"}",
")",
"assert",
"not",
"... | [
16,
0
] | [
21,
42
] | python | en | ['en', 'en', 'en'] | True |
test_hmip_switch | (hass, default_mock_hap_factory) | Test HomematicipSwitch. | Test HomematicipSwitch. | async def test_hmip_switch(hass, default_mock_hap_factory):
"""Test HomematicipSwitch."""
entity_id = "switch.schrank"
entity_name = "Schrank"
device_model = "HMIP-PS"
mock_hap = await default_mock_hap_factory.async_get_mock_hap(
test_devices=[entity_name]
)
ha_state, hmip_device = ... | [
"async",
"def",
"test_hmip_switch",
"(",
"hass",
",",
"default_mock_hap_factory",
")",
":",
"entity_id",
"=",
"\"switch.schrank\"",
"entity_name",
"=",
"\"Schrank\"",
"device_model",
"=",
"\"HMIP-PS\"",
"mock_hap",
"=",
"await",
"default_mock_hap_factory",
".",
"async_g... | [
24,
0
] | [
58,
37
] | python | en | ['en', 'en', 'en'] | False |
test_hmip_switch_input | (hass, default_mock_hap_factory) | Test HomematicipSwitch. | Test HomematicipSwitch. | async def test_hmip_switch_input(hass, default_mock_hap_factory):
"""Test HomematicipSwitch."""
entity_id = "switch.wohnzimmer_beleuchtung"
entity_name = "Wohnzimmer Beleuchtung"
device_model = "HmIP-FSI16"
mock_hap = await default_mock_hap_factory.async_get_mock_hap(
test_devices=[entity_na... | [
"async",
"def",
"test_hmip_switch_input",
"(",
"hass",
",",
"default_mock_hap_factory",
")",
":",
"entity_id",
"=",
"\"switch.wohnzimmer_beleuchtung\"",
"entity_name",
"=",
"\"Wohnzimmer Beleuchtung\"",
"device_model",
"=",
"\"HmIP-FSI16\"",
"mock_hap",
"=",
"await",
"defau... | [
61,
0
] | [
95,
37
] | python | en | ['en', 'en', 'en'] | False |
test_hmip_switch_measuring | (hass, default_mock_hap_factory) | Test HomematicipSwitchMeasuring. | Test HomematicipSwitchMeasuring. | async def test_hmip_switch_measuring(hass, default_mock_hap_factory):
"""Test HomematicipSwitchMeasuring."""
entity_id = "switch.pc"
entity_name = "Pc"
device_model = "HMIP-PSM"
mock_hap = await default_mock_hap_factory.async_get_mock_hap(
test_devices=[entity_name]
)
ha_state, hmip... | [
"async",
"def",
"test_hmip_switch_measuring",
"(",
"hass",
",",
"default_mock_hap_factory",
")",
":",
"entity_id",
"=",
"\"switch.pc\"",
"entity_name",
"=",
"\"Pc\"",
"device_model",
"=",
"\"HMIP-PSM\"",
"mock_hap",
"=",
"await",
"default_mock_hap_factory",
".",
"async_... | [
98,
0
] | [
139,
61
] | python | en | ['en', 'en', 'en'] | False |
test_hmip_group_switch | (hass, default_mock_hap_factory) | Test HomematicipGroupSwitch. | Test HomematicipGroupSwitch. | async def test_hmip_group_switch(hass, default_mock_hap_factory):
"""Test HomematicipGroupSwitch."""
entity_id = "switch.strom_group"
entity_name = "Strom Group"
device_model = None
mock_hap = await default_mock_hap_factory.async_get_mock_hap(test_groups=["Strom"])
ha_state, hmip_device = get_a... | [
"async",
"def",
"test_hmip_group_switch",
"(",
"hass",
",",
"default_mock_hap_factory",
")",
":",
"entity_id",
"=",
"\"switch.strom_group\"",
"entity_name",
"=",
"\"Strom Group\"",
"device_model",
"=",
"None",
"mock_hap",
"=",
"await",
"default_mock_hap_factory",
".",
"... | [
142,
0
] | [
179,
61
] | python | en | ['en', 'en', 'en'] | False |
test_hmip_multi_switch | (hass, default_mock_hap_factory) | Test HomematicipMultiSwitch. | Test HomematicipMultiSwitch. | async def test_hmip_multi_switch(hass, default_mock_hap_factory):
"""Test HomematicipMultiSwitch."""
entity_id = "switch.jalousien_1_kizi_2_schlazi_channel1"
entity_name = "Jalousien - 1 KiZi, 2 SchlaZi Channel1"
device_model = "HmIP-PCBS2"
mock_hap = await default_mock_hap_factory.async_get_mock_ha... | [
"async",
"def",
"test_hmip_multi_switch",
"(",
"hass",
",",
"default_mock_hap_factory",
")",
":",
"entity_id",
"=",
"\"switch.jalousien_1_kizi_2_schlazi_channel1\"",
"entity_name",
"=",
"\"Jalousien - 1 KiZi, 2 SchlaZi Channel1\"",
"device_model",
"=",
"\"HmIP-PCBS2\"",
"mock_hap... | [
182,
0
] | [
232,
38
] | python | en | ['en', 'en', 'en'] | False |
test_hmip_wired_multi_switch | (hass, default_mock_hap_factory) | Test HomematicipMultiSwitch. | Test HomematicipMultiSwitch. | async def test_hmip_wired_multi_switch(hass, default_mock_hap_factory):
"""Test HomematicipMultiSwitch."""
entity_id = "switch.fernseher_wohnzimmer"
entity_name = "Fernseher (Wohnzimmer)"
device_model = "HmIPW-DRS8"
mock_hap = await default_mock_hap_factory.async_get_mock_hap(
test_devices=[... | [
"async",
"def",
"test_hmip_wired_multi_switch",
"(",
"hass",
",",
"default_mock_hap_factory",
")",
":",
"entity_id",
"=",
"\"switch.fernseher_wohnzimmer\"",
"entity_name",
"=",
"\"Fernseher (Wohnzimmer)\"",
"device_model",
"=",
"\"HmIPW-DRS8\"",
"mock_hap",
"=",
"await",
"d... | [
235,
0
] | [
271,
37
] | python | en | ['en', 'en', 'en'] | False |
async_get_conditions | (
hass: HomeAssistant, device_id: str
) | List device conditions for Humidifier devices. | List device conditions for Humidifier devices. | async def async_get_conditions(
hass: HomeAssistant, device_id: str
) -> list[dict[str, str]]:
"""List device conditions for Humidifier devices."""
registry = await entity_registry.async_get_registry(hass)
conditions = await toggle_entity.async_get_conditions(hass, device_id, DOMAIN)
# Get all the ... | [
"async",
"def",
"async_get_conditions",
"(",
"hass",
":",
"HomeAssistant",
",",
"device_id",
":",
"str",
")",
"->",
"list",
"[",
"dict",
"[",
"str",
",",
"str",
"]",
"]",
":",
"registry",
"=",
"await",
"entity_registry",
".",
"async_get_registry",
"(",
"ha... | [
38,
0
] | [
63,
21
] | python | en | ['fr', 'en', 'en'] | True |
async_condition_from_config | (
config: ConfigType, config_validation: bool
) | Create a function to test a device condition. | Create a function to test a device condition. | def async_condition_from_config(
config: ConfigType, config_validation: bool
) -> condition.ConditionCheckerType:
"""Create a function to test a device condition."""
if config_validation:
config = CONDITION_SCHEMA(config)
if config[CONF_TYPE] == "is_mode":
attribute = ATTR_MODE
else... | [
"def",
"async_condition_from_config",
"(",
"config",
":",
"ConfigType",
",",
"config_validation",
":",
"bool",
")",
"->",
"condition",
".",
"ConditionCheckerType",
":",
"if",
"config_validation",
":",
"config",
"=",
"CONDITION_SCHEMA",
"(",
"config",
")",
"if",
"c... | [
67,
0
] | [
84,
24
] | python | en | ['en', 'en', 'en'] | True |
async_get_condition_capabilities | (hass, config) | List condition capabilities. | List condition capabilities. | async def async_get_condition_capabilities(hass, config):
"""List condition capabilities."""
condition_type = config[CONF_TYPE]
fields = {}
if condition_type == "is_mode":
try:
modes = (
get_capability(hass, config[ATTR_ENTITY_ID], const.ATTR_AVAILABLE_MODES)
... | [
"async",
"def",
"async_get_condition_capabilities",
"(",
"hass",
",",
"config",
")",
":",
"condition_type",
"=",
"config",
"[",
"CONF_TYPE",
"]",
"fields",
"=",
"{",
"}",
"if",
"condition_type",
"==",
"\"is_mode\"",
":",
"try",
":",
"modes",
"=",
"(",
"get_c... | [
87,
0
] | [
106,
77
] | python | en | ['ro', 'sr', 'en'] | False |
setup_platform | (hass, config, add_entities, discovery_info=None) | Set up the Nest Sensor.
No longer used.
| Set up the Nest Sensor. | def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Nest Sensor.
No longer used.
""" | [
"def",
"setup_platform",
"(",
"hass",
",",
"config",
",",
"add_entities",
",",
"discovery_info",
"=",
"None",
")",
":"
] | [
72,
0
] | [
76,
7
] | python | en | ['en', 'pt', 'en'] | True |
async_setup_legacy_entry | (hass, entry, async_add_entities) | Set up a Nest sensor based on a config entry. | Set up a Nest sensor based on a config entry. | async def async_setup_legacy_entry(hass, entry, async_add_entities) -> None:
"""Set up a Nest sensor based on a config entry."""
nest = hass.data[DATA_NEST]
discovery_info = hass.data.get(DATA_NEST_CONFIG, {}).get(CONF_SENSORS, {})
# Add all available sensors if no Nest sensor config is set
if dis... | [
"async",
"def",
"async_setup_legacy_entry",
"(",
"hass",
",",
"entry",
",",
"async_add_entities",
")",
"->",
"None",
":",
"nest",
"=",
"hass",
".",
"data",
"[",
"DATA_NEST",
"]",
"discovery_info",
"=",
"hass",
".",
"data",
".",
"get",
"(",
"DATA_NEST_CONFIG"... | [
79,
0
] | [
149,
76
] | python | en | ['en', 'da', 'en'] | True |
NestBasicSensor.native_unit_of_measurement | (self) | Return the unit the value is expressed in. | Return the unit the value is expressed in. | def native_unit_of_measurement(self):
"""Return the unit the value is expressed in."""
return self._unit | [
"def",
"native_unit_of_measurement",
"(",
"self",
")",
":",
"return",
"self",
".",
"_unit"
] | [
156,
4
] | [
158,
25
] | python | en | ['en', 'en', 'en'] | True |
NestBasicSensor.native_value | (self) | Return the state of the sensor. | Return the state of the sensor. | def native_value(self):
"""Return the state of the sensor."""
return self._state | [
"def",
"native_value",
"(",
"self",
")",
":",
"return",
"self",
".",
"_state"
] | [
161,
4
] | [
163,
26
] | python | en | ['en', 'en', 'en'] | True |
NestBasicSensor.device_class | (self) | Return the device class of the sensor. | Return the device class of the sensor. | def device_class(self):
"""Return the device class of the sensor."""
return SENSOR_DEVICE_CLASSES.get(self.variable) | [
"def",
"device_class",
"(",
"self",
")",
":",
"return",
"SENSOR_DEVICE_CLASSES",
".",
"get",
"(",
"self",
".",
"variable",
")"
] | [
166,
4
] | [
168,
55
] | python | en | ['en', 'en', 'en'] | True |
NestBasicSensor.update | (self) | Retrieve latest state. | Retrieve latest state. | def update(self):
"""Retrieve latest state."""
self._unit = SENSOR_UNITS.get(self.variable)
if self.variable in VARIABLE_NAME_MAPPING:
self._state = getattr(self.device, VARIABLE_NAME_MAPPING[self.variable])
elif self.variable in VALUE_MAPPING:
state = getattr(se... | [
"def",
"update",
"(",
"self",
")",
":",
"self",
".",
"_unit",
"=",
"SENSOR_UNITS",
".",
"get",
"(",
"self",
".",
"variable",
")",
"if",
"self",
".",
"variable",
"in",
"VARIABLE_NAME_MAPPING",
":",
"self",
".",
"_state",
"=",
"getattr",
"(",
"self",
"."... | [
170,
4
] | [
184,
61
] | python | en | ['es', 'sk', 'en'] | False |
NestTempSensor.native_value | (self) | Return the state of the sensor. | Return the state of the sensor. | def native_value(self):
"""Return the state of the sensor."""
return self._state | [
"def",
"native_value",
"(",
"self",
")",
":",
"return",
"self",
".",
"_state"
] | [
191,
4
] | [
193,
26
] | python | en | ['en', 'en', 'en'] | True |
NestTempSensor.native_unit_of_measurement | (self) | Return the unit the value is expressed in. | Return the unit the value is expressed in. | def native_unit_of_measurement(self):
"""Return the unit the value is expressed in."""
return self._unit | [
"def",
"native_unit_of_measurement",
"(",
"self",
")",
":",
"return",
"self",
".",
"_unit"
] | [
196,
4
] | [
198,
25
] | python | en | ['en', 'en', 'en'] | True |
NestTempSensor.device_class | (self) | Return the device class of the sensor. | Return the device class of the sensor. | def device_class(self):
"""Return the device class of the sensor."""
return DEVICE_CLASS_TEMPERATURE | [
"def",
"device_class",
"(",
"self",
")",
":",
"return",
"DEVICE_CLASS_TEMPERATURE"
] | [
201,
4
] | [
203,
39
] | python | en | ['en', 'en', 'en'] | True |
NestTempSensor.update | (self) | Retrieve latest state. | Retrieve latest state. | def update(self):
"""Retrieve latest state."""
if self.device.temperature_scale == "C":
self._unit = TEMP_CELSIUS
else:
self._unit = TEMP_FAHRENHEIT
temp = getattr(self.device, self.variable)
if temp is None:
self._state = None
if isi... | [
"def",
"update",
"(",
"self",
")",
":",
"if",
"self",
".",
"device",
".",
"temperature_scale",
"==",
"\"C\"",
":",
"self",
".",
"_unit",
"=",
"TEMP_CELSIUS",
"else",
":",
"self",
".",
"_unit",
"=",
"TEMP_FAHRENHEIT",
"temp",
"=",
"getattr",
"(",
"self",
... | [
205,
4
] | [
220,
40
] | python | en | ['es', 'sk', 'en'] | False |
PlumLightpadConfigFlow.async_step_user | (
self, user_input: dict[str, Any] | None = None
) | Handle a flow initialized by the user or redirected to by import. | Handle a flow initialized by the user or redirected to by import. | async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> FlowResult:
"""Handle a flow initialized by the user or redirected to by import."""
if not user_input:
return self._show_form()
username = user_input[CONF_USERNAME]
password = user_inp... | [
"async",
"def",
"async_step_user",
"(",
"self",
",",
"user_input",
":",
"dict",
"[",
"str",
",",
"Any",
"]",
"|",
"None",
"=",
"None",
")",
"->",
"FlowResult",
":",
"if",
"not",
"user_input",
":",
"return",
"self",
".",
"_show_form",
"(",
")",
"usernam... | [
38,
4
] | [
60,
9
] | python | en | ['en', 'en', 'en'] | True |
PlumLightpadConfigFlow.async_step_import | (self, import_config: ConfigType | None) | Import a config entry from configuration.yaml. | Import a config entry from configuration.yaml. | async def async_step_import(self, import_config: ConfigType | None) -> FlowResult:
"""Import a config entry from configuration.yaml."""
return await self.async_step_user(import_config) | [
"async",
"def",
"async_step_import",
"(",
"self",
",",
"import_config",
":",
"ConfigType",
"|",
"None",
")",
"->",
"FlowResult",
":",
"return",
"await",
"self",
".",
"async_step_user",
"(",
"import_config",
")"
] | [
62,
4
] | [
64,
56
] | python | en | ['en', 'en', 'en'] | True |
test_reproducing_states | (hass, caplog) | Test reproducing Input datetime states. | Test reproducing Input datetime states. | async def test_reproducing_states(hass, caplog):
"""Test reproducing Input datetime states."""
hass.states.async_set(
"input_datetime.entity_datetime",
"2010-10-10 01:20:00",
{"has_date": True, "has_time": True},
)
hass.states.async_set(
"input_datetime.entity_time", "01:... | [
"async",
"def",
"test_reproducing_states",
"(",
"hass",
",",
"caplog",
")",
":",
"hass",
".",
"states",
".",
"async_set",
"(",
"\"input_datetime.entity_datetime\"",
",",
"\"2010-10-10 01:20:00\"",
",",
"{",
"\"has_date\"",
":",
"True",
",",
"\"has_time\"",
":",
"T... | [
6,
0
] | [
80,
37
] | python | en | ['fr', 'en', 'en'] | True |
ArrayOfNumberOnly.openapi_types | () |
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
Returns
openapi_types (dict): The key is attribute name
and the value is attribute type.
|
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded | def openapi_types():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
Returns
openapi_types (dict): The key is attribute name
and the value is attribute type.
"""
retu... | [
"def",
"openapi_types",
"(",
")",
":",
"return",
"{",
"'array_number'",
":",
"(",
"[",
"float",
"]",
",",
")",
",",
"# noqa: E501",
"}"
] | [
64,
4
] | [
75,
9
] | python | en | ['en', 'error', 'th'] | False |
ArrayOfNumberOnly.__init__ | (self, *args, **kwargs) | ArrayOfNumberOnly - a model defined in OpenAPI
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
... | ArrayOfNumberOnly - a model defined in OpenAPI | def __init__(self, *args, **kwargs): # noqa: E501
"""ArrayOfNumberOnly - a model defined in OpenAPI
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
... | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# noqa: E501",
"_check_type",
"=",
"kwargs",
".",
"pop",
"(",
"'_check_type'",
",",
"True",
")",
"_spec_property_naming",
"=",
"kwargs",
".",
"pop",
"(",
"'_spec_property... | [
98,
4
] | [
165,
46
] | python | en | ['en', 'en', 'en'] | True |
test_run_select_setup | (hass, mqtt_mock) | Test that it fetches the given payload. | Test that it fetches the given payload. | async def test_run_select_setup(hass, mqtt_mock):
"""Test that it fetches the given payload."""
topic = "test/select"
await async_setup_component(
hass,
"select",
{
"select": {
"platform": "mqtt",
"state_topic": topic,
"comm... | [
"async",
"def",
"test_run_select_setup",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"topic",
"=",
"\"test/select\"",
"await",
"async_setup_component",
"(",
"hass",
",",
"\"select\"",
",",
"{",
"\"select\"",
":",
"{",
"\"platform\"",
":",
"\"mqtt\"",
",",
"\"state_... | [
58,
0
] | [
88,
32
] | python | en | ['en', 'en', 'en'] | True |
test_value_template | (hass, mqtt_mock) | Test that it fetches the given payload with a template. | Test that it fetches the given payload with a template. | async def test_value_template(hass, mqtt_mock):
"""Test that it fetches the given payload with a template."""
topic = "test/select"
await async_setup_component(
hass,
"select",
{
"select": {
"platform": "mqtt",
"state_topic": topic,
... | [
"async",
"def",
"test_value_template",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"topic",
"=",
"\"test/select\"",
"await",
"async_setup_component",
"(",
"hass",
",",
"\"select\"",
",",
"{",
"\"select\"",
":",
"{",
"\"platform\"",
":",
"\"mqtt\"",
",",
"\"state_to... | [
91,
0
] | [
129,
39
] | python | en | ['en', 'en', 'en'] | True |
test_run_select_service_optimistic | (hass, mqtt_mock) | Test that set_value service works in optimistic mode. | Test that set_value service works in optimistic mode. | async def test_run_select_service_optimistic(hass, mqtt_mock):
"""Test that set_value service works in optimistic mode."""
topic = "test/select"
fake_state = ha.State("select.test", "milk")
with patch(
"homeassistant.helpers.restore_state.RestoreEntity.async_get_last_state",
return_val... | [
"async",
"def",
"test_run_select_service_optimistic",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"topic",
"=",
"\"test/select\"",
"fake_state",
"=",
"ha",
".",
"State",
"(",
"\"select.test\"",
",",
"\"milk\"",
")",
"with",
"patch",
"(",
"\"homeassistant.helpers.restor... | [
132,
0
] | [
170,
32
] | python | en | ['en', 'en', 'en'] | True |
test_run_select_service | (hass, mqtt_mock) | Test that set_value service works in non optimistic mode. | Test that set_value service works in non optimistic mode. | async def test_run_select_service(hass, mqtt_mock):
"""Test that set_value service works in non optimistic mode."""
cmd_topic = "test/select/set"
state_topic = "test/select"
assert await async_setup_component(
hass,
select.DOMAIN,
{
"select": {
"platf... | [
"async",
"def",
"test_run_select_service",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"cmd_topic",
"=",
"\"test/select/set\"",
"state_topic",
"=",
"\"test/select\"",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"select",
".",
"DOMAIN",
",",
"{",
"\"... | [
173,
0
] | [
205,
32
] | python | en | ['en', 'en', 'en'] | True |
test_availability_when_connection_lost | (hass, mqtt_mock) | Test availability after MQTT disconnection. | Test availability after MQTT disconnection. | async def test_availability_when_connection_lost(hass, mqtt_mock):
"""Test availability after MQTT disconnection."""
await help_test_availability_when_connection_lost(
hass, mqtt_mock, select.DOMAIN, DEFAULT_CONFIG
) | [
"async",
"def",
"test_availability_when_connection_lost",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"await",
"help_test_availability_when_connection_lost",
"(",
"hass",
",",
"mqtt_mock",
",",
"select",
".",
"DOMAIN",
",",
"DEFAULT_CONFIG",
")"
] | [
208,
0
] | [
212,
5
] | python | en | ['en', 'en', 'en'] | True |
test_availability_without_topic | (hass, mqtt_mock) | Test availability without defined availability topic. | Test availability without defined availability topic. | async def test_availability_without_topic(hass, mqtt_mock):
"""Test availability without defined availability topic."""
await help_test_availability_without_topic(
hass, mqtt_mock, select.DOMAIN, DEFAULT_CONFIG
) | [
"async",
"def",
"test_availability_without_topic",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"await",
"help_test_availability_without_topic",
"(",
"hass",
",",
"mqtt_mock",
",",
"select",
".",
"DOMAIN",
",",
"DEFAULT_CONFIG",
")"
] | [
215,
0
] | [
219,
5
] | python | en | ['en', 'en', 'en'] | True |
test_default_availability_payload | (hass, mqtt_mock) | Test availability by default payload with defined topic. | Test availability by default payload with defined topic. | async def test_default_availability_payload(hass, mqtt_mock):
"""Test availability by default payload with defined topic."""
await help_test_default_availability_payload(
hass, mqtt_mock, select.DOMAIN, DEFAULT_CONFIG
) | [
"async",
"def",
"test_default_availability_payload",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"await",
"help_test_default_availability_payload",
"(",
"hass",
",",
"mqtt_mock",
",",
"select",
".",
"DOMAIN",
",",
"DEFAULT_CONFIG",
")"
] | [
222,
0
] | [
226,
5
] | python | en | ['en', 'en', 'en'] | True |
test_custom_availability_payload | (hass, mqtt_mock) | Test availability by custom payload with defined topic. | Test availability by custom payload with defined topic. | async def test_custom_availability_payload(hass, mqtt_mock):
"""Test availability by custom payload with defined topic."""
await help_test_custom_availability_payload(
hass, mqtt_mock, select.DOMAIN, DEFAULT_CONFIG
) | [
"async",
"def",
"test_custom_availability_payload",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"await",
"help_test_custom_availability_payload",
"(",
"hass",
",",
"mqtt_mock",
",",
"select",
".",
"DOMAIN",
",",
"DEFAULT_CONFIG",
")"
] | [
229,
0
] | [
233,
5
] | python | en | ['en', 'en', 'en'] | True |
test_setting_attribute_via_mqtt_json_message | (hass, mqtt_mock) | Test the setting of attribute via MQTT with JSON payload. | Test the setting of attribute via MQTT with JSON payload. | async def test_setting_attribute_via_mqtt_json_message(hass, mqtt_mock):
"""Test the setting of attribute via MQTT with JSON payload."""
await help_test_setting_attribute_via_mqtt_json_message(
hass, mqtt_mock, select.DOMAIN, DEFAULT_CONFIG
) | [
"async",
"def",
"test_setting_attribute_via_mqtt_json_message",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"await",
"help_test_setting_attribute_via_mqtt_json_message",
"(",
"hass",
",",
"mqtt_mock",
",",
"select",
".",
"DOMAIN",
",",
"DEFAULT_CONFIG",
")"
] | [
236,
0
] | [
240,
5
] | python | en | ['en', 'en', 'en'] | True |
test_setting_blocked_attribute_via_mqtt_json_message | (hass, mqtt_mock) | Test the setting of attribute via MQTT with JSON payload. | Test the setting of attribute via MQTT with JSON payload. | async def test_setting_blocked_attribute_via_mqtt_json_message(hass, mqtt_mock):
"""Test the setting of attribute via MQTT with JSON payload."""
await help_test_setting_blocked_attribute_via_mqtt_json_message(
hass, mqtt_mock, select.DOMAIN, DEFAULT_CONFIG, MQTT_SELECT_ATTRIBUTES_BLOCKED
) | [
"async",
"def",
"test_setting_blocked_attribute_via_mqtt_json_message",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"await",
"help_test_setting_blocked_attribute_via_mqtt_json_message",
"(",
"hass",
",",
"mqtt_mock",
",",
"select",
".",
"DOMAIN",
",",
"DEFAULT_CONFIG",
",",
... | [
243,
0
] | [
247,
5
] | python | en | ['en', 'en', 'en'] | True |
test_setting_attribute_with_template | (hass, mqtt_mock) | Test the setting of attribute via MQTT with JSON payload. | Test the setting of attribute via MQTT with JSON payload. | async def test_setting_attribute_with_template(hass, mqtt_mock):
"""Test the setting of attribute via MQTT with JSON payload."""
await help_test_setting_attribute_with_template(
hass, mqtt_mock, select.DOMAIN, DEFAULT_CONFIG
) | [
"async",
"def",
"test_setting_attribute_with_template",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"await",
"help_test_setting_attribute_with_template",
"(",
"hass",
",",
"mqtt_mock",
",",
"select",
".",
"DOMAIN",
",",
"DEFAULT_CONFIG",
")"
] | [
250,
0
] | [
254,
5
] | python | en | ['en', 'en', 'en'] | True |
test_update_with_json_attrs_not_dict | (hass, mqtt_mock, caplog) | Test attributes get extracted from a JSON result. | Test attributes get extracted from a JSON result. | async def test_update_with_json_attrs_not_dict(hass, mqtt_mock, caplog):
"""Test attributes get extracted from a JSON result."""
await help_test_update_with_json_attrs_not_dict(
hass, mqtt_mock, caplog, select.DOMAIN, DEFAULT_CONFIG
) | [
"async",
"def",
"test_update_with_json_attrs_not_dict",
"(",
"hass",
",",
"mqtt_mock",
",",
"caplog",
")",
":",
"await",
"help_test_update_with_json_attrs_not_dict",
"(",
"hass",
",",
"mqtt_mock",
",",
"caplog",
",",
"select",
".",
"DOMAIN",
",",
"DEFAULT_CONFIG",
"... | [
257,
0
] | [
261,
5
] | python | en | ['en', 'en', 'en'] | True |
test_update_with_json_attrs_bad_JSON | (hass, mqtt_mock, caplog) | Test attributes get extracted from a JSON result. | Test attributes get extracted from a JSON result. | async def test_update_with_json_attrs_bad_JSON(hass, mqtt_mock, caplog):
"""Test attributes get extracted from a JSON result."""
await help_test_update_with_json_attrs_bad_JSON(
hass, mqtt_mock, caplog, select.DOMAIN, DEFAULT_CONFIG
) | [
"async",
"def",
"test_update_with_json_attrs_bad_JSON",
"(",
"hass",
",",
"mqtt_mock",
",",
"caplog",
")",
":",
"await",
"help_test_update_with_json_attrs_bad_JSON",
"(",
"hass",
",",
"mqtt_mock",
",",
"caplog",
",",
"select",
".",
"DOMAIN",
",",
"DEFAULT_CONFIG",
"... | [
264,
0
] | [
268,
5
] | python | en | ['en', 'en', 'en'] | True |
test_discovery_update_attr | (hass, mqtt_mock, caplog) | Test update of discovered MQTTAttributes. | Test update of discovered MQTTAttributes. | async def test_discovery_update_attr(hass, mqtt_mock, caplog):
"""Test update of discovered MQTTAttributes."""
await help_test_discovery_update_attr(
hass, mqtt_mock, caplog, select.DOMAIN, DEFAULT_CONFIG
) | [
"async",
"def",
"test_discovery_update_attr",
"(",
"hass",
",",
"mqtt_mock",
",",
"caplog",
")",
":",
"await",
"help_test_discovery_update_attr",
"(",
"hass",
",",
"mqtt_mock",
",",
"caplog",
",",
"select",
".",
"DOMAIN",
",",
"DEFAULT_CONFIG",
")"
] | [
271,
0
] | [
275,
5
] | python | en | ['en', 'en', 'en'] | True |
test_unique_id | (hass, mqtt_mock) | Test unique id option only creates one select per unique_id. | Test unique id option only creates one select per unique_id. | async def test_unique_id(hass, mqtt_mock):
"""Test unique id option only creates one select per unique_id."""
config = {
select.DOMAIN: [
{
"platform": "mqtt",
"name": "Test 1",
"state_topic": "test-topic",
"command_topic": "tes... | [
"async",
"def",
"test_unique_id",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"config",
"=",
"{",
"select",
".",
"DOMAIN",
":",
"[",
"{",
"\"platform\"",
":",
"\"mqtt\"",
",",
"\"name\"",
":",
"\"Test 1\"",
",",
"\"state_topic\"",
":",
"\"test-topic\"",
",",
... | [
278,
0
] | [
300,
69
] | python | en | ['en', 'en', 'en'] | True |
test_discovery_removal_select | (hass, mqtt_mock, caplog) | Test removal of discovered select. | Test removal of discovered select. | async def test_discovery_removal_select(hass, mqtt_mock, caplog):
"""Test removal of discovered select."""
data = json.dumps(DEFAULT_CONFIG[select.DOMAIN])
await help_test_discovery_removal(hass, mqtt_mock, caplog, select.DOMAIN, data) | [
"async",
"def",
"test_discovery_removal_select",
"(",
"hass",
",",
"mqtt_mock",
",",
"caplog",
")",
":",
"data",
"=",
"json",
".",
"dumps",
"(",
"DEFAULT_CONFIG",
"[",
"select",
".",
"DOMAIN",
"]",
")",
"await",
"help_test_discovery_removal",
"(",
"hass",
",",... | [
303,
0
] | [
306,
83
] | python | en | ['en', 'en', 'en'] | True |
test_discovery_update_select | (hass, mqtt_mock, caplog) | Test update of discovered select. | Test update of discovered select. | async def test_discovery_update_select(hass, mqtt_mock, caplog):
"""Test update of discovered select."""
data1 = '{ "name": "Beer", "state_topic": "test-topic", "command_topic": "test-topic", "options": ["milk", "beer"]}'
data2 = '{ "name": "Milk", "state_topic": "test-topic", "command_topic": "test-topic",... | [
"async",
"def",
"test_discovery_update_select",
"(",
"hass",
",",
"mqtt_mock",
",",
"caplog",
")",
":",
"data1",
"=",
"'{ \"name\": \"Beer\", \"state_topic\": \"test-topic\", \"command_topic\": \"test-topic\", \"options\": [\"milk\", \"beer\"]}'",
"data2",
"=",
"'{ \"name\": \"Milk\"... | [
309,
0
] | [
316,
5
] | python | en | ['en', 'en', 'en'] | True |
test_discovery_update_unchanged_select | (hass, mqtt_mock, caplog) | Test update of discovered select. | Test update of discovered select. | async def test_discovery_update_unchanged_select(hass, mqtt_mock, caplog):
"""Test update of discovered select."""
data1 = '{ "name": "Beer", "state_topic": "test-topic", "command_topic": "test-topic", "options": ["milk", "beer"]}'
with patch(
"homeassistant.components.mqtt.select.MqttSelect.discove... | [
"async",
"def",
"test_discovery_update_unchanged_select",
"(",
"hass",
",",
"mqtt_mock",
",",
"caplog",
")",
":",
"data1",
"=",
"'{ \"name\": \"Beer\", \"state_topic\": \"test-topic\", \"command_topic\": \"test-topic\", \"options\": [\"milk\", \"beer\"]}'",
"with",
"patch",
"(",
"\... | [
319,
0
] | [
327,
9
] | python | en | ['en', 'en', 'en'] | True |
test_discovery_broken | (hass, mqtt_mock, caplog) | Test handling of bad discovery message. | Test handling of bad discovery message. | async def test_discovery_broken(hass, mqtt_mock, caplog):
"""Test handling of bad discovery message."""
data1 = '{ "name": "Beer" }'
data2 = '{ "name": "Milk", "state_topic": "test-topic", "command_topic": "test-topic", "options": ["milk", "beer"]}'
await help_test_discovery_broken(
hass, mqtt_... | [
"async",
"def",
"test_discovery_broken",
"(",
"hass",
",",
"mqtt_mock",
",",
"caplog",
")",
":",
"data1",
"=",
"'{ \"name\": \"Beer\" }'",
"data2",
"=",
"'{ \"name\": \"Milk\", \"state_topic\": \"test-topic\", \"command_topic\": \"test-topic\", \"options\": [\"milk\", \"beer\"]}'",
... | [
331,
0
] | [
338,
5
] | python | en | ['en', 'en', 'en'] | True |
test_entity_device_info_with_connection | (hass, mqtt_mock) | Test MQTT select device registry integration. | Test MQTT select device registry integration. | async def test_entity_device_info_with_connection(hass, mqtt_mock):
"""Test MQTT select device registry integration."""
await help_test_entity_device_info_with_connection(
hass, mqtt_mock, select.DOMAIN, DEFAULT_CONFIG
) | [
"async",
"def",
"test_entity_device_info_with_connection",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"await",
"help_test_entity_device_info_with_connection",
"(",
"hass",
",",
"mqtt_mock",
",",
"select",
".",
"DOMAIN",
",",
"DEFAULT_CONFIG",
")"
] | [
341,
0
] | [
345,
5
] | python | en | ['en', 'da', 'en'] | True |
test_entity_device_info_with_identifier | (hass, mqtt_mock) | Test MQTT select device registry integration. | Test MQTT select device registry integration. | async def test_entity_device_info_with_identifier(hass, mqtt_mock):
"""Test MQTT select device registry integration."""
await help_test_entity_device_info_with_identifier(
hass, mqtt_mock, select.DOMAIN, DEFAULT_CONFIG
) | [
"async",
"def",
"test_entity_device_info_with_identifier",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"await",
"help_test_entity_device_info_with_identifier",
"(",
"hass",
",",
"mqtt_mock",
",",
"select",
".",
"DOMAIN",
",",
"DEFAULT_CONFIG",
")"
] | [
348,
0
] | [
352,
5
] | python | en | ['en', 'da', 'en'] | True |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.