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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
IntentResponse.__init__ | (self, intent: Intent | None = None) | Initialize an IntentResponse. | Initialize an IntentResponse. | def __init__(self, intent: Intent | None = None) -> None:
"""Initialize an IntentResponse."""
self.intent = intent
self.speech: dict[str, dict[str, Any]] = {}
self.card: dict[str, dict[str, str]] = {} | [
"def",
"__init__",
"(",
"self",
",",
"intent",
":",
"Intent",
"|",
"None",
"=",
"None",
")",
"->",
"None",
":",
"self",
".",
"intent",
"=",
"intent",
"self",
".",
"speech",
":",
"dict",
"[",
"str",
",",
"dict",
"[",
"str",
",",
"Any",
"]",
"]",
... | [
248,
4
] | [
252,
49
] | python | en | ['en', 'en', 'it'] | True |
IntentResponse.async_set_speech | (
self, speech: str, speech_type: str = "plain", extra_data: Any | None = None
) | Set speech response. | Set speech response. | def async_set_speech(
self, speech: str, speech_type: str = "plain", extra_data: Any | None = None
) -> None:
"""Set speech response."""
self.speech[speech_type] = {"speech": speech, "extra_data": extra_data} | [
"def",
"async_set_speech",
"(",
"self",
",",
"speech",
":",
"str",
",",
"speech_type",
":",
"str",
"=",
"\"plain\"",
",",
"extra_data",
":",
"Any",
"|",
"None",
"=",
"None",
")",
"->",
"None",
":",
"self",
".",
"speech",
"[",
"speech_type",
"]",
"=",
... | [
255,
4
] | [
259,
79
] | python | cs | ['cs', 'lb', 'en'] | False |
IntentResponse.async_set_card | (
self, title: str, content: str, card_type: str = "simple"
) | Set speech response. | Set speech response. | def async_set_card(
self, title: str, content: str, card_type: str = "simple"
) -> None:
"""Set speech response."""
self.card[card_type] = {"title": title, "content": content} | [
"def",
"async_set_card",
"(",
"self",
",",
"title",
":",
"str",
",",
"content",
":",
"str",
",",
"card_type",
":",
"str",
"=",
"\"simple\"",
")",
"->",
"None",
":",
"self",
".",
"card",
"[",
"card_type",
"]",
"=",
"{",
"\"title\"",
":",
"title",
",",... | [
262,
4
] | [
266,
67
] | python | cs | ['cs', 'lb', 'en'] | False |
IntentResponse.as_dict | (self) | Return a dictionary representation of an intent response. | Return a dictionary representation of an intent response. | def as_dict(self) -> dict[str, dict[str, dict[str, Any]]]:
"""Return a dictionary representation of an intent response."""
return {"speech": self.speech, "card": self.card} | [
"def",
"as_dict",
"(",
"self",
")",
"->",
"dict",
"[",
"str",
",",
"dict",
"[",
"str",
",",
"dict",
"[",
"str",
",",
"Any",
"]",
"]",
"]",
":",
"return",
"{",
"\"speech\"",
":",
"self",
".",
"speech",
",",
"\"card\"",
":",
"self",
".",
"card",
... | [
269,
4
] | [
271,
57
] | python | en | ['en', 'en', 'en'] | True |
setup_platform | (hass, config, add_entities, discovery_info=None) | Set up the GeoJSON Events platform. | Set up the GeoJSON Events platform. | def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the GeoJSON Events platform."""
url = config[CONF_URL]
scan_interval = config.get(CONF_SCAN_INTERVAL, SCAN_INTERVAL)
coordinates = (
config.get(CONF_LATITUDE, hass.config.latitude),
config.get(CONF_LONGITUDE, ... | [
"def",
"setup_platform",
"(",
"hass",
",",
"config",
",",
"add_entities",
",",
"discovery_info",
"=",
"None",
")",
":",
"url",
"=",
"config",
"[",
"CONF_URL",
"]",
"scan_interval",
"=",
"config",
".",
"get",
"(",
"CONF_SCAN_INTERVAL",
",",
"SCAN_INTERVAL",
"... | [
44,
0
] | [
62,
71
] | python | en | ['en', 'lv', 'en'] | True |
GeoJsonFeedEntityManager.__init__ | (
self, hass, add_entities, scan_interval, coordinates, url, radius_in_km
) | Initialize the GeoJSON Feed Manager. | Initialize the GeoJSON Feed Manager. | def __init__(
self, hass, add_entities, scan_interval, coordinates, url, radius_in_km
):
"""Initialize the GeoJSON Feed Manager."""
self._hass = hass
self._feed_manager = GenericFeedManager(
self._generate_entity,
self._update_entity,
self._remove... | [
"def",
"__init__",
"(",
"self",
",",
"hass",
",",
"add_entities",
",",
"scan_interval",
",",
"coordinates",
",",
"url",
",",
"radius_in_km",
")",
":",
"self",
".",
"_hass",
"=",
"hass",
"self",
".",
"_feed_manager",
"=",
"GenericFeedManager",
"(",
"self",
... | [
68,
4
] | [
83,
43
] | python | en | ['en', 'en', 'en'] | True |
GeoJsonFeedEntityManager.startup | (self) | Start up this manager. | Start up this manager. | def startup(self):
"""Start up this manager."""
self._feed_manager.update()
self._init_regular_updates() | [
"def",
"startup",
"(",
"self",
")",
":",
"self",
".",
"_feed_manager",
".",
"update",
"(",
")",
"self",
".",
"_init_regular_updates",
"(",
")"
] | [
85,
4
] | [
88,
36
] | python | en | ['en', 'en', 'en'] | True |
GeoJsonFeedEntityManager._init_regular_updates | (self) | Schedule regular updates at the specified interval. | Schedule regular updates at the specified interval. | def _init_regular_updates(self):
"""Schedule regular updates at the specified interval."""
track_time_interval(
self._hass, lambda now: self._feed_manager.update(), self._scan_interval
) | [
"def",
"_init_regular_updates",
"(",
"self",
")",
":",
"track_time_interval",
"(",
"self",
".",
"_hass",
",",
"lambda",
"now",
":",
"self",
".",
"_feed_manager",
".",
"update",
"(",
")",
",",
"self",
".",
"_scan_interval",
")"
] | [
90,
4
] | [
94,
9
] | python | en | ['en', 'en', 'en'] | True |
GeoJsonFeedEntityManager.get_entry | (self, external_id) | Get feed entry by external id. | Get feed entry by external id. | def get_entry(self, external_id):
"""Get feed entry by external id."""
return self._feed_manager.feed_entries.get(external_id) | [
"def",
"get_entry",
"(",
"self",
",",
"external_id",
")",
":",
"return",
"self",
".",
"_feed_manager",
".",
"feed_entries",
".",
"get",
"(",
"external_id",
")"
] | [
96,
4
] | [
98,
63
] | python | en | ['en', 'en', 'en'] | True |
GeoJsonFeedEntityManager._generate_entity | (self, external_id) | Generate new entity. | Generate new entity. | def _generate_entity(self, external_id):
"""Generate new entity."""
new_entity = GeoJsonLocationEvent(self, external_id)
# Add new entities to HA.
self._add_entities([new_entity], True) | [
"def",
"_generate_entity",
"(",
"self",
",",
"external_id",
")",
":",
"new_entity",
"=",
"GeoJsonLocationEvent",
"(",
"self",
",",
"external_id",
")",
"# Add new entities to HA.",
"self",
".",
"_add_entities",
"(",
"[",
"new_entity",
"]",
",",
"True",
")"
] | [
100,
4
] | [
104,
46
] | python | en | ['en', 'en', 'en'] | True |
GeoJsonFeedEntityManager._update_entity | (self, external_id) | Update entity. | Update entity. | def _update_entity(self, external_id):
"""Update entity."""
dispatcher_send(self._hass, f"geo_json_events_update_{external_id}") | [
"def",
"_update_entity",
"(",
"self",
",",
"external_id",
")",
":",
"dispatcher_send",
"(",
"self",
".",
"_hass",
",",
"f\"geo_json_events_update_{external_id}\"",
")"
] | [
106,
4
] | [
108,
76
] | python | en | ['es', 'en', 'en'] | False |
GeoJsonFeedEntityManager._remove_entity | (self, external_id) | Remove entity. | Remove entity. | def _remove_entity(self, external_id):
"""Remove entity."""
dispatcher_send(self._hass, f"geo_json_events_delete_{external_id}") | [
"def",
"_remove_entity",
"(",
"self",
",",
"external_id",
")",
":",
"dispatcher_send",
"(",
"self",
".",
"_hass",
",",
"f\"geo_json_events_delete_{external_id}\"",
")"
] | [
110,
4
] | [
112,
76
] | python | en | ['es', 'it', 'en'] | False |
GeoJsonLocationEvent.__init__ | (self, feed_manager, external_id) | Initialize entity with data from feed entry. | Initialize entity with data from feed entry. | def __init__(self, feed_manager, external_id):
"""Initialize entity with data from feed entry."""
self._feed_manager = feed_manager
self._external_id = external_id
self._name = None
self._distance = None
self._latitude = None
self._longitude = None
self._r... | [
"def",
"__init__",
"(",
"self",
",",
"feed_manager",
",",
"external_id",
")",
":",
"self",
".",
"_feed_manager",
"=",
"feed_manager",
"self",
".",
"_external_id",
"=",
"external_id",
"self",
".",
"_name",
"=",
"None",
"self",
".",
"_distance",
"=",
"None",
... | [
118,
4
] | [
127,
41
] | python | en | ['en', 'en', 'en'] | True |
GeoJsonLocationEvent.async_added_to_hass | (self) | Call when entity is added to hass. | Call when entity is added to hass. | async def async_added_to_hass(self):
"""Call when entity is added to hass."""
self._remove_signal_delete = async_dispatcher_connect(
self.hass,
f"geo_json_events_delete_{self._external_id}",
self._delete_callback,
)
self._remove_signal_update = async_d... | [
"async",
"def",
"async_added_to_hass",
"(",
"self",
")",
":",
"self",
".",
"_remove_signal_delete",
"=",
"async_dispatcher_connect",
"(",
"self",
".",
"hass",
",",
"f\"geo_json_events_delete_{self._external_id}\"",
",",
"self",
".",
"_delete_callback",
",",
")",
"self... | [
129,
4
] | [
140,
9
] | python | en | ['en', 'en', 'en'] | True |
GeoJsonLocationEvent._delete_callback | (self) | Remove this entity. | Remove this entity. | def _delete_callback(self):
"""Remove this entity."""
self._remove_signal_delete()
self._remove_signal_update()
self.hass.async_create_task(self.async_remove(force_remove=True)) | [
"def",
"_delete_callback",
"(",
"self",
")",
":",
"self",
".",
"_remove_signal_delete",
"(",
")",
"self",
".",
"_remove_signal_update",
"(",
")",
"self",
".",
"hass",
".",
"async_create_task",
"(",
"self",
".",
"async_remove",
"(",
"force_remove",
"=",
"True",... | [
143,
4
] | [
147,
73
] | python | en | ['en', 'en', 'en'] | True |
GeoJsonLocationEvent._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",
")"
] | [
150,
4
] | [
152,
49
] | python | en | ['en', 'sn', 'en'] | True |
GeoJsonLocationEvent.should_poll | (self) | No polling needed for GeoJSON location events. | No polling needed for GeoJSON location events. | def should_poll(self):
"""No polling needed for GeoJSON location events."""
return False | [
"def",
"should_poll",
"(",
"self",
")",
":",
"return",
"False"
] | [
155,
4
] | [
157,
20
] | python | en | ['en', 'en', 'en'] | True |
GeoJsonLocationEvent.async_update | (self) | Update this entity from the data held in the feed manager. | Update this entity from the data held in the feed manager. | async def async_update(self):
"""Update this entity from the data held in the feed manager."""
_LOGGER.debug("Updating %s", self._external_id)
feed_entry = self._feed_manager.get_entry(self._external_id)
if feed_entry:
self._update_from_feed(feed_entry) | [
"async",
"def",
"async_update",
"(",
"self",
")",
":",
"_LOGGER",
".",
"debug",
"(",
"\"Updating %s\"",
",",
"self",
".",
"_external_id",
")",
"feed_entry",
"=",
"self",
".",
"_feed_manager",
".",
"get_entry",
"(",
"self",
".",
"_external_id",
")",
"if",
"... | [
159,
4
] | [
164,
46
] | python | en | ['en', 'en', 'en'] | True |
GeoJsonLocationEvent._update_from_feed | (self, feed_entry) | Update the internal state from the provided feed entry. | Update the internal state from the provided feed entry. | def _update_from_feed(self, feed_entry):
"""Update the internal state from the provided feed entry."""
self._name = feed_entry.title
self._distance = feed_entry.distance_to_home
self._latitude = feed_entry.coordinates[0]
self._longitude = feed_entry.coordinates[1] | [
"def",
"_update_from_feed",
"(",
"self",
",",
"feed_entry",
")",
":",
"self",
".",
"_name",
"=",
"feed_entry",
".",
"title",
"self",
".",
"_distance",
"=",
"feed_entry",
".",
"distance_to_home",
"self",
".",
"_latitude",
"=",
"feed_entry",
".",
"coordinates",
... | [
166,
4
] | [
171,
51
] | python | en | ['en', 'en', 'en'] | True |
GeoJsonLocationEvent.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"
] | [
174,
4
] | [
176,
21
] | python | en | ['en', 'en', 'en'] | True |
GeoJsonLocationEvent.name | (self) | Return the name of the entity. | Return the name of the entity. | def name(self) -> str | None:
"""Return the name of the entity."""
return self._name | [
"def",
"name",
"(",
"self",
")",
"->",
"str",
"|",
"None",
":",
"return",
"self",
".",
"_name"
] | [
179,
4
] | [
181,
25
] | python | en | ['en', 'en', 'en'] | True |
GeoJsonLocationEvent.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"
] | [
184,
4
] | [
186,
29
] | python | en | ['en', 'en', 'en'] | True |
GeoJsonLocationEvent.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"
] | [
189,
4
] | [
191,
29
] | python | en | ['en', 'la', 'en'] | True |
GeoJsonLocationEvent.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"
] | [
194,
4
] | [
196,
30
] | python | en | ['en', 'en', 'en'] | True |
GeoJsonLocationEvent.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 LENGTH_KILOMETERS | [
"def",
"unit_of_measurement",
"(",
"self",
")",
":",
"return",
"LENGTH_KILOMETERS"
] | [
199,
4
] | [
201,
32
] | python | en | ['en', 'la', 'en'] | True |
GeoJsonLocationEvent.extra_state_attributes | (self) | Return the device state attributes. | Return the device state attributes. | def extra_state_attributes(self):
"""Return the device state attributes."""
if not self._external_id:
return {}
return {ATTR_EXTERNAL_ID: self._external_id} | [
"def",
"extra_state_attributes",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_external_id",
":",
"return",
"{",
"}",
"return",
"{",
"ATTR_EXTERNAL_ID",
":",
"self",
".",
"_external_id",
"}"
] | [
204,
4
] | [
208,
52
] | python | en | ['en', 'en', 'en'] | True |
TestAdditionalPropertiesString.testAdditionalPropertiesString | (self) | Test AdditionalPropertiesString | Test AdditionalPropertiesString | def testAdditionalPropertiesString(self):
"""Test AdditionalPropertiesString"""
# can make model without additional properties
model = AdditionalPropertiesString()
# can make one with additional properties
model = AdditionalPropertiesString(some_key='some_val')
assert mo... | [
"def",
"testAdditionalPropertiesString",
"(",
"self",
")",
":",
"# can make model without additional properties",
"model",
"=",
"AdditionalPropertiesString",
"(",
")",
"# can make one with additional properties",
"model",
"=",
"AdditionalPropertiesString",
"(",
"some_key",
"=",
... | [
29,
4
] | [
40,
61
] | python | en | ['en', 'lb', 'en'] | False |
setup_platform | (hass, config, add_entities, discovery_info=None) | Set up the Sense HAT sensor platform. | Set up the Sense HAT sensor platform. | def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Sense HAT sensor platform."""
try:
envirophat = importlib.import_module("envirophat")
except OSError:
_LOGGER.error("No Enviro pHAT was found")
return False
data = EnvirophatData(envirophat, confi... | [
"def",
"setup_platform",
"(",
"hass",
",",
"config",
",",
"add_entities",
",",
"discovery_info",
"=",
"None",
")",
":",
"try",
":",
"envirophat",
"=",
"importlib",
".",
"import_module",
"(",
"\"envirophat\"",
")",
"except",
"OSError",
":",
"_LOGGER",
".",
"e... | [
135,
0
] | [
151,
32
] | python | en | ['en', 'da', 'en'] | True |
EnvirophatSensor.__init__ | (self, data, description: SensorEntityDescription) | Initialize the sensor. | Initialize the sensor. | def __init__(self, data, description: SensorEntityDescription):
"""Initialize the sensor."""
self.entity_description = description
self.data = data | [
"def",
"__init__",
"(",
"self",
",",
"data",
",",
"description",
":",
"SensorEntityDescription",
")",
":",
"self",
".",
"entity_description",
"=",
"description",
"self",
".",
"data",
"=",
"data"
] | [
157,
4
] | [
160,
24
] | python | en | ['en', 'en', 'en'] | True |
EnvirophatSensor.update | (self) | Get the latest data and updates the states. | Get the latest data and updates the states. | def update(self):
"""Get the latest data and updates the states."""
self.data.update()
sensor_type = self.entity_description.key
if sensor_type == "light":
self._attr_native_value = self.data.light
elif sensor_type == "light_red":
self._attr_native_value ... | [
"def",
"update",
"(",
"self",
")",
":",
"self",
".",
"data",
".",
"update",
"(",
")",
"sensor_type",
"=",
"self",
".",
"entity_description",
".",
"key",
"if",
"sensor_type",
"==",
"\"light\"",
":",
"self",
".",
"_attr_native_value",
"=",
"self",
".",
"da... | [
162,
4
] | [
198,
57
] | python | en | ['en', 'en', 'en'] | True |
EnvirophatData.__init__ | (self, envirophat, use_leds) | Initialize the data object. | Initialize the data object. | def __init__(self, envirophat, use_leds):
"""Initialize the data object."""
self.envirophat = envirophat
self.use_leds = use_leds
# sensors readings
self.light = None
self.light_red = None
self.light_green = None
self.light_blue = None
self.acceler... | [
"def",
"__init__",
"(",
"self",
",",
"envirophat",
",",
"use_leds",
")",
":",
"self",
".",
"envirophat",
"=",
"envirophat",
"self",
".",
"use_leds",
"=",
"use_leds",
"# sensors readings",
"self",
".",
"light",
"=",
"None",
"self",
".",
"light_red",
"=",
"N... | [
204,
4
] | [
224,
29
] | python | en | ['en', 'en', 'en'] | True |
EnvirophatData.update | (self) | Get the latest data from Enviro pHAT. | Get the latest data from Enviro pHAT. | def update(self):
"""Get the latest data from Enviro pHAT."""
# Light sensor reading: 16-bit integer
self.light = self.envirophat.light.light()
if self.use_leds:
self.envirophat.leds.on()
# the three color values scaled against the overall light, 0-255
self.li... | [
"def",
"update",
"(",
"self",
")",
":",
"# Light sensor reading: 16-bit integer",
"self",
".",
"light",
"=",
"self",
".",
"envirophat",
".",
"light",
".",
"light",
"(",
")",
"if",
"self",
".",
"use_leds",
":",
"self",
".",
"envirophat",
".",
"leds",
".",
... | [
227,
4
] | [
265,
45
] | python | en | ['en', 'en', 'en'] | True |
add_default_permissions | (perms) | Adds default permissions to the index. | Adds default permissions to the index. | def add_default_permissions(perms):
"""Adds default permissions to the index."""
global default_permissions
for target, permlist in perms.items():
default_permissions[target] |= set(permlist) | [
"def",
"add_default_permissions",
"(",
"perms",
")",
":",
"global",
"default_permissions",
"for",
"target",
",",
"permlist",
"in",
"perms",
".",
"items",
"(",
")",
":",
"default_permissions",
"[",
"target",
"]",
"|=",
"set",
"(",
"permlist",
")"
] | [
16,
0
] | [
20,
52
] | python | en | ['en', 'en', 'en'] | True |
remove_default_permissions | (perms) | Remove default permissions from the index. | Remove default permissions from the index. | def remove_default_permissions(perms):
"""Remove default permissions from the index."""
global default_permissions
for target, permlist in perms.items():
default_permissions[target] -= set(permlist) | [
"def",
"remove_default_permissions",
"(",
"perms",
")",
":",
"global",
"default_permissions",
"for",
"target",
",",
"permlist",
"in",
"perms",
".",
"items",
"(",
")",
":",
"default_permissions",
"[",
"target",
"]",
"-=",
"set",
"(",
"permlist",
")"
] | [
23,
0
] | [
27,
52
] | python | en | ['en', 'en', 'en'] | True |
check_permissions | (irc, uid, perms, also_show=[]) |
Checks permissions of the caller. If the caller has any of the permissions listed in perms,
this function returns True. Otherwise, NotAuthorizedError is raised.
|
Checks permissions of the caller. If the caller has any of the permissions listed in perms,
this function returns True. Otherwise, NotAuthorizedError is raised.
| def check_permissions(irc, uid, perms, also_show=[]):
"""
Checks permissions of the caller. If the caller has any of the permissions listed in perms,
this function returns True. Otherwise, NotAuthorizedError is raised.
"""
# For old (< 1.1 login blocks):
# If the user is logged in, they automati... | [
"def",
"check_permissions",
"(",
"irc",
",",
"uid",
",",
"perms",
",",
"also_show",
"=",
"[",
"]",
")",
":",
"# For old (< 1.1 login blocks):",
"# If the user is logged in, they automatically have all permissions.",
"olduser",
"=",
"conf",
".",
"conf",
"[",
"'login'",
... | [
30,
0
] | [
65,
64
] | python | en | ['en', 'error', 'th'] | False |
test_no_switches | (hass, aioclient_mock) | Test that no switch entities are created. | Test that no switch entities are created. | async def test_no_switches(hass, aioclient_mock):
"""Test that no switch entities are created."""
await setup_deconz_integration(hass, aioclient_mock)
assert len(hass.states.async_all()) == 0 | [
"async",
"def",
"test_no_switches",
"(",
"hass",
",",
"aioclient_mock",
")",
":",
"await",
"setup_deconz_integration",
"(",
"hass",
",",
"aioclient_mock",
")",
"assert",
"len",
"(",
"hass",
".",
"states",
".",
"async_all",
"(",
")",
")",
"==",
"0"
] | [
18,
0
] | [
21,
44
] | python | en | ['en', 'en', 'en'] | True |
test_power_plugs | (hass, aioclient_mock, mock_deconz_websocket) | Test that all supported switch entities are created. | Test that all supported switch entities are created. | async def test_power_plugs(hass, aioclient_mock, mock_deconz_websocket):
"""Test that all supported switch entities are created."""
data = {
"lights": {
"1": {
"name": "On off switch",
"type": "On/Off plug-in unit",
"state": {"on": True, "reach... | [
"async",
"def",
"test_power_plugs",
"(",
"hass",
",",
"aioclient_mock",
",",
"mock_deconz_websocket",
")",
":",
"data",
"=",
"{",
"\"lights\"",
":",
"{",
"\"1\"",
":",
"{",
"\"name\"",
":",
"\"On off switch\"",
",",
"\"type\"",
":",
"\"On/Off plug-in unit\"",
",... | [
24,
0
] | [
108,
44
] | python | en | ['en', 'en', 'en'] | True |
test_sirens | (hass, aioclient_mock, mock_deconz_websocket) | Test that siren entities are created. | Test that siren entities are created. | async def test_sirens(hass, aioclient_mock, mock_deconz_websocket):
"""Test that siren entities are created."""
data = {
"lights": {
"1": {
"name": "Warning device",
"type": "Warning device",
"state": {"alert": "lselect", "reachable": True},
... | [
"async",
"def",
"test_sirens",
"(",
"hass",
",",
"aioclient_mock",
",",
"mock_deconz_websocket",
")",
":",
"data",
"=",
"{",
"\"lights\"",
":",
"{",
"\"1\"",
":",
"{",
"\"name\"",
":",
"\"Warning device\"",
",",
"\"type\"",
":",
"\"Warning device\"",
",",
"\"s... | [
111,
0
] | [
181,
44
] | python | en | ['en', 'en', 'en'] | True |
test_form | (hass) | Test we get the form. | Test we get the form. | async def test_form(hass):
"""Test we get the form."""
await setup.async_setup_component(hass, "persistent_notification", {})
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
assert result["type"] == "form"
assert result["errors... | [
"async",
"def",
"test_form",
"(",
"hass",
")",
":",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"persistent_notification\"",
",",
"{",
"}",
")",
"result",
"=",
"await",
"hass",
".",
"config_entries",
".",
"flow",
".",
"async_init",
"(... | [
11,
0
] | [
46,
48
] | python | en | ['en', 'en', 'en'] | True |
test_form_invalid_credentials | (hass) | Test we handle invalid credentials error. | Test we handle invalid credentials error. | async def test_form_invalid_credentials(hass):
"""Test we handle invalid credentials error."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
mock_obj = MagicMock()
mock_obj.user.get = AsyncMock(side_effect=ClientResponseError(Ma... | [
"async",
"def",
"test_form_invalid_credentials",
"(",
"hass",
")",
":",
"result",
"=",
"await",
"hass",
".",
"config_entries",
".",
"flow",
".",
"async_init",
"(",
"DOMAIN",
",",
"context",
"=",
"{",
"\"source\"",
":",
"config_entries",
".",
"SOURCE_USER",
"}"... | [
49,
0
] | [
72,
63
] | python | en | ['nl', 'la', 'en'] | False |
test_form_unexpected_exception | (hass) | Test we handle unexpected exception error. | Test we handle unexpected exception error. | async def test_form_unexpected_exception(hass):
"""Test we handle unexpected exception error."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
mock_obj = MagicMock()
mock_obj.user.get = AsyncMock(side_effect=Exception)
with... | [
"async",
"def",
"test_form_unexpected_exception",
"(",
"hass",
")",
":",
"result",
"=",
"await",
"hass",
".",
"config_entries",
".",
"flow",
".",
"async_init",
"(",
"DOMAIN",
",",
"context",
"=",
"{",
"\"source\"",
":",
"config_entries",
".",
"SOURCE_USER",
"}... | [
75,
0
] | [
98,
51
] | python | en | ['de', 'en', 'en'] | True |
test_manual_flow_config_exist | (hass) | Test config flow discovers only already configured config. | Test config flow discovers only already configured config. | async def test_manual_flow_config_exist(hass):
"""Test config flow discovers only already configured config."""
MockConfigEntry(
domain=DOMAIN,
unique_id="test-api-user",
data={"api_user": "test-api-user", "api_key": "test-api-key"},
).add_to_hass(hass)
result = await hass.confi... | [
"async",
"def",
"test_manual_flow_config_exist",
"(",
"hass",
")",
":",
"MockConfigEntry",
"(",
"domain",
"=",
"DOMAIN",
",",
"unique_id",
"=",
"\"test-api-user\"",
",",
"data",
"=",
"{",
"\"api_user\"",
":",
"\"test-api-user\"",
",",
"\"api_key\"",
":",
"\"test-a... | [
101,
0
] | [
133,
51
] | python | en | ['en', 'en', 'en'] | True |
test_cover_get_state | (
hass, init_integration, entity_id: str, uid: str, name: str, model: str
) | Test states of the cover. | Test states of the cover. | async def test_cover_get_state(
hass, init_integration, entity_id: str, uid: str, name: str, model: str
):
"""Test states of the cover."""
init_integration
registry = er.async_get(hass)
registry_device = dr.async_get(hass)
device = registry_device.async_get_device({("freedompro", uid)})
ass... | [
"async",
"def",
"test_cover_get_state",
"(",
"hass",
",",
"init_integration",
",",
"entity_id",
":",
"str",
",",
"uid",
":",
"str",
",",
"name",
":",
"str",
",",
"model",
":",
"str",
")",
":",
"init_integration",
"registry",
"=",
"er",
".",
"async_get",
... | [
33,
0
] | [
76,
40
] | python | en | ['en', 'en', 'en'] | True |
test_cover_set_position | (
hass, init_integration, entity_id: str, uid: str, name: str, model: str
) | Test set position of the cover. | Test set position of the cover. | async def test_cover_set_position(
hass, init_integration, entity_id: str, uid: str, name: str, model: str
):
"""Test set position of the cover."""
init_integration
registry = er.async_get(hass)
state = hass.states.get(entity_id)
assert state
assert state.state == STATE_OPEN
assert stat... | [
"async",
"def",
"test_cover_set_position",
"(",
"hass",
",",
"init_integration",
",",
"entity_id",
":",
"str",
",",
"uid",
":",
"str",
",",
"name",
":",
"str",
",",
"model",
":",
"str",
")",
":",
"init_integration",
"registry",
"=",
"er",
".",
"async_get",... | [
90,
0
] | [
117,
36
] | python | en | ['en', 'en', 'en'] | True |
test_cover_close | (
hass, init_integration, entity_id: str, uid: str, name: str, model: str
) | Test close cover. | Test close cover. | async def test_cover_close(
hass, init_integration, entity_id: str, uid: str, name: str, model: str
):
"""Test close cover."""
init_integration
registry = er.async_get(hass)
state = hass.states.get(entity_id)
assert state
assert state.state == STATE_OPEN
assert state.attributes.get("fri... | [
"async",
"def",
"test_cover_close",
"(",
"hass",
",",
"init_integration",
",",
"entity_id",
":",
"str",
",",
"uid",
":",
"str",
",",
"name",
":",
"str",
",",
"model",
":",
"str",
")",
":",
"init_integration",
"registry",
"=",
"er",
".",
"async_get",
"(",... | [
131,
0
] | [
158,
36
] | python | en | ['en', 'en', 'en'] | True |
test_cover_open | (
hass, init_integration, entity_id: str, uid: str, name: str, model: str
) | Test open cover. | Test open cover. | async def test_cover_open(
hass, init_integration, entity_id: str, uid: str, name: str, model: str
):
"""Test open cover."""
init_integration
registry = er.async_get(hass)
state = hass.states.get(entity_id)
assert state
assert state.state == STATE_OPEN
assert state.attributes.get("frien... | [
"async",
"def",
"test_cover_open",
"(",
"hass",
",",
"init_integration",
",",
"entity_id",
":",
"str",
",",
"uid",
":",
"str",
",",
"name",
":",
"str",
",",
"model",
":",
"str",
")",
":",
"init_integration",
"registry",
"=",
"er",
".",
"async_get",
"(",
... | [
172,
0
] | [
199,
36
] | python | en | ['nl', 'en', 'en'] | True |
load_dataset | (filename, **kwargs) |
Load a dataset from lifetimes.datasets.
Parameters
----------
filename: str
for example "larynx.csv"
usecols: list
Passed to **kwargs, list of columns in file to use.
**kwargs
Passed to pandas.read_csv function.
Returns
-------
DataFrame
|
Load a dataset from lifetimes.datasets. | def load_dataset(filename, **kwargs):
"""
Load a dataset from lifetimes.datasets.
Parameters
----------
filename: str
for example "larynx.csv"
usecols: list
Passed to **kwargs, list of columns in file to use.
**kwargs
Passed to pandas.read_csv function.
Returns
... | [
"def",
"load_dataset",
"(",
"filename",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"pd",
".",
"read_csv",
"(",
"resource_filename",
"(",
"\"lifetimes\"",
",",
"\"datasets/\"",
"+",
"filename",
")",
",",
"*",
"*",
"kwargs",
")"
] | [
15,
0
] | [
33,
88
] | python | en | ['en', 'error', 'th'] | False |
load_donations | (**kwargs) | Load donations dataset as pandas DataFrame. | Load donations dataset as pandas DataFrame. | def load_donations(**kwargs):
"""Load donations dataset as pandas DataFrame."""
return load_dataset("donations.csv", **kwargs) | [
"def",
"load_donations",
"(",
"*",
"*",
"kwargs",
")",
":",
"return",
"load_dataset",
"(",
"\"donations.csv\"",
",",
"*",
"*",
"kwargs",
")"
] | [
36,
0
] | [
38,
50
] | python | en | ['pt', 'su', 'en'] | False |
load_cdnow_summary | (**kwargs) | Load cdnow customers summary pandas DataFrame. | Load cdnow customers summary pandas DataFrame. | def load_cdnow_summary(**kwargs):
"""Load cdnow customers summary pandas DataFrame."""
return load_dataset("cdnow_customers_summary.csv", **kwargs) | [
"def",
"load_cdnow_summary",
"(",
"*",
"*",
"kwargs",
")",
":",
"return",
"load_dataset",
"(",
"\"cdnow_customers_summary.csv\"",
",",
"*",
"*",
"kwargs",
")"
] | [
41,
0
] | [
43,
64
] | python | en | ['en', 'mg', 'en'] | True |
load_transaction_data | (**kwargs) |
Return a Pandas dataframe of transactional data.
Looks like:
date id
0 2014-03-08 00:00:00 0
1 2014-05-21 00:00:00 1
2 2014-03-14 00:00:00 2
3 2014-04-09 00:00:00 2
4 2014-05-21 00:00:00 2
The data was artificially created using Lifetimes data ge... |
Return a Pandas dataframe of transactional data. | def load_transaction_data(**kwargs):
"""
Return a Pandas dataframe of transactional data.
Looks like:
date id
0 2014-03-08 00:00:00 0
1 2014-05-21 00:00:00 1
2 2014-03-14 00:00:00 2
3 2014-04-09 00:00:00 2
4 2014-05-21 00:00:00 2
The data was ... | [
"def",
"load_transaction_data",
"(",
"*",
"*",
"kwargs",
")",
":",
"return",
"load_dataset",
"(",
"\"example_transactions.csv\"",
",",
"*",
"*",
"kwargs",
")"
] | [
46,
0
] | [
63,
61
] | python | en | ['en', 'error', 'th'] | False |
load_cdnow_summary_data_with_monetary_value | (**kwargs) | Load cdnow customers summary with monetary value as pandas DataFrame. | Load cdnow customers summary with monetary value as pandas DataFrame. | def load_cdnow_summary_data_with_monetary_value(**kwargs):
"""Load cdnow customers summary with monetary value as pandas DataFrame."""
df = load_dataset("cdnow_customers_summary_with_transactions.csv", **kwargs)
df.columns = ["customer_id", "frequency", "recency", "T", "monetary_value"]
df = df.set_inde... | [
"def",
"load_cdnow_summary_data_with_monetary_value",
"(",
"*",
"*",
"kwargs",
")",
":",
"df",
"=",
"load_dataset",
"(",
"\"cdnow_customers_summary_with_transactions.csv\"",
",",
"*",
"*",
"kwargs",
")",
"df",
".",
"columns",
"=",
"[",
"\"customer_id\"",
",",
"\"fre... | [
66,
0
] | [
71,
13
] | python | en | ['en', 'mg', 'en'] | True |
test_speedtestdotnet_sensors | (
hass: HomeAssistant, mock_api: MagicMock
) | Test sensors created for speedtestdotnet integration. | Test sensors created for speedtestdotnet integration. | async def test_speedtestdotnet_sensors(
hass: HomeAssistant, mock_api: MagicMock
) -> None:
"""Test sensors created for speedtestdotnet integration."""
entry = MockConfigEntry(domain=speedtestdotnet.DOMAIN, data={})
entry.add_to_hass(hass)
mock_api.return_value.get_best_server.return_value = MOCK_S... | [
"async",
"def",
"test_speedtestdotnet_sensors",
"(",
"hass",
":",
"HomeAssistant",
",",
"mock_api",
":",
"MagicMock",
")",
"->",
"None",
":",
"entry",
"=",
"MockConfigEntry",
"(",
"domain",
"=",
"speedtestdotnet",
".",
"DOMAIN",
",",
"data",
"=",
"{",
"}",
"... | [
13,
0
] | [
31,
59
] | python | en | ['en', 'no', 'en'] | True |
test_setup_missing_conf | (hass) | Test set up humidity_control with missing config values. | Test set up humidity_control with missing config values. | async def test_setup_missing_conf(hass):
"""Test set up humidity_control with missing config values."""
config = {
"platform": "generic_hygrostat",
"name": "test",
"target_sensor": ENT_SENSOR,
}
with assert_setup_component(0):
await async_setup_component(hass, "humidifier... | [
"async",
"def",
"test_setup_missing_conf",
"(",
"hass",
")",
":",
"config",
"=",
"{",
"\"platform\"",
":",
"\"generic_hygrostat\"",
",",
"\"name\"",
":",
"\"test\"",
",",
"\"target_sensor\"",
":",
"ENT_SENSOR",
",",
"}",
"with",
"assert_setup_component",
"(",
"0",... | [
45,
0
] | [
54,
42
] | python | en | ['en', 'en', 'en'] | True |
test_valid_conf | (hass) | Test set up generic_hygrostat with valid config values. | Test set up generic_hygrostat with valid config values. | async def test_valid_conf(hass):
"""Test set up generic_hygrostat with valid config values."""
assert await async_setup_component(
hass,
"humidifier",
{
"humidifier": {
"platform": "generic_hygrostat",
"name": "test",
"humidifie... | [
"async",
"def",
"test_valid_conf",
"(",
"hass",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"\"humidifier\"",
",",
"{",
"\"humidifier\"",
":",
"{",
"\"platform\"",
":",
"\"generic_hygrostat\"",
",",
"\"name\"",
":",
"\"test\"",
",",
"... | [
57,
0
] | [
71,
38
] | python | en | ['en', 'en', 'en'] | True |
setup_comp_1 | (hass) | Initialize components. | Initialize components. | async def setup_comp_1(hass):
"""Initialize components."""
assert await async_setup_component(hass, "homeassistant", {})
await hass.async_block_till_done() | [
"async",
"def",
"setup_comp_1",
"(",
"hass",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"\"homeassistant\"",
",",
"{",
"}",
")",
"await",
"hass",
".",
"async_block_till_done",
"(",
")"
] | [
75,
0
] | [
78,
38
] | python | en | ['de', 'en', 'en'] | False |
test_humidifier_input_boolean | (hass, setup_comp_1) | Test humidifier switching input_boolean. | Test humidifier switching input_boolean. | async def test_humidifier_input_boolean(hass, setup_comp_1):
"""Test humidifier switching input_boolean."""
humidifier_switch = "input_boolean.test"
assert await async_setup_component(
hass, input_boolean.DOMAIN, {"input_boolean": {"test": None}}
)
await hass.async_block_till_done()
ass... | [
"async",
"def",
"test_humidifier_input_boolean",
"(",
"hass",
",",
"setup_comp_1",
")",
":",
"humidifier_switch",
"=",
"\"input_boolean.test\"",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"input_boolean",
".",
"DOMAIN",
",",
"{",
"\"input_boolean\"",
... | [
81,
0
] | [
116,
63
] | python | en | ['en', 'en', 'en'] | True |
test_humidifier_switch | (hass, setup_comp_1, enable_custom_integrations) | Test humidifier switching test switch. | Test humidifier switching test switch. | async def test_humidifier_switch(hass, setup_comp_1, enable_custom_integrations):
"""Test humidifier switching test switch."""
platform = getattr(hass.components, "test.switch")
platform.init()
switch_1 = platform.ENTITIES[1]
assert await async_setup_component(
hass, switch.DOMAIN, {"switch"... | [
"async",
"def",
"test_humidifier_switch",
"(",
"hass",
",",
"setup_comp_1",
",",
"enable_custom_integrations",
")",
":",
"platform",
"=",
"getattr",
"(",
"hass",
".",
"components",
",",
"\"test.switch\"",
")",
"platform",
".",
"init",
"(",
")",
"switch_1",
"=",
... | [
119,
0
] | [
158,
63
] | python | en | ['en', 'en', 'en'] | True |
_setup_sensor | (hass, humidity) | Set up the test sensor. | Set up the test sensor. | def _setup_sensor(hass, humidity):
"""Set up the test sensor."""
hass.states.async_set(ENT_SENSOR, humidity) | [
"def",
"_setup_sensor",
"(",
"hass",
",",
"humidity",
")",
":",
"hass",
".",
"states",
".",
"async_set",
"(",
"ENT_SENSOR",
",",
"humidity",
")"
] | [
161,
0
] | [
163,
47
] | python | en | ['en', 'da', 'en'] | True |
setup_comp_0 | (hass) | Initialize components. | Initialize components. | async def setup_comp_0(hass):
"""Initialize components."""
_setup_sensor(hass, 45)
hass.states.async_set(ENT_SWITCH, STATE_OFF)
await hass.async_block_till_done()
assert await async_setup_component(
hass,
DOMAIN,
{
"humidifier": {
"platform": "gene... | [
"async",
"def",
"setup_comp_0",
"(",
"hass",
")",
":",
"_setup_sensor",
"(",
"hass",
",",
"45",
")",
"hass",
".",
"states",
".",
"async_set",
"(",
"ENT_SWITCH",
",",
"STATE_OFF",
")",
"await",
"hass",
".",
"async_block_till_done",
"(",
")",
"assert",
"awai... | [
167,
0
] | [
189,
38
] | python | en | ['de', 'en', 'en'] | False |
setup_comp_2 | (hass) | Initialize components. | Initialize components. | async def setup_comp_2(hass):
"""Initialize components."""
_setup_sensor(hass, 45)
hass.states.async_set(ENT_SWITCH, STATE_OFF)
await hass.async_block_till_done()
assert await async_setup_component(
hass,
DOMAIN,
{
"humidifier": {
"platform": "gene... | [
"async",
"def",
"setup_comp_2",
"(",
"hass",
")",
":",
"_setup_sensor",
"(",
"hass",
",",
"45",
")",
"hass",
".",
"states",
".",
"async_set",
"(",
"ENT_SWITCH",
",",
"STATE_OFF",
")",
"await",
"hass",
".",
"async_block_till_done",
"(",
")",
"assert",
"awai... | [
193,
0
] | [
214,
38
] | python | en | ['de', 'en', 'en'] | False |
test_unavailable_state | (hass) | Test the setting of defaults to unknown. | Test the setting of defaults to unknown. | async def test_unavailable_state(hass):
"""Test the setting of defaults to unknown."""
await async_setup_component(
hass,
DOMAIN,
{
"humidifier": {
"platform": "generic_hygrostat",
"name": "test",
"dry_tolerance": 2,
... | [
"async",
"def",
"test_unavailable_state",
"(",
"hass",
")",
":",
"await",
"async_setup_component",
"(",
"hass",
",",
"DOMAIN",
",",
"{",
"\"humidifier\"",
":",
"{",
"\"platform\"",
":",
"\"generic_hygrostat\"",
",",
"\"name\"",
":",
"\"test\"",
",",
"\"dry_toleran... | [
217,
0
] | [
241,
53
] | python | en | ['en', 'en', 'en'] | True |
test_setup_defaults_to_unknown | (hass) | Test the setting of defaults to unknown. | Test the setting of defaults to unknown. | async def test_setup_defaults_to_unknown(hass):
"""Test the setting of defaults to unknown."""
await async_setup_component(
hass,
DOMAIN,
{
"humidifier": {
"platform": "generic_hygrostat",
"name": "test",
"dry_tolerance": 2,
... | [
"async",
"def",
"test_setup_defaults_to_unknown",
"(",
"hass",
")",
":",
"await",
"async_setup_component",
"(",
"hass",
",",
"DOMAIN",
",",
"{",
"\"humidifier\"",
":",
"{",
"\"platform\"",
":",
"\"generic_hygrostat\"",
",",
"\"name\"",
":",
"\"test\"",
",",
"\"dry... | [
244,
0
] | [
262,
61
] | python | en | ['en', 'en', 'en'] | True |
test_default_setup_params | (hass, setup_comp_2) | Test the setup with default parameters. | Test the setup with default parameters. | async def test_default_setup_params(hass, setup_comp_2):
"""Test the setup with default parameters."""
state = hass.states.get(ENTITY)
assert state.attributes.get("min_humidity") == 0
assert state.attributes.get("max_humidity") == 100
assert state.attributes.get("humidity") == 0 | [
"async",
"def",
"test_default_setup_params",
"(",
"hass",
",",
"setup_comp_2",
")",
":",
"state",
"=",
"hass",
".",
"states",
".",
"get",
"(",
"ENTITY",
")",
"assert",
"state",
".",
"attributes",
".",
"get",
"(",
"\"min_humidity\"",
")",
"==",
"0",
"assert... | [
265,
0
] | [
270,
48
] | python | en | ['en', 'en', 'en'] | True |
test_default_setup_params_dehumidifier | (hass, setup_comp_0) | Test the setup with default parameters for dehumidifier. | Test the setup with default parameters for dehumidifier. | async def test_default_setup_params_dehumidifier(hass, setup_comp_0):
"""Test the setup with default parameters for dehumidifier."""
state = hass.states.get(ENTITY)
assert state.attributes.get("min_humidity") == 0
assert state.attributes.get("max_humidity") == 100
assert state.attributes.get("humidi... | [
"async",
"def",
"test_default_setup_params_dehumidifier",
"(",
"hass",
",",
"setup_comp_0",
")",
":",
"state",
"=",
"hass",
".",
"states",
".",
"get",
"(",
"ENTITY",
")",
"assert",
"state",
".",
"attributes",
".",
"get",
"(",
"\"min_humidity\"",
")",
"==",
"... | [
273,
0
] | [
278,
50
] | python | en | ['en', 'en', 'en'] | True |
test_get_modes | (hass, setup_comp_2) | Test that the attributes returns the correct modes. | Test that the attributes returns the correct modes. | async def test_get_modes(hass, setup_comp_2):
"""Test that the attributes returns the correct modes."""
state = hass.states.get(ENTITY)
modes = state.attributes.get("available_modes")
assert modes == [MODE_NORMAL, MODE_AWAY] | [
"async",
"def",
"test_get_modes",
"(",
"hass",
",",
"setup_comp_2",
")",
":",
"state",
"=",
"hass",
".",
"states",
".",
"get",
"(",
"ENTITY",
")",
"modes",
"=",
"state",
".",
"attributes",
".",
"get",
"(",
"\"available_modes\"",
")",
"assert",
"modes",
"... | [
281,
0
] | [
285,
44
] | python | en | ['en', 'en', 'en'] | True |
test_set_target_humidity | (hass, setup_comp_2) | Test the setting of the target humidity. | Test the setting of the target humidity. | async def test_set_target_humidity(hass, setup_comp_2):
"""Test the setting of the target humidity."""
await hass.services.async_call(
DOMAIN,
SERVICE_SET_HUMIDITY,
{ATTR_ENTITY_ID: ENTITY, ATTR_HUMIDITY: 40},
blocking=True,
)
await hass.async_block_till_done()
state ... | [
"async",
"def",
"test_set_target_humidity",
"(",
"hass",
",",
"setup_comp_2",
")",
":",
"await",
"hass",
".",
"services",
".",
"async_call",
"(",
"DOMAIN",
",",
"SERVICE_SET_HUMIDITY",
",",
"{",
"ATTR_ENTITY_ID",
":",
"ENTITY",
",",
"ATTR_HUMIDITY",
":",
"40",
... | [
288,
0
] | [
308,
49
] | python | en | ['en', 'en', 'en'] | True |
test_set_away_mode | (hass, setup_comp_2) | Test the setting away mode. | Test the setting away mode. | async def test_set_away_mode(hass, setup_comp_2):
"""Test the setting away mode."""
await hass.services.async_call(
DOMAIN,
SERVICE_SET_HUMIDITY,
{ATTR_ENTITY_ID: ENTITY, ATTR_HUMIDITY: 44},
blocking=True,
)
await hass.async_block_till_done()
await hass.services.async... | [
"async",
"def",
"test_set_away_mode",
"(",
"hass",
",",
"setup_comp_2",
")",
":",
"await",
"hass",
".",
"services",
".",
"async_call",
"(",
"DOMAIN",
",",
"SERVICE_SET_HUMIDITY",
",",
"{",
"ATTR_ENTITY_ID",
":",
"ENTITY",
",",
"ATTR_HUMIDITY",
":",
"44",
"}",
... | [
311,
0
] | [
328,
49
] | python | en | ['en', 'en', 'en'] | True |
test_set_away_mode_and_restore_prev_humidity | (hass, setup_comp_2) | Test the setting and removing away mode.
Verify original humidity is restored.
| Test the setting and removing away mode. | async def test_set_away_mode_and_restore_prev_humidity(hass, setup_comp_2):
"""Test the setting and removing away mode.
Verify original humidity is restored.
"""
await hass.services.async_call(
DOMAIN,
SERVICE_SET_HUMIDITY,
{ATTR_ENTITY_ID: ENTITY, ATTR_HUMIDITY: 44},
bl... | [
"async",
"def",
"test_set_away_mode_and_restore_prev_humidity",
"(",
"hass",
",",
"setup_comp_2",
")",
":",
"await",
"hass",
".",
"services",
".",
"async_call",
"(",
"DOMAIN",
",",
"SERVICE_SET_HUMIDITY",
",",
"{",
"ATTR_ENTITY_ID",
":",
"ENTITY",
",",
"ATTR_HUMIDIT... | [
331,
0
] | [
360,
49
] | python | en | ['en', 'en', 'en'] | True |
test_set_away_mode_twice_and_restore_prev_humidity | (hass, setup_comp_2) | Test the setting away mode twice in a row.
Verify original humidity is restored.
| Test the setting away mode twice in a row. | async def test_set_away_mode_twice_and_restore_prev_humidity(hass, setup_comp_2):
"""Test the setting away mode twice in a row.
Verify original humidity is restored.
"""
await hass.services.async_call(
DOMAIN,
SERVICE_SET_HUMIDITY,
{ATTR_ENTITY_ID: ENTITY, ATTR_HUMIDITY: 44},
... | [
"async",
"def",
"test_set_away_mode_twice_and_restore_prev_humidity",
"(",
"hass",
",",
"setup_comp_2",
")",
":",
"await",
"hass",
".",
"services",
".",
"async_call",
"(",
"DOMAIN",
",",
"SERVICE_SET_HUMIDITY",
",",
"{",
"ATTR_ENTITY_ID",
":",
"ENTITY",
",",
"ATTR_H... | [
363,
0
] | [
399,
49
] | python | en | ['en', 'en', 'en'] | True |
test_sensor_bad_value | (hass, setup_comp_2) | Test sensor that have None as state. | Test sensor that have None as state. | async def test_sensor_bad_value(hass, setup_comp_2):
"""Test sensor that have None as state."""
state = hass.states.get(ENTITY)
humidity = state.attributes.get("current_humidity")
_setup_sensor(hass, None)
await hass.async_block_till_done()
state = hass.states.get(ENTITY)
assert humidity =... | [
"async",
"def",
"test_sensor_bad_value",
"(",
"hass",
",",
"setup_comp_2",
")",
":",
"state",
"=",
"hass",
".",
"states",
".",
"get",
"(",
"ENTITY",
")",
"humidity",
"=",
"state",
".",
"attributes",
".",
"get",
"(",
"\"current_humidity\"",
")",
"_setup_senso... | [
402,
0
] | [
411,
63
] | python | en | ['en', 'en', 'en'] | True |
test_set_target_humidity_humidifier_on | (hass, setup_comp_2) | Test if target humidity turn humidifier on. | Test if target humidity turn humidifier on. | async def test_set_target_humidity_humidifier_on(hass, setup_comp_2):
"""Test if target humidity turn humidifier on."""
calls = await _setup_switch(hass, False)
_setup_sensor(hass, 36)
await hass.async_block_till_done()
await hass.services.async_call(
DOMAIN,
SERVICE_SET_HUMIDITY,
... | [
"async",
"def",
"test_set_target_humidity_humidifier_on",
"(",
"hass",
",",
"setup_comp_2",
")",
":",
"calls",
"=",
"await",
"_setup_switch",
"(",
"hass",
",",
"False",
")",
"_setup_sensor",
"(",
"hass",
",",
"36",
")",
"await",
"hass",
".",
"async_block_till_do... | [
414,
0
] | [
430,
47
] | python | en | ['en', 'en', 'en'] | True |
test_set_target_humidity_humidifier_off | (hass, setup_comp_2) | Test if target humidity turn humidifier off. | Test if target humidity turn humidifier off. | async def test_set_target_humidity_humidifier_off(hass, setup_comp_2):
"""Test if target humidity turn humidifier off."""
calls = await _setup_switch(hass, True)
_setup_sensor(hass, 45)
await hass.async_block_till_done()
await hass.services.async_call(
DOMAIN,
SERVICE_SET_HUMIDITY,
... | [
"async",
"def",
"test_set_target_humidity_humidifier_off",
"(",
"hass",
",",
"setup_comp_2",
")",
":",
"calls",
"=",
"await",
"_setup_switch",
"(",
"hass",
",",
"True",
")",
"_setup_sensor",
"(",
"hass",
",",
"45",
")",
"await",
"hass",
".",
"async_block_till_do... | [
433,
0
] | [
449,
47
] | python | en | ['en', 'en', 'en'] | True |
test_humidity_change_humidifier_on_within_tolerance | (hass, setup_comp_2) | Test if humidity change doesn't turn on within tolerance. | Test if humidity change doesn't turn on within tolerance. | async def test_humidity_change_humidifier_on_within_tolerance(hass, setup_comp_2):
"""Test if humidity change doesn't turn on within tolerance."""
calls = await _setup_switch(hass, False)
await hass.services.async_call(
DOMAIN,
SERVICE_SET_HUMIDITY,
{ATTR_ENTITY_ID: ENTITY, ATTR_HUMI... | [
"async",
"def",
"test_humidity_change_humidifier_on_within_tolerance",
"(",
"hass",
",",
"setup_comp_2",
")",
":",
"calls",
"=",
"await",
"_setup_switch",
"(",
"hass",
",",
"False",
")",
"await",
"hass",
".",
"services",
".",
"async_call",
"(",
"DOMAIN",
",",
"S... | [
452,
0
] | [
464,
26
] | python | en | ['en', 'en', 'en'] | True |
test_humidity_change_humidifier_on_outside_tolerance | (hass, setup_comp_2) | Test if humidity change turn humidifier on outside dry tolerance. | Test if humidity change turn humidifier on outside dry tolerance. | async def test_humidity_change_humidifier_on_outside_tolerance(hass, setup_comp_2):
"""Test if humidity change turn humidifier on outside dry tolerance."""
calls = await _setup_switch(hass, False)
await hass.services.async_call(
DOMAIN,
SERVICE_SET_HUMIDITY,
{ATTR_ENTITY_ID: ENTITY, ... | [
"async",
"def",
"test_humidity_change_humidifier_on_outside_tolerance",
"(",
"hass",
",",
"setup_comp_2",
")",
":",
"calls",
"=",
"await",
"_setup_switch",
"(",
"hass",
",",
"False",
")",
"await",
"hass",
".",
"services",
".",
"async_call",
"(",
"DOMAIN",
",",
"... | [
467,
0
] | [
483,
47
] | python | en | ['en', 'en', 'en'] | True |
test_humidity_change_humidifier_off_within_tolerance | (hass, setup_comp_2) | Test if humidity change doesn't turn off within tolerance. | Test if humidity change doesn't turn off within tolerance. | async def test_humidity_change_humidifier_off_within_tolerance(hass, setup_comp_2):
"""Test if humidity change doesn't turn off within tolerance."""
calls = await _setup_switch(hass, True)
await hass.services.async_call(
DOMAIN,
SERVICE_SET_HUMIDITY,
{ATTR_ENTITY_ID: ENTITY, ATTR_HUM... | [
"async",
"def",
"test_humidity_change_humidifier_off_within_tolerance",
"(",
"hass",
",",
"setup_comp_2",
")",
":",
"calls",
"=",
"await",
"_setup_switch",
"(",
"hass",
",",
"True",
")",
"await",
"hass",
".",
"services",
".",
"async_call",
"(",
"DOMAIN",
",",
"S... | [
486,
0
] | [
498,
26
] | python | en | ['en', 'en', 'en'] | True |
test_humidity_change_humidifier_off_outside_tolerance | (hass, setup_comp_2) | Test if humidity change turn humidifier off outside wet tolerance. | Test if humidity change turn humidifier off outside wet tolerance. | async def test_humidity_change_humidifier_off_outside_tolerance(hass, setup_comp_2):
"""Test if humidity change turn humidifier off outside wet tolerance."""
calls = await _setup_switch(hass, True)
await hass.services.async_call(
DOMAIN,
SERVICE_SET_HUMIDITY,
{ATTR_ENTITY_ID: ENTITY,... | [
"async",
"def",
"test_humidity_change_humidifier_off_outside_tolerance",
"(",
"hass",
",",
"setup_comp_2",
")",
":",
"calls",
"=",
"await",
"_setup_switch",
"(",
"hass",
",",
"True",
")",
"await",
"hass",
".",
"services",
".",
"async_call",
"(",
"DOMAIN",
",",
"... | [
501,
0
] | [
517,
47
] | python | en | ['en', 'en', 'en'] | True |
test_operation_mode_humidify | (hass, setup_comp_2) | Test change mode from OFF to HUMIDIFY.
Switch turns on when humidity below setpoint and mode changes.
| Test change mode from OFF to HUMIDIFY. | async def test_operation_mode_humidify(hass, setup_comp_2):
"""Test change mode from OFF to HUMIDIFY.
Switch turns on when humidity below setpoint and mode changes.
"""
await hass.services.async_call(
DOMAIN,
SERVICE_TURN_OFF,
{ATTR_ENTITY_ID: ENTITY},
blocking=True,
... | [
"async",
"def",
"test_operation_mode_humidify",
"(",
"hass",
",",
"setup_comp_2",
")",
":",
"await",
"hass",
".",
"services",
".",
"async_call",
"(",
"DOMAIN",
",",
"SERVICE_TURN_OFF",
",",
"{",
"ATTR_ENTITY_ID",
":",
"ENTITY",
"}",
",",
"blocking",
"=",
"True... | [
520,
0
] | [
553,
47
] | python | en | ['en', 'en', 'en'] | True |
_setup_switch | (hass, is_on) | Set up the test switch. | Set up the test switch. | async def _setup_switch(hass, is_on):
"""Set up the test switch."""
hass.states.async_set(ENT_SWITCH, STATE_ON if is_on else STATE_OFF)
calls = []
@callback
def log_call(call):
"""Log service calls."""
calls.append(call)
hass.services.async_register(ha.DOMAIN, SERVICE_TURN_ON, ... | [
"async",
"def",
"_setup_switch",
"(",
"hass",
",",
"is_on",
")",
":",
"hass",
".",
"states",
".",
"async_set",
"(",
"ENT_SWITCH",
",",
"STATE_ON",
"if",
"is_on",
"else",
"STATE_OFF",
")",
"calls",
"=",
"[",
"]",
"@",
"callback",
"def",
"log_call",
"(",
... | [
556,
0
] | [
570,
16
] | python | en | ['en', 'en', 'en'] | True |
setup_comp_3 | (hass) | Initialize components. | Initialize components. | async def setup_comp_3(hass):
"""Initialize components."""
assert await async_setup_component(
hass,
DOMAIN,
{
"humidifier": {
"platform": "generic_hygrostat",
"name": "test",
"dry_tolerance": 2,
"wet_tolerance":... | [
"async",
"def",
"setup_comp_3",
"(",
"hass",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"DOMAIN",
",",
"{",
"\"humidifier\"",
":",
"{",
"\"platform\"",
":",
"\"generic_hygrostat\"",
",",
"\"name\"",
":",
"\"test\"",
",",
"\"dry_toler... | [
574,
0
] | [
594,
38
] | python | en | ['de', 'en', 'en'] | False |
test_set_target_humidity_dry_off | (hass, setup_comp_3) | Test if target humidity turn dry off. | Test if target humidity turn dry off. | async def test_set_target_humidity_dry_off(hass, setup_comp_3):
"""Test if target humidity turn dry off."""
calls = await _setup_switch(hass, True)
_setup_sensor(hass, 50)
await hass.async_block_till_done()
await hass.services.async_call(
DOMAIN,
SERVICE_SET_HUMIDITY,
{ATTR_E... | [
"async",
"def",
"test_set_target_humidity_dry_off",
"(",
"hass",
",",
"setup_comp_3",
")",
":",
"calls",
"=",
"await",
"_setup_switch",
"(",
"hass",
",",
"True",
")",
"_setup_sensor",
"(",
"hass",
",",
"50",
")",
"await",
"hass",
".",
"async_block_till_done",
... | [
597,
0
] | [
613,
47
] | python | en | ['en', 'en', 'en'] | True |
test_turn_away_mode_on_drying | (hass, setup_comp_3) | Test the setting away mode when drying. | Test the setting away mode when drying. | async def test_turn_away_mode_on_drying(hass, setup_comp_3):
"""Test the setting away mode when drying."""
await _setup_switch(hass, True)
_setup_sensor(hass, 50)
await hass.async_block_till_done()
await hass.services.async_call(
DOMAIN,
SERVICE_SET_HUMIDITY,
{ATTR_ENTITY_ID:... | [
"async",
"def",
"test_turn_away_mode_on_drying",
"(",
"hass",
",",
"setup_comp_3",
")",
":",
"await",
"_setup_switch",
"(",
"hass",
",",
"True",
")",
"_setup_sensor",
"(",
"hass",
",",
"50",
")",
"await",
"hass",
".",
"async_block_till_done",
"(",
")",
"await"... | [
616,
0
] | [
636,
49
] | python | en | ['en', 'en', 'en'] | True |
test_operation_mode_dry | (hass, setup_comp_3) | Test change mode from OFF to DRY.
Switch turns on when humidity below setpoint and state changes.
| Test change mode from OFF to DRY. | async def test_operation_mode_dry(hass, setup_comp_3):
"""Test change mode from OFF to DRY.
Switch turns on when humidity below setpoint and state changes.
"""
calls = await _setup_switch(hass, False)
_setup_sensor(hass, 30)
await hass.async_block_till_done()
assert len(calls) == 0
awai... | [
"async",
"def",
"test_operation_mode_dry",
"(",
"hass",
",",
"setup_comp_3",
")",
":",
"calls",
"=",
"await",
"_setup_switch",
"(",
"hass",
",",
"False",
")",
"_setup_sensor",
"(",
"hass",
",",
"30",
")",
"await",
"hass",
".",
"async_block_till_done",
"(",
"... | [
639,
0
] | [
669,
47
] | python | en | ['en', 'en', 'en'] | True |
test_set_target_humidity_dry_on | (hass, setup_comp_3) | Test if target humidity turn dry on. | Test if target humidity turn dry on. | async def test_set_target_humidity_dry_on(hass, setup_comp_3):
"""Test if target humidity turn dry on."""
calls = await _setup_switch(hass, False)
_setup_sensor(hass, 45)
await hass.async_block_till_done()
assert len(calls) == 1
call = calls[0]
assert call.domain == HASS_DOMAIN
assert ca... | [
"async",
"def",
"test_set_target_humidity_dry_on",
"(",
"hass",
",",
"setup_comp_3",
")",
":",
"calls",
"=",
"await",
"_setup_switch",
"(",
"hass",
",",
"False",
")",
"_setup_sensor",
"(",
"hass",
",",
"45",
")",
"await",
"hass",
".",
"async_block_till_done",
... | [
672,
0
] | [
681,
47
] | python | en | ['en', 'en', 'en'] | True |
test_init_ignores_tolerance | (hass, setup_comp_3) | Test if tolerance is ignored on initialization. | Test if tolerance is ignored on initialization. | async def test_init_ignores_tolerance(hass, setup_comp_3):
"""Test if tolerance is ignored on initialization."""
calls = await _setup_switch(hass, True)
_setup_sensor(hass, 39)
await hass.async_block_till_done()
assert 1 == len(calls)
call = calls[0]
assert HASS_DOMAIN == call.domain
ass... | [
"async",
"def",
"test_init_ignores_tolerance",
"(",
"hass",
",",
"setup_comp_3",
")",
":",
"calls",
"=",
"await",
"_setup_switch",
"(",
"hass",
",",
"True",
")",
"_setup_sensor",
"(",
"hass",
",",
"39",
")",
"await",
"hass",
".",
"async_block_till_done",
"(",
... | [
684,
0
] | [
693,
47
] | python | en | ['en', 'en', 'en'] | True |
test_humidity_change_dry_off_within_tolerance | (hass, setup_comp_3) | Test if humidity change doesn't turn dry off within tolerance. | Test if humidity change doesn't turn dry off within tolerance. | async def test_humidity_change_dry_off_within_tolerance(hass, setup_comp_3):
"""Test if humidity change doesn't turn dry off within tolerance."""
calls = await _setup_switch(hass, True)
_setup_sensor(hass, 45)
_setup_sensor(hass, 39)
await hass.async_block_till_done()
assert len(calls) == 0 | [
"async",
"def",
"test_humidity_change_dry_off_within_tolerance",
"(",
"hass",
",",
"setup_comp_3",
")",
":",
"calls",
"=",
"await",
"_setup_switch",
"(",
"hass",
",",
"True",
")",
"_setup_sensor",
"(",
"hass",
",",
"45",
")",
"_setup_sensor",
"(",
"hass",
",",
... | [
696,
0
] | [
702,
26
] | python | en | ['en', 'en', 'en'] | True |
test_set_humidity_change_dry_off_outside_tolerance | (hass, setup_comp_3) | Test if humidity change turn dry off. | Test if humidity change turn dry off. | async def test_set_humidity_change_dry_off_outside_tolerance(hass, setup_comp_3):
"""Test if humidity change turn dry off."""
calls = await _setup_switch(hass, True)
_setup_sensor(hass, 36)
await hass.async_block_till_done()
assert len(calls) == 1
call = calls[0]
assert call.domain == HASS_D... | [
"async",
"def",
"test_set_humidity_change_dry_off_outside_tolerance",
"(",
"hass",
",",
"setup_comp_3",
")",
":",
"calls",
"=",
"await",
"_setup_switch",
"(",
"hass",
",",
"True",
")",
"_setup_sensor",
"(",
"hass",
",",
"36",
")",
"await",
"hass",
".",
"async_bl... | [
705,
0
] | [
714,
47
] | python | en | ['en', 'en', 'en'] | True |
test_humidity_change_dry_on_within_tolerance | (hass, setup_comp_3) | Test if humidity change doesn't turn dry on within tolerance. | Test if humidity change doesn't turn dry on within tolerance. | async def test_humidity_change_dry_on_within_tolerance(hass, setup_comp_3):
"""Test if humidity change doesn't turn dry on within tolerance."""
calls = await _setup_switch(hass, False)
_setup_sensor(hass, 37)
_setup_sensor(hass, 41)
await hass.async_block_till_done()
assert len(calls) == 0 | [
"async",
"def",
"test_humidity_change_dry_on_within_tolerance",
"(",
"hass",
",",
"setup_comp_3",
")",
":",
"calls",
"=",
"await",
"_setup_switch",
"(",
"hass",
",",
"False",
")",
"_setup_sensor",
"(",
"hass",
",",
"37",
")",
"_setup_sensor",
"(",
"hass",
",",
... | [
717,
0
] | [
723,
26
] | python | en | ['en', 'en', 'en'] | True |
test_humidity_change_dry_on_outside_tolerance | (hass, setup_comp_3) | Test if humidity change turn dry on. | Test if humidity change turn dry on. | async def test_humidity_change_dry_on_outside_tolerance(hass, setup_comp_3):
"""Test if humidity change turn dry on."""
calls = await _setup_switch(hass, False)
_setup_sensor(hass, 45)
await hass.async_block_till_done()
assert len(calls) == 1
call = calls[0]
assert call.domain == HASS_DOMAIN... | [
"async",
"def",
"test_humidity_change_dry_on_outside_tolerance",
"(",
"hass",
",",
"setup_comp_3",
")",
":",
"calls",
"=",
"await",
"_setup_switch",
"(",
"hass",
",",
"False",
")",
"_setup_sensor",
"(",
"hass",
",",
"45",
")",
"await",
"hass",
".",
"async_block_... | [
726,
0
] | [
735,
47
] | python | en | ['en', 'en', 'en'] | True |
test_running_when_operating_mode_is_off_2 | (hass, setup_comp_3) | Test that the switch turns off when enabled is set False. | Test that the switch turns off when enabled is set False. | async def test_running_when_operating_mode_is_off_2(hass, setup_comp_3):
"""Test that the switch turns off when enabled is set False."""
calls = await _setup_switch(hass, True)
_setup_sensor(hass, 45)
await hass.async_block_till_done()
await hass.services.async_call(
DOMAIN,
SERVICE_... | [
"async",
"def",
"test_running_when_operating_mode_is_off_2",
"(",
"hass",
",",
"setup_comp_3",
")",
":",
"calls",
"=",
"await",
"_setup_switch",
"(",
"hass",
",",
"True",
")",
"_setup_sensor",
"(",
"hass",
",",
"45",
")",
"await",
"hass",
".",
"async_block_till_... | [
738,
0
] | [
754,
47
] | python | en | ['en', 'en', 'en'] | True |
test_no_state_change_when_operation_mode_off_2 | (hass, setup_comp_3) | Test that the switch doesn't turn on when enabled is False. | Test that the switch doesn't turn on when enabled is False. | async def test_no_state_change_when_operation_mode_off_2(hass, setup_comp_3):
"""Test that the switch doesn't turn on when enabled is False."""
calls = await _setup_switch(hass, False)
_setup_sensor(hass, 30)
await hass.async_block_till_done()
await hass.services.async_call(
DOMAIN,
... | [
"async",
"def",
"test_no_state_change_when_operation_mode_off_2",
"(",
"hass",
",",
"setup_comp_3",
")",
":",
"calls",
"=",
"await",
"_setup_switch",
"(",
"hass",
",",
"False",
")",
"_setup_sensor",
"(",
"hass",
",",
"30",
")",
"await",
"hass",
".",
"async_block... | [
757,
0
] | [
771,
26
] | python | en | ['en', 'en', 'en'] | True |
setup_comp_4 | (hass) | Initialize components. | Initialize components. | async def setup_comp_4(hass):
"""Initialize components."""
assert await async_setup_component(
hass,
DOMAIN,
{
"humidifier": {
"platform": "generic_hygrostat",
"name": "test",
"dry_tolerance": 3,
"wet_tolerance":... | [
"async",
"def",
"setup_comp_4",
"(",
"hass",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"DOMAIN",
",",
"{",
"\"humidifier\"",
":",
"{",
"\"platform\"",
":",
"\"generic_hygrostat\"",
",",
"\"name\"",
":",
"\"test\"",
",",
"\"dry_toler... | [
775,
0
] | [
795,
38
] | python | en | ['de', 'en', 'en'] | False |
test_humidity_change_dry_trigger_on_not_long_enough | (hass, setup_comp_4) | Test if humidity change turn dry on. | Test if humidity change turn dry on. | async def test_humidity_change_dry_trigger_on_not_long_enough(hass, setup_comp_4):
"""Test if humidity change turn dry on."""
calls = await _setup_switch(hass, False)
_setup_sensor(hass, 35)
await hass.async_block_till_done()
assert len(calls) == 0
_setup_sensor(hass, 45)
await hass.async_b... | [
"async",
"def",
"test_humidity_change_dry_trigger_on_not_long_enough",
"(",
"hass",
",",
"setup_comp_4",
")",
":",
"calls",
"=",
"await",
"_setup_switch",
"(",
"hass",
",",
"False",
")",
"_setup_sensor",
"(",
"hass",
",",
"35",
")",
"await",
"hass",
".",
"async_... | [
798,
0
] | [
807,
26
] | python | en | ['en', 'en', 'en'] | True |
test_humidity_change_dry_trigger_on_long_enough | (hass, setup_comp_4) | Test if humidity change turn dry on. | Test if humidity change turn dry on. | async def test_humidity_change_dry_trigger_on_long_enough(hass, setup_comp_4):
"""Test if humidity change turn dry on."""
fake_changed = datetime.datetime(
1918, 11, 11, 11, 11, 11, tzinfo=datetime.timezone.utc
)
with patch(
"homeassistant.helpers.condition.dt_util.utcnow", return_value=... | [
"async",
"def",
"test_humidity_change_dry_trigger_on_long_enough",
"(",
"hass",
",",
"setup_comp_4",
")",
":",
"fake_changed",
"=",
"datetime",
".",
"datetime",
"(",
"1918",
",",
"11",
",",
"11",
",",
"11",
",",
"11",
",",
"11",
",",
"tzinfo",
"=",
"datetime... | [
810,
0
] | [
829,
47
] | python | en | ['en', 'en', 'en'] | True |
test_humidity_change_dry_trigger_off_not_long_enough | (hass, setup_comp_4) | Test if humidity change turn dry on. | Test if humidity change turn dry on. | async def test_humidity_change_dry_trigger_off_not_long_enough(hass, setup_comp_4):
"""Test if humidity change turn dry on."""
calls = await _setup_switch(hass, True)
_setup_sensor(hass, 45)
await hass.async_block_till_done()
assert len(calls) == 0
_setup_sensor(hass, 35)
await hass.async_b... | [
"async",
"def",
"test_humidity_change_dry_trigger_off_not_long_enough",
"(",
"hass",
",",
"setup_comp_4",
")",
":",
"calls",
"=",
"await",
"_setup_switch",
"(",
"hass",
",",
"True",
")",
"_setup_sensor",
"(",
"hass",
",",
"45",
")",
"await",
"hass",
".",
"async_... | [
832,
0
] | [
841,
26
] | python | en | ['en', 'en', 'en'] | True |
test_humidity_change_dry_trigger_off_long_enough | (hass, setup_comp_4) | Test if humidity change turn dry on. | Test if humidity change turn dry on. | async def test_humidity_change_dry_trigger_off_long_enough(hass, setup_comp_4):
"""Test if humidity change turn dry on."""
fake_changed = datetime.datetime(
1918, 11, 11, 11, 11, 11, tzinfo=datetime.timezone.utc
)
with patch(
"homeassistant.helpers.condition.dt_util.utcnow", return_value... | [
"async",
"def",
"test_humidity_change_dry_trigger_off_long_enough",
"(",
"hass",
",",
"setup_comp_4",
")",
":",
"fake_changed",
"=",
"datetime",
".",
"datetime",
"(",
"1918",
",",
"11",
",",
"11",
",",
"11",
",",
"11",
",",
"11",
",",
"tzinfo",
"=",
"datetim... | [
844,
0
] | [
863,
47
] | python | en | ['en', 'en', 'en'] | True |
test_mode_change_dry_trigger_off_not_long_enough | (hass, setup_comp_4) | Test if mode change turns dry off despite minimum cycle. | Test if mode change turns dry off despite minimum cycle. | async def test_mode_change_dry_trigger_off_not_long_enough(hass, setup_comp_4):
"""Test if mode change turns dry off despite minimum cycle."""
calls = await _setup_switch(hass, True)
_setup_sensor(hass, 45)
await hass.async_block_till_done()
assert len(calls) == 0
await hass.services.async_call(... | [
"async",
"def",
"test_mode_change_dry_trigger_off_not_long_enough",
"(",
"hass",
",",
"setup_comp_4",
")",
":",
"calls",
"=",
"await",
"_setup_switch",
"(",
"hass",
",",
"True",
")",
"_setup_sensor",
"(",
"hass",
",",
"45",
")",
"await",
"hass",
".",
"async_bloc... | [
866,
0
] | [
883,
47
] | python | en | ['en', 'en', 'en'] | True |
test_mode_change_dry_trigger_on_not_long_enough | (hass, setup_comp_4) | Test if mode change turns dry on despite minimum cycle. | Test if mode change turns dry on despite minimum cycle. | async def test_mode_change_dry_trigger_on_not_long_enough(hass, setup_comp_4):
"""Test if mode change turns dry on despite minimum cycle."""
calls = await _setup_switch(hass, False)
_setup_sensor(hass, 35)
await hass.async_block_till_done()
await hass.services.async_call(
DOMAIN,
SER... | [
"async",
"def",
"test_mode_change_dry_trigger_on_not_long_enough",
"(",
"hass",
",",
"setup_comp_4",
")",
":",
"calls",
"=",
"await",
"_setup_switch",
"(",
"hass",
",",
"False",
")",
"_setup_sensor",
"(",
"hass",
",",
"35",
")",
"await",
"hass",
".",
"async_bloc... | [
886,
0
] | [
912,
47
] | python | en | ['en', 'en', 'en'] | True |
setup_comp_6 | (hass) | Initialize components. | Initialize components. | async def setup_comp_6(hass):
"""Initialize components."""
assert await async_setup_component(
hass,
DOMAIN,
{
"humidifier": {
"platform": "generic_hygrostat",
"name": "test",
"dry_tolerance": 3,
"wet_tolerance":... | [
"async",
"def",
"setup_comp_6",
"(",
"hass",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"DOMAIN",
",",
"{",
"\"humidifier\"",
":",
"{",
"\"platform\"",
":",
"\"generic_hygrostat\"",
",",
"\"name\"",
":",
"\"test\"",
",",
"\"dry_toler... | [
916,
0
] | [
935,
38
] | python | en | ['de', 'en', 'en'] | False |
test_humidity_change_humidifier_trigger_off_not_long_enough | (
hass, setup_comp_6
) | Test if humidity change doesn't turn humidifier off because of time. | Test if humidity change doesn't turn humidifier off because of time. | async def test_humidity_change_humidifier_trigger_off_not_long_enough(
hass, setup_comp_6
):
"""Test if humidity change doesn't turn humidifier off because of time."""
calls = await _setup_switch(hass, True)
_setup_sensor(hass, 35)
await hass.async_block_till_done()
assert len(calls) == 0
_... | [
"async",
"def",
"test_humidity_change_humidifier_trigger_off_not_long_enough",
"(",
"hass",
",",
"setup_comp_6",
")",
":",
"calls",
"=",
"await",
"_setup_switch",
"(",
"hass",
",",
"True",
")",
"_setup_sensor",
"(",
"hass",
",",
"35",
")",
"await",
"hass",
".",
... | [
938,
0
] | [
949,
26
] | python | en | ['en', 'en', 'en'] | True |
test_humidity_change_humidifier_trigger_on_not_long_enough | (
hass, setup_comp_6
) | Test if humidity change doesn't turn humidifier on because of time. | Test if humidity change doesn't turn humidifier on because of time. | async def test_humidity_change_humidifier_trigger_on_not_long_enough(
hass, setup_comp_6
):
"""Test if humidity change doesn't turn humidifier on because of time."""
calls = await _setup_switch(hass, False)
_setup_sensor(hass, 45)
await hass.async_block_till_done()
assert len(calls) == 0
_s... | [
"async",
"def",
"test_humidity_change_humidifier_trigger_on_not_long_enough",
"(",
"hass",
",",
"setup_comp_6",
")",
":",
"calls",
"=",
"await",
"_setup_switch",
"(",
"hass",
",",
"False",
")",
"_setup_sensor",
"(",
"hass",
",",
"45",
")",
"await",
"hass",
".",
... | [
952,
0
] | [
963,
26
] | 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.