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_async_setup_entry | (hass) | Test a successful setup entry. | Test a successful setup entry. | async def test_async_setup_entry(hass):
"""Test a successful setup entry."""
await init_integration(hass)
state = hass.states.get("air_quality.home")
assert state is not None
assert state.state != STATE_UNAVAILABLE
assert state.state == "4" | [
"async",
"def",
"test_async_setup_entry",
"(",
"hass",
")",
":",
"await",
"init_integration",
"(",
"hass",
")",
"state",
"=",
"hass",
".",
"states",
".",
"get",
"(",
"\"air_quality.home\"",
")",
"assert",
"state",
"is",
"not",
"None",
"assert",
"state",
".",... | [
14,
0
] | [
21,
29
] | python | en | ['en', 'en', 'en'] | True |
test_config_not_ready | (hass) | Test for setup failure if connection to GIOS is missing. | Test for setup failure if connection to GIOS is missing. | async def test_config_not_ready(hass):
"""Test for setup failure if connection to GIOS is missing."""
entry = MockConfigEntry(
domain=DOMAIN,
title="Home",
unique_id=123,
data={"station_id": 123, "name": "Home"},
)
with patch(
"homeassistant.components.gios.Gios.... | [
"async",
"def",
"test_config_not_ready",
"(",
"hass",
")",
":",
"entry",
"=",
"MockConfigEntry",
"(",
"domain",
"=",
"DOMAIN",
",",
"title",
"=",
"\"Home\"",
",",
"unique_id",
"=",
"123",
",",
"data",
"=",
"{",
"\"station_id\"",
":",
"123",
",",
"\"name\""... | [
24,
0
] | [
39,
53
] | python | en | ['en', 'en', 'en'] | True |
test_unload_entry | (hass) | Test successful unload of entry. | Test successful unload of entry. | async def test_unload_entry(hass):
"""Test successful unload of entry."""
entry = await init_integration(hass)
assert len(hass.config_entries.async_entries(DOMAIN)) == 1
assert entry.state == ENTRY_STATE_LOADED
assert await hass.config_entries.async_unload(entry.entry_id)
await hass.async_bloc... | [
"async",
"def",
"test_unload_entry",
"(",
"hass",
")",
":",
"entry",
"=",
"await",
"init_integration",
"(",
"hass",
")",
"assert",
"len",
"(",
"hass",
".",
"config_entries",
".",
"async_entries",
"(",
"DOMAIN",
")",
")",
"==",
"1",
"assert",
"entry",
".",
... | [
42,
0
] | [
53,
36
] | python | en | ['en', 'en', 'en'] | True |
async_setup_platform | (
hass: HomeAssistant, config: dict, add_entities: Callable, discovery_info=None
) | Convert old style file configs to new style configs. | Convert old style file configs to new style configs. | async def async_setup_platform(
hass: HomeAssistant, config: dict, add_entities: Callable, discovery_info=None
) -> None:
"""Convert old style file configs to new style configs."""
hass.async_create_task(
hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_IMPORT}, dat... | [
"async",
"def",
"async_setup_platform",
"(",
"hass",
":",
"HomeAssistant",
",",
"config",
":",
"dict",
",",
"add_entities",
":",
"Callable",
",",
"discovery_info",
"=",
"None",
")",
"->",
"None",
":",
"hass",
".",
"async_create_task",
"(",
"hass",
".",
"conf... | [
49,
0
] | [
57,
5
] | python | en | ['en', 'en', 'en'] | True |
async_setup_entry | (
hass: HomeAssistant,
config_entry: ConfigEntry,
async_add_entities: Callable[[List[Entity], Optional[bool]], None],
) | Set up the config entry. | Set up the config entry. | async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
async_add_entities: Callable[[List[Entity], Optional[bool]], None],
) -> None:
"""Set up the config entry."""
data_update_coordinator = get_data_update_coordinator(hass, config_entry)
async_add_entities(
[
... | [
"async",
"def",
"async_setup_entry",
"(",
"hass",
":",
"HomeAssistant",
",",
"config_entry",
":",
"ConfigEntry",
",",
"async_add_entities",
":",
"Callable",
"[",
"[",
"List",
"[",
"Entity",
"]",
",",
"Optional",
"[",
"bool",
"]",
"]",
",",
"None",
"]",
","... | [
60,
0
] | [
73,
5
] | python | en | ['en', 'en', 'en'] | True |
DeviceCover.__init__ | (
self,
config_entry: ConfigEntry,
data_update_coordinator: DeviceDataUpdateCoordinator,
door: AbstractDoor,
) | Initialize the object. | Initialize the object. | def __init__(
self,
config_entry: ConfigEntry,
data_update_coordinator: DeviceDataUpdateCoordinator,
door: AbstractDoor,
) -> None:
"""Initialize the object."""
super().__init__(data_update_coordinator)
self._config_entry = config_entry
self._door = do... | [
"def",
"__init__",
"(",
"self",
",",
"config_entry",
":",
"ConfigEntry",
",",
"data_update_coordinator",
":",
"DeviceDataUpdateCoordinator",
",",
"door",
":",
"AbstractDoor",
",",
")",
"->",
"None",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"data_update_coor... | [
79,
4
] | [
91,
33
] | python | en | ['en', 'en', 'en'] | True |
DeviceCover.unique_id | (self) | Return a unique ID. | Return a unique ID. | def unique_id(self) -> Optional[str]:
"""Return a unique ID."""
return self._unique_id | [
"def",
"unique_id",
"(",
"self",
")",
"->",
"Optional",
"[",
"str",
"]",
":",
"return",
"self",
".",
"_unique_id"
] | [
94,
4
] | [
96,
30
] | python | ca | ['fr', 'ca', 'en'] | False |
DeviceCover.name | (self) | Return the name of the door. | Return the name of the door. | def name(self):
"""Return the name of the door."""
return self._get_door().name | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
".",
"_get_door",
"(",
")",
".",
"name"
] | [
99,
4
] | [
101,
36
] | python | en | ['en', 'nl', 'en'] | True |
DeviceCover.is_closed | (self) | Return true if cover is closed, else False. | Return true if cover is closed, else False. | def is_closed(self):
"""Return true if cover is closed, else False."""
door = self._get_door()
if door.status == DoorStatus.OPENED:
return False
if door.status == DoorStatus.CLOSED:
return True
return None | [
"def",
"is_closed",
"(",
"self",
")",
":",
"door",
"=",
"self",
".",
"_get_door",
"(",
")",
"if",
"door",
".",
"status",
"==",
"DoorStatus",
".",
"OPENED",
":",
"return",
"False",
"if",
"door",
".",
"status",
"==",
"DoorStatus",
".",
"CLOSED",
":",
"... | [
104,
4
] | [
113,
19
] | python | en | ['en', 'en', 'en'] | True |
DeviceCover.device_class | (self) | Return the class of this device, from component DEVICE_CLASSES. | Return the class of this device, from component DEVICE_CLASSES. | def device_class(self):
"""Return the class of this device, from component DEVICE_CLASSES."""
door = self._get_door()
if door.gate:
return DEVICE_CLASS_GATE
return DEVICE_CLASS_GARAGE | [
"def",
"device_class",
"(",
"self",
")",
":",
"door",
"=",
"self",
".",
"_get_door",
"(",
")",
"if",
"door",
".",
"gate",
":",
"return",
"DEVICE_CLASS_GATE",
"return",
"DEVICE_CLASS_GARAGE"
] | [
116,
4
] | [
122,
34
] | python | en | ['en', 'en', 'en'] | True |
DeviceCover.supported_features | (self) | Flag supported features. | Flag supported features. | def supported_features(self):
"""Flag supported features."""
return SUPPORT_OPEN | SUPPORT_CLOSE | [
"def",
"supported_features",
"(",
"self",
")",
":",
"return",
"SUPPORT_OPEN",
"|",
"SUPPORT_CLOSE"
] | [
125,
4
] | [
127,
43
] | python | en | ['da', 'en', 'en'] | True |
DeviceCover.async_open_cover | (self, **kwargs) | Open the door. | Open the door. | async def async_open_cover(self, **kwargs):
"""Open the door."""
await self.hass.async_add_executor_job(
self._api.open_door, self._get_door().door_id
) | [
"async",
"def",
"async_open_cover",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"await",
"self",
".",
"hass",
".",
"async_add_executor_job",
"(",
"self",
".",
"_api",
".",
"open_door",
",",
"self",
".",
"_get_door",
"(",
")",
".",
"door_id",
")"
] | [
129,
4
] | [
133,
9
] | python | en | ['en', 'nl', 'en'] | True |
DeviceCover.async_close_cover | (self, **kwargs) | Close the door. | Close the door. | async def async_close_cover(self, **kwargs):
"""Close the door."""
await self.hass.async_add_executor_job(
self._api.close_door, self._get_door().door_id
) | [
"async",
"def",
"async_close_cover",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"await",
"self",
".",
"hass",
".",
"async_add_executor_job",
"(",
"self",
".",
"_api",
".",
"close_door",
",",
"self",
".",
"_get_door",
"(",
")",
".",
"door_id",
")"
] | [
135,
4
] | [
139,
9
] | python | en | ['en', 'nl', 'en'] | True |
DeviceCover.state_attributes | (self) | Return the state attributes. | Return the state attributes. | def state_attributes(self):
"""Return the state attributes."""
attrs = super().state_attributes
attrs["door_id"] = self._get_door().door_id
return attrs | [
"def",
"state_attributes",
"(",
"self",
")",
":",
"attrs",
"=",
"super",
"(",
")",
".",
"state_attributes",
"attrs",
"[",
"\"door_id\"",
"]",
"=",
"self",
".",
"_get_door",
"(",
")",
".",
"door_id",
"return",
"attrs"
] | [
142,
4
] | [
146,
20
] | python | en | ['en', 'en', 'en'] | True |
DeviceCover.device_info | (self) | Device info for the controller. | Device info for the controller. | def device_info(self):
"""Device info for the controller."""
data = self.coordinator.data
return {
"identifiers": {(DOMAIN, self._config_entry.unique_id)},
"name": self._config_entry.title,
"manufacturer": MANUFACTURER,
"model": data.model,
... | [
"def",
"device_info",
"(",
"self",
")",
":",
"data",
"=",
"self",
".",
"coordinator",
".",
"data",
"return",
"{",
"\"identifiers\"",
":",
"{",
"(",
"DOMAIN",
",",
"self",
".",
"_config_entry",
".",
"unique_id",
")",
"}",
",",
"\"name\"",
":",
"self",
"... | [
154,
4
] | [
163,
9
] | python | en | ['en', 'en', 'en'] | True |
load_tf_weights_in_openai_gpt | (model, config, openai_checkpoint_folder_path) | Load tf pre-trained weights in a pytorch model (from NumPy arrays here) | Load tf pre-trained weights in a pytorch model (from NumPy arrays here) | def load_tf_weights_in_openai_gpt(model, config, openai_checkpoint_folder_path):
"""Load tf pre-trained weights in a pytorch model (from NumPy arrays here)"""
import re
import numpy as np
if ".ckpt" in openai_checkpoint_folder_path:
openai_checkpoint_folder_path = os.path.dirname(openai_checkp... | [
"def",
"load_tf_weights_in_openai_gpt",
"(",
"model",
",",
"config",
",",
"openai_checkpoint_folder_path",
")",
":",
"import",
"re",
"import",
"numpy",
"as",
"np",
"if",
"\".ckpt\"",
"in",
"openai_checkpoint_folder_path",
":",
"openai_checkpoint_folder_path",
"=",
"os",... | [
60,
0
] | [
138,
16
] | python | en | ['en', 'en', 'en'] | True |
OpenAIGPTPreTrainedModel._init_weights | (self, module) | Initialize the weights. | Initialize the weights. | def _init_weights(self, module):
"""Initialize the weights."""
if isinstance(module, (nn.Linear, Conv1D)):
# Slightly different from the TF version which uses truncated_normal for initialization
# cf https://github.com/pytorch/pytorch/pull/5617
module.weight.data.norm... | [
"def",
"_init_weights",
"(",
"self",
",",
"module",
")",
":",
"if",
"isinstance",
"(",
"module",
",",
"(",
"nn",
".",
"Linear",
",",
"Conv1D",
")",
")",
":",
"# Slightly different from the TF version which uses truncated_normal for initialization",
"# cf https://github.... | [
284,
4
] | [
298,
41
] | python | en | ['en', 'en', 'en'] | True |
async_setup | (hass: HomeAssistantType, config: ConfigType) | Set up the component. | Set up the component. | async def async_setup(hass: HomeAssistantType, config: ConfigType):
"""Set up the component."""
hass.data[DOMAIN_DATA_ENTRIES] = {}
hass.data[DOMAIN_DATA_TASKS] = {}
async def _stop(_):
asyncio.gather(
*[_await_cancel(task) for task in hass.data[DOMAIN_DATA_TASKS].values()]
... | [
"async",
"def",
"async_setup",
"(",
"hass",
":",
"HomeAssistantType",
",",
"config",
":",
"ConfigType",
")",
":",
"hass",
".",
"data",
"[",
"DOMAIN_DATA_ENTRIES",
"]",
"=",
"{",
"}",
"hass",
".",
"data",
"[",
"DOMAIN_DATA_TASKS",
"]",
"=",
"{",
"}",
"asy... | [
36,
0
] | [
48,
15
] | python | en | ['en', 'en', 'en'] | True |
async_setup_entry | (hass: HomeAssistantType, entry: config_entries.ConfigEntry) | Set up config entry. | Set up config entry. | async def async_setup_entry(hass: HomeAssistantType, entry: config_entries.ConfigEntry):
"""Set up config entry."""
entries = hass.data[DOMAIN_DATA_ENTRIES]
tasks = hass.data[DOMAIN_DATA_TASKS]
client = Client(entry.data[CONF_HOST], entry.data[CONF_PORT])
entries[entry.entry_id] = client
task ... | [
"async",
"def",
"async_setup_entry",
"(",
"hass",
":",
"HomeAssistantType",
",",
"entry",
":",
"config_entries",
".",
"ConfigEntry",
")",
":",
"entries",
"=",
"hass",
".",
"data",
"[",
"DOMAIN_DATA_ENTRIES",
"]",
"tasks",
"=",
"hass",
".",
"data",
"[",
"DOMA... | [
51,
0
] | [
66,
15
] | python | en | ['en', 'en', 'en'] | True |
async_unload_entry | (hass, entry) | Cleanup before removing config entry. | Cleanup before removing config entry. | async def async_unload_entry(hass, entry):
"""Cleanup before removing config entry."""
await hass.config_entries.async_forward_entry_unload(entry, "media_player")
task = hass.data[DOMAIN_DATA_TASKS].pop(entry.entry_id)
await _await_cancel(task)
hass.data[DOMAIN_DATA_ENTRIES].pop(entry.entry_id)
... | [
"async",
"def",
"async_unload_entry",
"(",
"hass",
",",
"entry",
")",
":",
"await",
"hass",
".",
"config_entries",
".",
"async_forward_entry_unload",
"(",
"entry",
",",
"\"media_player\"",
")",
"task",
"=",
"hass",
".",
"data",
"[",
"DOMAIN_DATA_TASKS",
"]",
"... | [
69,
0
] | [
78,
15
] | python | en | ['en', 'en', 'en'] | True |
setup | (hass, config) | Set up the Hunter Hydrawise component. | Set up the Hunter Hydrawise component. | def setup(hass, config):
"""Set up the Hunter Hydrawise component."""
conf = config[DOMAIN]
access_token = conf[CONF_ACCESS_TOKEN]
scan_interval = conf.get(CONF_SCAN_INTERVAL)
try:
hydrawise = Hydrawiser(user_token=access_token)
hass.data[DATA_HYDRAWISE] = HydrawiseHub(hydrawise)
... | [
"def",
"setup",
"(",
"hass",
",",
"config",
")",
":",
"conf",
"=",
"config",
"[",
"DOMAIN",
"]",
"access_token",
"=",
"conf",
"[",
"CONF_ACCESS_TOKEN",
"]",
"scan_interval",
"=",
"conf",
".",
"get",
"(",
"CONF_SCAN_INTERVAL",
")",
"try",
":",
"hydrawise",
... | [
79,
0
] | [
106,
15
] | python | en | ['en', 'en', 'en'] | True |
HydrawiseHub.__init__ | (self, data) | Initialize the entity. | Initialize the entity. | def __init__(self, data):
"""Initialize the entity."""
self.data = data | [
"def",
"__init__",
"(",
"self",
",",
"data",
")",
":",
"self",
".",
"data",
"=",
"data"
] | [
112,
4
] | [
114,
24
] | python | en | ['en', 'en', 'en'] | True |
HydrawiseEntity.__init__ | (self, data, sensor_type) | Initialize the Hydrawise entity. | Initialize the Hydrawise entity. | def __init__(self, data, sensor_type):
"""Initialize the Hydrawise entity."""
self.data = data
self._sensor_type = sensor_type
self._name = f"{self.data['name']} {DEVICE_MAP[self._sensor_type][DEVICE_MAP_INDEX.index('KEY_INDEX')]}"
self._state = None | [
"def",
"__init__",
"(",
"self",
",",
"data",
",",
"sensor_type",
")",
":",
"self",
".",
"data",
"=",
"data",
"self",
".",
"_sensor_type",
"=",
"sensor_type",
"self",
".",
"_name",
"=",
"f\"{self.data['name']} {DEVICE_MAP[self._sensor_type][DEVICE_MAP_INDEX.index('KEY_... | [
120,
4
] | [
125,
26
] | python | en | ['en', 'en', 'en'] | True |
HydrawiseEntity.name | (self) | Return the name of the sensor. | Return the name of the sensor. | def name(self):
"""Return the name of the sensor."""
return self._name | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
".",
"_name"
] | [
128,
4
] | [
130,
25
] | python | en | ['en', 'mi', 'en'] | True |
HydrawiseEntity.async_added_to_hass | (self) | Register callbacks. | Register callbacks. | async def async_added_to_hass(self):
"""Register callbacks."""
self.async_on_remove(
async_dispatcher_connect(
self.hass, SIGNAL_UPDATE_HYDRAWISE, self._update_callback
)
) | [
"async",
"def",
"async_added_to_hass",
"(",
"self",
")",
":",
"self",
".",
"async_on_remove",
"(",
"async_dispatcher_connect",
"(",
"self",
".",
"hass",
",",
"SIGNAL_UPDATE_HYDRAWISE",
",",
"self",
".",
"_update_callback",
")",
")"
] | [
132,
4
] | [
138,
9
] | python | en | ['en', 'no', 'en'] | False |
HydrawiseEntity._update_callback | (self) | Call update method. | Call update method. | def _update_callback(self):
"""Call update method."""
self.async_schedule_update_ha_state(True) | [
"def",
"_update_callback",
"(",
"self",
")",
":",
"self",
".",
"async_schedule_update_ha_state",
"(",
"True",
")"
] | [
141,
4
] | [
143,
49
] | python | en | ['en', 'sn', 'en'] | True |
HydrawiseEntity.unit_of_measurement | (self) | Return the units of measurement. | Return the units of measurement. | def unit_of_measurement(self):
"""Return the units of measurement."""
return DEVICE_MAP[self._sensor_type][
DEVICE_MAP_INDEX.index("UNIT_OF_MEASURE_INDEX")
] | [
"def",
"unit_of_measurement",
"(",
"self",
")",
":",
"return",
"DEVICE_MAP",
"[",
"self",
".",
"_sensor_type",
"]",
"[",
"DEVICE_MAP_INDEX",
".",
"index",
"(",
"\"UNIT_OF_MEASURE_INDEX\"",
")",
"]"
] | [
146,
4
] | [
150,
9
] | python | en | ['en', 'bg', 'en'] | True |
HydrawiseEntity.device_state_attributes | (self) | Return the state attributes. | Return the state attributes. | def device_state_attributes(self):
"""Return the state attributes."""
return {ATTR_ATTRIBUTION: ATTRIBUTION, "identifier": self.data.get("relay")} | [
"def",
"device_state_attributes",
"(",
"self",
")",
":",
"return",
"{",
"ATTR_ATTRIBUTION",
":",
"ATTRIBUTION",
",",
"\"identifier\"",
":",
"self",
".",
"data",
".",
"get",
"(",
"\"relay\"",
")",
"}"
] | [
153,
4
] | [
155,
84
] | python | en | ['en', 'en', 'en'] | True |
HydrawiseEntity.device_class | (self) | Return the device class of the sensor type. | Return the device class of the sensor type. | def device_class(self):
"""Return the device class of the sensor type."""
return DEVICE_MAP[self._sensor_type][
DEVICE_MAP_INDEX.index("DEVICE_CLASS_INDEX")
] | [
"def",
"device_class",
"(",
"self",
")",
":",
"return",
"DEVICE_MAP",
"[",
"self",
".",
"_sensor_type",
"]",
"[",
"DEVICE_MAP_INDEX",
".",
"index",
"(",
"\"DEVICE_CLASS_INDEX\"",
")",
"]"
] | [
158,
4
] | [
162,
9
] | python | en | ['en', 'en', 'en'] | True |
HydrawiseEntity.icon | (self) | Return the icon to use in the frontend, if any. | Return the icon to use in the frontend, if any. | def icon(self):
"""Return the icon to use in the frontend, if any."""
return DEVICE_MAP[self._sensor_type][DEVICE_MAP_INDEX.index("ICON_INDEX")] | [
"def",
"icon",
"(",
"self",
")",
":",
"return",
"DEVICE_MAP",
"[",
"self",
".",
"_sensor_type",
"]",
"[",
"DEVICE_MAP_INDEX",
".",
"index",
"(",
"\"ICON_INDEX\"",
")",
"]"
] | [
165,
4
] | [
167,
82
] | python | en | ['en', 'en', 'en'] | True |
predict | (parameters_value, regressor_gp) |
Predict by Gaussian Process Model
|
Predict by Gaussian Process Model
| def predict(parameters_value, regressor_gp):
'''
Predict by Gaussian Process Model
'''
parameters_value = numpy.array(parameters_value).reshape(-1, len(parameters_value))
mu, sigma = regressor_gp.predict(parameters_value, return_std=True)
return mu[0], sigma[0] | [
"def",
"predict",
"(",
"parameters_value",
",",
"regressor_gp",
")",
":",
"parameters_value",
"=",
"numpy",
".",
"array",
"(",
"parameters_value",
")",
".",
"reshape",
"(",
"-",
"1",
",",
"len",
"(",
"parameters_value",
")",
")",
"mu",
",",
"sigma",
"=",
... | [
11,
0
] | [
18,
26
] | python | en | ['en', 'error', 'th'] | False |
async_setup_platform | (hass, config, async_add_entities, discovery_info=None) | Set up the switch platform. | Set up the switch platform. | async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up the switch platform."""
switches = []
processor = hass.data[DOMAIN]
for switch_type in config[CONF_MONITORED_CONDITIONS]:
switches.append(AquaLogicSwitch(processor, switch_type))
async_add_enti... | [
"async",
"def",
"async_setup_platform",
"(",
"hass",
",",
"config",
",",
"async_add_entities",
",",
"discovery_info",
"=",
"None",
")",
":",
"switches",
"=",
"[",
"]",
"processor",
"=",
"hass",
".",
"data",
"[",
"DOMAIN",
"]",
"for",
"switch_type",
"in",
"... | [
32,
0
] | [
40,
32
] | python | en | ['en', 'cs', 'en'] | True |
AquaLogicSwitch.__init__ | (self, processor, switch_type) | Initialize switch. | Initialize switch. | def __init__(self, processor, switch_type):
"""Initialize switch."""
self._processor = processor
self._type = switch_type
self._state_name = {
"lights": States.LIGHTS,
"filter": States.FILTER,
"filter_low_speed": States.FILTER_LOW_SPEED,
"a... | [
"def",
"__init__",
"(",
"self",
",",
"processor",
",",
"switch_type",
")",
":",
"self",
".",
"_processor",
"=",
"processor",
"self",
".",
"_type",
"=",
"switch_type",
"self",
".",
"_state_name",
"=",
"{",
"\"lights\"",
":",
"States",
".",
"LIGHTS",
",",
... | [
46,
4
] | [
61,
22
] | python | en | ['en', 'pl', 'en'] | False |
AquaLogicSwitch.name | (self) | Return the name of the switch. | Return the name of the switch. | def name(self):
"""Return the name of the switch."""
return f"AquaLogic {SWITCH_TYPES[self._type]}" | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"f\"AquaLogic {SWITCH_TYPES[self._type]}\""
] | [
64,
4
] | [
66,
54
] | python | en | ['en', 'en', 'en'] | True |
AquaLogicSwitch.should_poll | (self) | Return the polling state. | Return the polling state. | def should_poll(self):
"""Return the polling state."""
return False | [
"def",
"should_poll",
"(",
"self",
")",
":",
"return",
"False"
] | [
69,
4
] | [
71,
20
] | python | en | ['en', 'en', 'en'] | True |
AquaLogicSwitch.is_on | (self) | Return true if device is on. | Return true if device is on. | def is_on(self):
"""Return true if device is on."""
panel = self._processor.panel
if panel is None:
return False
state = panel.get_state(self._state_name)
return state | [
"def",
"is_on",
"(",
"self",
")",
":",
"panel",
"=",
"self",
".",
"_processor",
".",
"panel",
"if",
"panel",
"is",
"None",
":",
"return",
"False",
"state",
"=",
"panel",
".",
"get_state",
"(",
"self",
".",
"_state_name",
")",
"return",
"state"
] | [
74,
4
] | [
80,
20
] | python | en | ['en', 'fy', 'en'] | True |
AquaLogicSwitch.turn_on | (self, **kwargs) | Turn the device on. | Turn the device on. | def turn_on(self, **kwargs):
"""Turn the device on."""
panel = self._processor.panel
if panel is None:
return
panel.set_state(self._state_name, True) | [
"def",
"turn_on",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"panel",
"=",
"self",
".",
"_processor",
".",
"panel",
"if",
"panel",
"is",
"None",
":",
"return",
"panel",
".",
"set_state",
"(",
"self",
".",
"_state_name",
",",
"True",
")"
] | [
82,
4
] | [
87,
47
] | python | en | ['en', 'en', 'en'] | True |
AquaLogicSwitch.turn_off | (self, **kwargs) | Turn the device off. | Turn the device off. | def turn_off(self, **kwargs):
"""Turn the device off."""
panel = self._processor.panel
if panel is None:
return
panel.set_state(self._state_name, False) | [
"def",
"turn_off",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"panel",
"=",
"self",
".",
"_processor",
".",
"panel",
"if",
"panel",
"is",
"None",
":",
"return",
"panel",
".",
"set_state",
"(",
"self",
".",
"_state_name",
",",
"False",
")"
] | [
89,
4
] | [
94,
48
] | python | en | ['en', 'en', 'en'] | True |
AquaLogicSwitch.async_added_to_hass | (self) | Register callbacks. | Register callbacks. | async def async_added_to_hass(self):
"""Register callbacks."""
self.async_on_remove(
self.hass.helpers.dispatcher.async_dispatcher_connect(
UPDATE_TOPIC, self.async_write_ha_state
)
) | [
"async",
"def",
"async_added_to_hass",
"(",
"self",
")",
":",
"self",
".",
"async_on_remove",
"(",
"self",
".",
"hass",
".",
"helpers",
".",
"dispatcher",
".",
"async_dispatcher_connect",
"(",
"UPDATE_TOPIC",
",",
"self",
".",
"async_write_ha_state",
")",
")"
] | [
96,
4
] | [
102,
9
] | python | en | ['en', 'no', 'en'] | False |
calls_fixture | (hass) | Track calls to a mock service. | Track calls to a mock service. | def calls_fixture(hass):
"""Track calls to a mock service."""
return async_mock_service(hass, "test", "automation") | [
"def",
"calls_fixture",
"(",
"hass",
")",
":",
"return",
"async_mock_service",
"(",
"hass",
",",
"\"test\"",
",",
"\"automation\"",
")"
] | [
29,
0
] | [
31,
57
] | python | en | ['en', 'en', 'en'] | True |
test_template_state_text | (hass, calls) | Test the state text of a template. | Test the state text of a template. | async def test_template_state_text(hass, calls):
"""Test the state text of a template."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
... | [
"async",
"def",
"test_template_state_text",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover... | [
34,
0
] | [
74,
38
] | python | en | ['en', 'en', 'en'] | True |
test_template_state_boolean | (hass, calls) | Test the value_template attribute. | Test the value_template attribute. | async def test_template_state_boolean(hass, calls):
"""Test the value_template attribute."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
... | [
"async",
"def",
"test_template_state_boolean",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"co... | [
77,
0
] | [
108,
36
] | python | en | ['en', 'en', 'en'] | True |
test_template_position | (hass, calls) | Test the position_template attribute. | Test the position_template attribute. | async def test_template_position(hass, calls):
"""Test the position_template attribute."""
hass.states.async_set("cover.test", STATE_OPEN)
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": ... | [
"async",
"def",
"test_template_position",
"(",
"hass",
",",
"calls",
")",
":",
"hass",
".",
"states",
".",
"async_set",
"(",
"\"cover.test\"",
",",
"STATE_OPEN",
")",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
... | [
111,
0
] | [
164,
38
] | python | en | ['en', 'en', 'en'] | True |
test_template_tilt | (hass, calls) | Test the tilt_template attribute. | Test the tilt_template attribute. | async def test_template_tilt(hass, calls):
"""Test the tilt_template attribute."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
... | [
"async",
"def",
"test_template_tilt",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\"",
... | [
167,
0
] | [
199,
64
] | python | en | ['en', 'en', 'en'] | True |
test_template_out_of_bounds | (hass, calls) | Test template out-of-bounds condition. | Test template out-of-bounds condition. | async def test_template_out_of_bounds(hass, calls):
"""Test template out-of-bounds condition."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
... | [
"async",
"def",
"test_template_out_of_bounds",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"co... | [
202,
0
] | [
235,
59
] | python | en | ['en', 'en', 'en'] | True |
test_template_mutex | (hass, calls) | Test that only value or position template can be used. | Test that only value or position template can be used. | async def test_template_mutex(hass, calls):
"""Test that only value or position template can be used."""
with assert_setup_component(0, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "tem... | [
"async",
"def",
"test_template_mutex",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"0",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\"",
... | [
238,
0
] | [
272,
40
] | python | en | ['en', 'en', 'en'] | True |
test_template_open_or_position | (hass, caplog) | Test that at least one of open_cover or set_position is used. | Test that at least one of open_cover or set_position is used. | async def test_template_open_or_position(hass, caplog):
"""Test that at least one of open_cover or set_position is used."""
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
"covers": {"test_template_... | [
"async",
"def",
"test_template_open_or_position",
"(",
"hass",
",",
"caplog",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\"",
":",
"{",
"\"platform\"",
":",
"\"template\"",
",",
"\"covers\... | [
275,
0
] | [
290,
63
] | python | en | ['en', 'en', 'en'] | True |
test_template_open_and_close | (hass, calls) | Test that if open_cover is specified, close_cover is too. | Test that if open_cover is specified, close_cover is too. | async def test_template_open_and_close(hass, calls):
"""Test that if open_cover is specified, close_cover is too."""
with assert_setup_component(0, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"pla... | [
"async",
"def",
"test_template_open_and_close",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"0",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"c... | [
293,
0
] | [
319,
40
] | python | en | ['en', 'en', 'en'] | True |
test_template_non_numeric | (hass, calls) | Test that tilt_template values are numeric. | Test that tilt_template values are numeric. | async def test_template_non_numeric(hass, calls):
"""Test that tilt_template values are numeric."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template... | [
"async",
"def",
"test_template_non_numeric",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cove... | [
322,
0
] | [
359,
59
] | python | en | ['en', 'en', 'en'] | True |
test_open_action | (hass, calls) | Test the open_cover command. | Test the open_cover command. | async def test_open_action(hass, calls):
"""Test the open_cover command."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
"... | [
"async",
"def",
"test_open_action",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\"",
"... | [
362,
0
] | [
397,
26
] | python | en | ['en', 'en', 'en'] | True |
test_close_stop_action | (hass, calls) | Test the close-cover and stop_cover commands. | Test the close-cover and stop_cover commands. | async def test_close_stop_action(hass, calls):
"""Test the close-cover and stop_cover commands."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template"... | [
"async",
"def",
"test_close_stop_action",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\"... | [
400,
0
] | [
441,
26
] | python | en | ['en', 'en', 'en'] | True |
test_set_position | (hass, calls) | Test the set_position command. | Test the set_position command. | async def test_set_position(hass, calls):
"""Test the set_position command."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"input_number",
{"input_number": {"test": {"min": "0", "max": "100", "initial": "42"}}},
)
... | [
"async",
"def",
"test_set_position",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"input_number\"",
",",
"{",
"\"input... | [
444,
0
] | [
517,
59
] | python | en | ['en', 'fr', 'en'] | True |
test_set_tilt_position | (hass, calls) | Test the set_tilt_position command. | Test the set_tilt_position command. | async def test_set_tilt_position(hass, calls):
"""Test the set_tilt_position command."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
... | [
"async",
"def",
"test_set_tilt_position",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\"... | [
520,
0
] | [
559,
26
] | python | en | ['en', 'fr', 'en'] | True |
test_open_tilt_action | (hass, calls) | Test the open_cover_tilt command. | Test the open_cover_tilt command. | async def test_open_tilt_action(hass, calls):
"""Test the open_cover_tilt command."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
... | [
"async",
"def",
"test_open_tilt_action",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\""... | [
562,
0
] | [
598,
26
] | python | en | ['en', 'no', 'en'] | True |
test_close_tilt_action | (hass, calls) | Test the close_cover_tilt command. | Test the close_cover_tilt command. | async def test_close_tilt_action(hass, calls):
"""Test the close_cover_tilt command."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
... | [
"async",
"def",
"test_close_tilt_action",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\"... | [
601,
0
] | [
637,
26
] | python | en | ['en', 'fr', 'en'] | True |
test_set_position_optimistic | (hass, calls) | Test optimistic position mode. | Test optimistic position mode. | async def test_set_position_optimistic(hass, calls):
"""Test optimistic position mode."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
... | [
"async",
"def",
"test_set_position_optimistic",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"c... | [
640,
0
] | [
700,
36
] | python | en | ['en', 'fr', 'en'] | True |
test_set_tilt_position_optimistic | (hass, calls) | Test the optimistic tilt_position mode. | Test the optimistic tilt_position mode. | async def test_set_tilt_position_optimistic(hass, calls):
"""Test the optimistic tilt_position mode."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "temp... | [
"async",
"def",
"test_set_tilt_position_optimistic",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
... | [
703,
0
] | [
765,
65
] | python | en | ['en', 'no', 'en'] | True |
test_icon_template | (hass, calls) | Test icon template. | Test icon template. | async def test_icon_template(hass, calls):
"""Test icon template."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
"covers"... | [
"async",
"def",
"test_icon_template",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\"",
... | [
768,
0
] | [
809,
50
] | python | en | ['en', 'en', 'en'] | True |
test_entity_picture_template | (hass, calls) | Test icon template. | Test icon template. | async def test_entity_picture_template(hass, calls):
"""Test icon template."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
... | [
"async",
"def",
"test_entity_picture_template",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"c... | [
812,
0
] | [
853,
67
] | python | en | ['en', 'en', 'en'] | True |
test_availability_template | (hass, calls) | Test availability template. | Test availability template. | async def test_availability_template(hass, calls):
"""Test availability template."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
... | [
"async",
"def",
"test_availability_template",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cov... | [
856,
0
] | [
895,
82
] | python | en | ['en', 'ga', 'en'] | True |
test_availability_without_availability_template | (hass, calls) | Test that component is available if there is no. | Test that component is available if there is no. | async def test_availability_without_availability_template(hass, calls):
"""Test that component is available if there is no."""
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
"covers": {
... | [
"async",
"def",
"test_availability_without_availability_template",
"(",
"hass",
",",
"calls",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\"",
":",
"{",
"\"platform\"",
":",
"\"template\"",
"... | [
898,
0
] | [
928,
43
] | python | en | ['en', 'en', 'en'] | True |
test_invalid_availability_template_keeps_component_available | (hass, caplog) | Test that an invalid availability keeps the device available. | Test that an invalid availability keeps the device available. | async def test_invalid_availability_template_keeps_component_available(hass, caplog):
"""Test that an invalid availability keeps the device available."""
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
... | [
"async",
"def",
"test_invalid_availability_template_keeps_component_available",
"(",
"hass",
",",
"caplog",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\"",
":",
"{",
"\"platform\"",
":",
"\"te... | [
931,
0
] | [
962,
62
] | python | en | ['en', 'en', 'en'] | True |
test_device_class | (hass, calls) | Test device class. | Test device class. | async def test_device_class(hass, calls):
"""Test device class."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
"covers": ... | [
"async",
"def",
"test_device_class",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\"",
... | [
965,
0
] | [
997,
57
] | python | en | ['fr', 'en', 'en'] | True |
test_invalid_device_class | (hass, calls) | Test device class. | Test device class. | async def test_invalid_device_class(hass, calls):
"""Test device class."""
with assert_setup_component(0, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
"c... | [
"async",
"def",
"test_invalid_device_class",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"0",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cove... | [
1000,
0
] | [
1032,
20
] | python | en | ['fr', 'en', 'en'] | True |
test_unique_id | (hass) | Test unique_id option only creates one cover per id. | Test unique_id option only creates one cover per id. | async def test_unique_id(hass):
"""Test unique_id option only creates one cover per id."""
await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
"covers": {
"test_template_cover_01": {
... | [
"async",
"def",
"test_unique_id",
"(",
"hass",
")",
":",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\"",
":",
"{",
"\"platform\"",
":",
"\"template\"",
",",
"\"covers\"",
":",
"{",
"\"test_template_cover_01\"... | [
1035,
0
] | [
1077,
44
] | python | en | ['en', 'en', 'en'] | True |
test_state_gets_lowercased | (hass) | Test True/False is lowercased. | Test True/False is lowercased. | async def test_state_gets_lowercased(hass):
"""Test True/False is lowercased."""
hass.states.async_set("binary_sensor.garage_door_sensor", "off")
await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
"cove... | [
"async",
"def",
"test_state_gets_lowercased",
"(",
"hass",
")",
":",
"hass",
".",
"states",
".",
"async_set",
"(",
"\"binary_sensor.garage_door_sensor\"",
",",
"\"off\"",
")",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",... | [
1080,
0
] | [
1118,
69
] | python | en | ['en', 'et', 'en'] | True |
test_self_referencing_icon_with_no_template_is_not_a_loop | (hass, caplog) | Test a self referencing icon with no value template is not a loop. | Test a self referencing icon with no value template is not a loop. | async def test_self_referencing_icon_with_no_template_is_not_a_loop(hass, caplog):
"""Test a self referencing icon with no value template is not a loop."""
icon_template_str = """{% if is_state('cover.office', 'open') %}
mdi:window-shutter-open
{% else %}
mdi:window-shutter
... | [
"async",
"def",
"test_self_referencing_icon_with_no_template_is_not_a_loop",
"(",
"hass",
",",
"caplog",
")",
":",
"icon_template_str",
"=",
"\"\"\"{% if is_state('cover.office', 'open') %}\n mdi:window-shutter-open\n {% else %}\n mdi:window-shutter\n {%... | [
1121,
0
] | [
1163,
54
] | python | en | ['en', 'en', 'en'] | True |
setFixtureParamNames | (request, orderedParamNameList) |
Given a request fixture and a list of param names ordered based on the order
the params are specified for a parameterized fixture, this will set the
names so reporting tools can label the parameterized benchmark runs
accordingly. This is only needed for parameterized fixtures, since
parameterized ... |
Given a request fixture and a list of param names ordered based on the order
the params are specified for a parameterized fixture, this will set the
names so reporting tools can label the parameterized benchmark runs
accordingly. This is only needed for parameterized fixtures, since
parameterized ... | def setFixtureParamNames(request, orderedParamNameList):
"""
Given a request fixture and a list of param names ordered based on the order
the params are specified for a parameterized fixture, this will set the
names so reporting tools can label the parameterized benchmark runs
accordingly. This is ... | [
"def",
"setFixtureParamNames",
"(",
"request",
",",
"orderedParamNameList",
")",
":",
"# This function can also be called on a single test param, which may result",
"# in request.param *not* being a list of param values.",
"if",
"type",
"(",
"request",
".",
"param",
")",
"is",
"l... | [
2,
0
] | [
42,
71
] | python | en | ['en', 'error', 'th'] | False |
async_setup_entry | (hass, config_entry, async_add_entities) | Set up tuya sensors dynamically through tuya discovery. | Set up tuya sensors dynamically through tuya discovery. | async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up tuya sensors dynamically through tuya discovery."""
platform = config_entry.data[CONF_PLATFORM]
async def async_discover_sensor(dev_ids):
"""Discover and add a discovered tuya sensor."""
if not dev_ids:
... | [
"async",
"def",
"async_setup_entry",
"(",
"hass",
",",
"config_entry",
",",
"async_add_entities",
")",
":",
"platform",
"=",
"config_entry",
".",
"data",
"[",
"CONF_PLATFORM",
"]",
"async",
"def",
"async_discover_sensor",
"(",
"dev_ids",
")",
":",
"\"\"\"Discover ... | [
20,
0
] | [
42,
44
] | python | en | ['en', 'zu', 'en'] | True |
_setup_entities | (hass, dev_ids, platform) | Set up Tuya Cover device. | Set up Tuya Cover device. | def _setup_entities(hass, dev_ids, platform):
"""Set up Tuya Cover device."""
tuya = hass.data[DOMAIN][TUYA_DATA]
entities = []
for dev_id in dev_ids:
device = tuya.get_device_by_id(dev_id)
if device is None:
continue
entities.append(TuyaCover(device, platform))
r... | [
"def",
"_setup_entities",
"(",
"hass",
",",
"dev_ids",
",",
"platform",
")",
":",
"tuya",
"=",
"hass",
".",
"data",
"[",
"DOMAIN",
"]",
"[",
"TUYA_DATA",
"]",
"entities",
"=",
"[",
"]",
"for",
"dev_id",
"in",
"dev_ids",
":",
"device",
"=",
"tuya",
".... | [
45,
0
] | [
54,
19
] | python | ca | ['ca', 'zu', 'en'] | False |
TuyaCover.__init__ | (self, tuya, platform) | Init tuya cover device. | Init tuya cover device. | def __init__(self, tuya, platform):
"""Init tuya cover device."""
super().__init__(tuya, platform)
self.entity_id = ENTITY_ID_FORMAT.format(tuya.object_id())
self._was_closing = False
self._was_opening = False | [
"def",
"__init__",
"(",
"self",
",",
"tuya",
",",
"platform",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"tuya",
",",
"platform",
")",
"self",
".",
"entity_id",
"=",
"ENTITY_ID_FORMAT",
".",
"format",
"(",
"tuya",
".",
"object_id",
"(",
")",
... | [
60,
4
] | [
65,
33
] | python | en | ['ca', 'en', 'en'] | True |
TuyaCover.supported_features | (self) | Flag supported features. | Flag supported features. | def supported_features(self):
"""Flag supported features."""
if self._tuya.support_stop():
return SUPPORT_OPEN | SUPPORT_CLOSE | SUPPORT_STOP
return SUPPORT_OPEN | SUPPORT_CLOSE | [
"def",
"supported_features",
"(",
"self",
")",
":",
"if",
"self",
".",
"_tuya",
".",
"support_stop",
"(",
")",
":",
"return",
"SUPPORT_OPEN",
"|",
"SUPPORT_CLOSE",
"|",
"SUPPORT_STOP",
"return",
"SUPPORT_OPEN",
"|",
"SUPPORT_CLOSE"
] | [
68,
4
] | [
72,
43
] | python | en | ['da', 'en', 'en'] | True |
TuyaCover.is_opening | (self) | Return if the cover is opening or not. | Return if the cover is opening or not. | def is_opening(self):
"""Return if the cover is opening or not."""
state = self._tuya.state()
if state == 1:
self._was_opening = True
self._was_closing = False
return True
return False | [
"def",
"is_opening",
"(",
"self",
")",
":",
"state",
"=",
"self",
".",
"_tuya",
".",
"state",
"(",
")",
"if",
"state",
"==",
"1",
":",
"self",
".",
"_was_opening",
"=",
"True",
"self",
".",
"_was_closing",
"=",
"False",
"return",
"True",
"return",
"F... | [
75,
4
] | [
82,
20
] | python | en | ['en', 'en', 'en'] | True |
TuyaCover.is_closing | (self) | Return if the cover is closing or not. | Return if the cover is closing or not. | def is_closing(self):
"""Return if the cover is closing or not."""
state = self._tuya.state()
if state == 2:
self._was_opening = False
self._was_closing = True
return True
return False | [
"def",
"is_closing",
"(",
"self",
")",
":",
"state",
"=",
"self",
".",
"_tuya",
".",
"state",
"(",
")",
"if",
"state",
"==",
"2",
":",
"self",
".",
"_was_opening",
"=",
"False",
"self",
".",
"_was_closing",
"=",
"True",
"return",
"True",
"return",
"F... | [
85,
4
] | [
92,
20
] | python | en | ['en', 'en', 'en'] | True |
TuyaCover.is_closed | (self) | Return if the cover is closed or not. | Return if the cover is closed or not. | def is_closed(self):
"""Return if the cover is closed or not."""
state = self._tuya.state()
if state != 2 and self._was_closing:
return True
if state != 1 and self._was_opening:
return False
return None | [
"def",
"is_closed",
"(",
"self",
")",
":",
"state",
"=",
"self",
".",
"_tuya",
".",
"state",
"(",
")",
"if",
"state",
"!=",
"2",
"and",
"self",
".",
"_was_closing",
":",
"return",
"True",
"if",
"state",
"!=",
"1",
"and",
"self",
".",
"_was_opening",
... | [
95,
4
] | [
102,
19
] | python | en | ['en', 'en', 'en'] | True |
TuyaCover.open_cover | (self, **kwargs) | Open the cover. | Open the cover. | def open_cover(self, **kwargs):
"""Open the cover."""
self._tuya.open_cover() | [
"def",
"open_cover",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"_tuya",
".",
"open_cover",
"(",
")"
] | [
104,
4
] | [
106,
31
] | python | en | ['en', 'en', 'en'] | True |
TuyaCover.close_cover | (self, **kwargs) | Close cover. | Close cover. | def close_cover(self, **kwargs):
"""Close cover."""
self._tuya.close_cover() | [
"def",
"close_cover",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"_tuya",
".",
"close_cover",
"(",
")"
] | [
108,
4
] | [
110,
32
] | python | en | ['en', 'la', 'en'] | False |
TuyaCover.stop_cover | (self, **kwargs) | Stop the cover. | Stop the cover. | def stop_cover(self, **kwargs):
"""Stop the cover."""
if self.is_closed is None:
self._was_opening = False
self._was_closing = False
self._tuya.stop_cover() | [
"def",
"stop_cover",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"is_closed",
"is",
"None",
":",
"self",
".",
"_was_opening",
"=",
"False",
"self",
".",
"_was_closing",
"=",
"False",
"self",
".",
"_tuya",
".",
"stop_cover",
"(",
... | [
112,
4
] | [
117,
31
] | python | en | ['en', 'en', 'en'] | True |
get_scanner | (hass, config) | Validate the configuration and return a Quantum Gateway scanner. | Validate the configuration and return a Quantum Gateway scanner. | def get_scanner(hass, config):
"""Validate the configuration and return a Quantum Gateway scanner."""
scanner = QuantumGatewayDeviceScanner(config[DOMAIN])
return scanner if scanner.success_init else None | [
"def",
"get_scanner",
"(",
"hass",
",",
"config",
")",
":",
"scanner",
"=",
"QuantumGatewayDeviceScanner",
"(",
"config",
"[",
"DOMAIN",
"]",
")",
"return",
"scanner",
"if",
"scanner",
".",
"success_init",
"else",
"None"
] | [
28,
0
] | [
32,
52
] | python | en | ['en', 'en', 'en'] | True |
QuantumGatewayDeviceScanner.__init__ | (self, config) | Initialize the scanner. | Initialize the scanner. | def __init__(self, config):
"""Initialize the scanner."""
self.host = config[CONF_HOST]
self.password = config[CONF_PASSWORD]
self.use_https = config[CONF_SSL]
_LOGGER.debug("Initializing")
try:
self.quantum = QuantumGatewayScanner(
self.host... | [
"def",
"__init__",
"(",
"self",
",",
"config",
")",
":",
"self",
".",
"host",
"=",
"config",
"[",
"CONF_HOST",
"]",
"self",
".",
"password",
"=",
"config",
"[",
"CONF_PASSWORD",
"]",
"self",
".",
"use_https",
"=",
"config",
"[",
"CONF_SSL",
"]",
"_LOGG... | [
38,
4
] | [
56,
80
] | python | en | ['en', 'en', 'en'] | True |
QuantumGatewayDeviceScanner.scan_devices | (self) | Scan for new devices and return a list of found MACs. | Scan for new devices and return a list of found MACs. | def scan_devices(self):
"""Scan for new devices and return a list of found MACs."""
connected_devices = []
try:
connected_devices = self.quantum.scan_devices()
except RequestException:
_LOGGER.error("Unable to scan devices. Check connection to router")
ret... | [
"def",
"scan_devices",
"(",
"self",
")",
":",
"connected_devices",
"=",
"[",
"]",
"try",
":",
"connected_devices",
"=",
"self",
".",
"quantum",
".",
"scan_devices",
"(",
")",
"except",
"RequestException",
":",
"_LOGGER",
".",
"error",
"(",
"\"Unable to scan de... | [
58,
4
] | [
65,
32
] | python | en | ['en', 'en', 'en'] | True |
QuantumGatewayDeviceScanner.get_device_name | (self, device) | Return the name of the given device or None if we don't know. | Return the name of the given device or None if we don't know. | def get_device_name(self, device):
"""Return the name of the given device or None if we don't know."""
return self.quantum.get_device_name(device) | [
"def",
"get_device_name",
"(",
"self",
",",
"device",
")",
":",
"return",
"self",
".",
"quantum",
".",
"get_device_name",
"(",
"device",
")"
] | [
67,
4
] | [
69,
51
] | python | en | ['en', 'en', 'en'] | True |
get_service | (hass, config, discovery_info=None) | Get the Clickatell notification service. | Get the Clickatell notification service. | def get_service(hass, config, discovery_info=None):
"""Get the Clickatell notification service."""
return ClickatellNotificationService(config) | [
"def",
"get_service",
"(",
"hass",
",",
"config",
",",
"discovery_info",
"=",
"None",
")",
":",
"return",
"ClickatellNotificationService",
"(",
"config",
")"
] | [
21,
0
] | [
23,
48
] | python | en | ['en', 'en', 'en'] | True |
ClickatellNotificationService.__init__ | (self, config) | Initialize the service. | Initialize the service. | def __init__(self, config):
"""Initialize the service."""
self.api_key = config[CONF_API_KEY]
self.recipient = config[CONF_RECIPIENT] | [
"def",
"__init__",
"(",
"self",
",",
"config",
")",
":",
"self",
".",
"api_key",
"=",
"config",
"[",
"CONF_API_KEY",
"]",
"self",
".",
"recipient",
"=",
"config",
"[",
"CONF_RECIPIENT",
"]"
] | [
29,
4
] | [
32,
47
] | python | en | ['en', 'en', 'en'] | True |
ClickatellNotificationService.send_message | (self, message="", **kwargs) | Send a message to a user. | Send a message to a user. | def send_message(self, message="", **kwargs):
"""Send a message to a user."""
data = {"apiKey": self.api_key, "to": self.recipient, "content": message}
resp = requests.get(BASE_API_URL, params=data, timeout=5)
if (resp.status_code != HTTP_OK) or (resp.status_code != HTTP_ACCEPTED):
... | [
"def",
"send_message",
"(",
"self",
",",
"message",
"=",
"\"\"",
",",
"*",
"*",
"kwargs",
")",
":",
"data",
"=",
"{",
"\"apiKey\"",
":",
"self",
".",
"api_key",
",",
"\"to\"",
":",
"self",
".",
"recipient",
",",
"\"content\"",
":",
"message",
"}",
"r... | [
34,
4
] | [
40,
71
] | python | en | ['en', 'en', 'en'] | True |
test_setup | (hass: HomeAssistant) | Test setting up manually. | Test setting up manually. | async def test_setup(hass: HomeAssistant) -> None:
"""Test setting up manually."""
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_USER},
)
assert result["type"] == RESULT_TYPE_FORM
assert result["step_id"] == "confirm"
assert not result["err... | [
"async",
"def",
"test_setup",
"(",
"hass",
":",
"HomeAssistant",
")",
"->",
"None",
":",
"result",
"=",
"await",
"hass",
".",
"config_entries",
".",
"flow",
".",
"async_init",
"(",
"DOMAIN",
",",
"context",
"=",
"{",
"\"source\"",
":",
"SOURCE_USER",
"}",
... | [
16,
0
] | [
28,
53
] | python | en | ['en', 'en', 'en'] | True |
test_not_supported | (hass: HomeAssistant) | Test setting up on not supported system. | Test setting up on not supported system. | async def test_not_supported(hass: HomeAssistant) -> None:
"""Test setting up on not supported system."""
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_USER},
)
with patch(MODULE, return_value=None):
result = await hass.config_entries.flow... | [
"async",
"def",
"test_not_supported",
"(",
"hass",
":",
"HomeAssistant",
")",
"->",
"None",
":",
"result",
"=",
"await",
"hass",
".",
"config_entries",
".",
"flow",
".",
"async_init",
"(",
"DOMAIN",
",",
"context",
"=",
"{",
"\"source\"",
":",
"SOURCE_USER",... | [
31,
0
] | [
41,
49
] | python | en | ['en', 'en', 'en'] | True |
test_onboarding | (hass: HomeAssistant) | Test setting up via onboarding. | Test setting up via onboarding. | async def test_onboarding(hass: HomeAssistant) -> None:
"""Test setting up via onboarding."""
with patch(MODULE, return_value=MagicMock()):
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": "onboarding"},
)
assert result["type"] == RESULT_... | [
"async",
"def",
"test_onboarding",
"(",
"hass",
":",
"HomeAssistant",
")",
"->",
"None",
":",
"with",
"patch",
"(",
"MODULE",
",",
"return_value",
"=",
"MagicMock",
"(",
")",
")",
":",
"result",
"=",
"await",
"hass",
".",
"config_entries",
".",
"flow",
"... | [
44,
0
] | [
51,
53
] | python | en | ['en', 'en', 'en'] | True |
test_onboarding_not_supported | (hass: HomeAssistant) | Test setting up via onboarding with unsupported system. | Test setting up via onboarding with unsupported system. | async def test_onboarding_not_supported(hass: HomeAssistant) -> None:
"""Test setting up via onboarding with unsupported system."""
with patch(MODULE, return_value=None):
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": "onboarding"},
)
a... | [
"async",
"def",
"test_onboarding_not_supported",
"(",
"hass",
":",
"HomeAssistant",
")",
"->",
"None",
":",
"with",
"patch",
"(",
"MODULE",
",",
"return_value",
"=",
"None",
")",
":",
"result",
"=",
"await",
"hass",
".",
"config_entries",
".",
"flow",
".",
... | [
54,
0
] | [
62,
49
] | python | en | ['en', 'en', 'en'] | True |
async_setup_platform | (hass, config, async_add_entities, discovery_info=None) | Set up the Volvo sensors. | Set up the Volvo sensors. | async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up the Volvo sensors."""
if discovery_info is None:
return
async_add_entities([VolvoSensor(hass.data[DATA_KEY], *discovery_info)]) | [
"async",
"def",
"async_setup_platform",
"(",
"hass",
",",
"config",
",",
"async_add_entities",
",",
"discovery_info",
"=",
"None",
")",
":",
"if",
"discovery_info",
"is",
"None",
":",
"return",
"async_add_entities",
"(",
"[",
"VolvoSensor",
"(",
"hass",
".",
"... | [
4,
0
] | [
8,
75
] | python | en | ['en', 'ko', 'en'] | True |
VolvoSensor.state | (self) | Return the state. | Return the state. | def state(self):
"""Return the state."""
return self.instrument.state | [
"def",
"state",
"(",
"self",
")",
":",
"return",
"self",
".",
"instrument",
".",
"state"
] | [
15,
4
] | [
17,
36
] | python | en | ['en', 'en', 'en'] | True |
VolvoSensor.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.instrument.unit | [
"def",
"unit_of_measurement",
"(",
"self",
")",
":",
"return",
"self",
".",
"instrument",
".",
"unit"
] | [
20,
4
] | [
22,
35
] | python | en | ['en', 'la', 'en'] | True |
async_get_triggers | (hass: HomeAssistant, device_id: str) | List device triggers for Lock devices. | List device triggers for Lock devices. | async def async_get_triggers(hass: HomeAssistant, device_id: str) -> List[dict]:
"""List device triggers for Lock devices."""
registry = await entity_registry.async_get_registry(hass)
triggers = []
# Get all the integrations entities for this device
for entry in entity_registry.async_entries_for_de... | [
"async",
"def",
"async_get_triggers",
"(",
"hass",
":",
"HomeAssistant",
",",
"device_id",
":",
"str",
")",
"->",
"List",
"[",
"dict",
"]",
":",
"registry",
"=",
"await",
"entity_registry",
".",
"async_get_registry",
"(",
"hass",
")",
"triggers",
"=",
"[",
... | [
33,
0
] | [
63,
19
] | python | en | ['da', 'en', 'en'] | True |
async_attach_trigger | (
hass: HomeAssistant,
config: ConfigType,
action: AutomationActionType,
automation_info: dict,
) | Attach a trigger. | Attach a trigger. | async def async_attach_trigger(
hass: HomeAssistant,
config: ConfigType,
action: AutomationActionType,
automation_info: dict,
) -> CALLBACK_TYPE:
"""Attach a trigger."""
config = TRIGGER_SCHEMA(config)
if config[CONF_TYPE] == "locked":
from_state = STATE_UNLOCKED
to_state = ... | [
"async",
"def",
"async_attach_trigger",
"(",
"hass",
":",
"HomeAssistant",
",",
"config",
":",
"ConfigType",
",",
"action",
":",
"AutomationActionType",
",",
"automation_info",
":",
"dict",
",",
")",
"->",
"CALLBACK_TYPE",
":",
"config",
"=",
"TRIGGER_SCHEMA",
"... | [
66,
0
] | [
91,
5
] | python | en | ['en', 'lb', 'en'] | True |
setup | (hass, config) | Set up the component. | Set up the component. | def setup(hass, config):
"""Set up the component."""
# Create API Clients for later use
hass.data[PROXMOX_CLIENTS] = {}
for entry in config[DOMAIN]:
host = entry[CONF_HOST]
port = entry[CONF_PORT]
user = entry[CONF_USERNAME]
realm = entry[CONF_REALM]
password = e... | [
"def",
"setup",
"(",
"hass",
",",
"config",
")",
":",
"# Create API Clients for later use",
"hass",
".",
"data",
"[",
"PROXMOX_CLIENTS",
"]",
"=",
"{",
"}",
"for",
"entry",
"in",
"config",
"[",
"DOMAIN",
"]",
":",
"host",
"=",
"entry",
"[",
"CONF_HOST",
... | [
73,
0
] | [
111,
16
] | python | en | ['en', 'en', 'en'] | True |
ProxmoxClient.__init__ | (self, host, port, user, realm, password, verify_ssl) | Initialize the ProxmoxClient. | Initialize the ProxmoxClient. | def __init__(self, host, port, user, realm, password, verify_ssl):
"""Initialize the ProxmoxClient."""
self._host = host
self._port = port
self._user = user
self._realm = realm
self._password = password
self._verify_ssl = verify_ssl
self._proxmox = None
... | [
"def",
"__init__",
"(",
"self",
",",
"host",
",",
"port",
",",
"user",
",",
"realm",
",",
"password",
",",
"verify_ssl",
")",
":",
"self",
".",
"_host",
"=",
"host",
"self",
".",
"_port",
"=",
"port",
"self",
".",
"_user",
"=",
"user",
"self",
".",... | [
124,
4
] | [
135,
42
] | python | en | ['en', 'en', 'en'] | True |
ProxmoxClient.build_client | (self) | Construct the ProxmoxAPI client. Allows inserting the realm within the `user` value. | Construct the ProxmoxAPI client. Allows inserting the realm within the `user` value. | def build_client(self):
"""Construct the ProxmoxAPI client. Allows inserting the realm within the `user` value."""
if "@" in self._user:
user_id = self._user
else:
user_id = f"{self._user}@{self._realm}"
self._proxmox = ProxmoxAPI(
self._host,
... | [
"def",
"build_client",
"(",
"self",
")",
":",
"if",
"\"@\"",
"in",
"self",
".",
"_user",
":",
"user_id",
"=",
"self",
".",
"_user",
"else",
":",
"user_id",
"=",
"f\"{self._user}@{self._realm}\"",
"self",
".",
"_proxmox",
"=",
"ProxmoxAPI",
"(",
"self",
"."... | [
137,
4
] | [
151,
9
] | python | en | ['en', 'en', 'en'] | True |
ProxmoxClient.get_api_client | (self) | Return the ProxmoxAPI client. | Return the ProxmoxAPI client. | def get_api_client(self):
"""Return the ProxmoxAPI client."""
return self._proxmox | [
"def",
"get_api_client",
"(",
"self",
")",
":",
"return",
"self",
".",
"_proxmox"
] | [
153,
4
] | [
155,
28
] | python | en | ['en', 'sq', 'en'] | True |
async_setup_entry | (
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: Callable
) | Set up Notion sensors based on a config entry. | Set up Notion sensors based on a config entry. | async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: Callable
):
"""Set up Notion sensors based on a config entry."""
coordinator = hass.data[DOMAIN][DATA_COORDINATOR][entry.entry_id]
sensor_list = []
for task_id, task in coordinator.data["tasks"].items():
... | [
"async",
"def",
"async_setup_entry",
"(",
"hass",
":",
"HomeAssistant",
",",
"entry",
":",
"ConfigEntry",
",",
"async_add_entities",
":",
"Callable",
")",
":",
"coordinator",
"=",
"hass",
".",
"data",
"[",
"DOMAIN",
"]",
"[",
"DATA_COORDINATOR",
"]",
"[",
"e... | [
17,
0
] | [
44,
35
] | python | en | ['en', 'da', 'en'] | True |
NotionSensor.__init__ | (
self,
coordinator: DataUpdateCoordinator,
task_id: str,
sensor_id: str,
bridge_id: str,
system_id: str,
name: str,
device_class: str,
unit: str,
) | Initialize the entity. | Initialize the entity. | def __init__(
self,
coordinator: DataUpdateCoordinator,
task_id: str,
sensor_id: str,
bridge_id: str,
system_id: str,
name: str,
device_class: str,
unit: str,
):
"""Initialize the entity."""
super().__init__(
coordin... | [
"def",
"__init__",
"(",
"self",
",",
"coordinator",
":",
"DataUpdateCoordinator",
",",
"task_id",
":",
"str",
",",
"sensor_id",
":",
"str",
",",
"bridge_id",
":",
"str",
",",
"system_id",
":",
"str",
",",
"name",
":",
"str",
",",
"device_class",
":",
"st... | [
50,
4
] | [
66,
25
] | 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.