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
gcm_api_deprecated
(value)
Warn user that GCM API config is deprecated.
Warn user that GCM API config is deprecated.
def gcm_api_deprecated(value): """Warn user that GCM API config is deprecated.""" if value: _LOGGER.warning( "Configuring html5_push_notifications via the GCM api" " has been deprecated and will stop working after April 11," " 2019. Use the VAPID configuration instead...
[ "def", "gcm_api_deprecated", "(", "value", ")", ":", "if", "value", ":", "_LOGGER", ".", "warning", "(", "\"Configuring html5_push_notifications via the GCM api\"", "\" has been deprecated and will stop working after April 11,\"", "\" 2019. Use the VAPID configuration instead. For inst...
[ 53, 0 ]
[ 62, 16 ]
python
en
['en', 'en', 'en']
True
get_service
(hass, config, discovery_info=None)
Get the HTML5 push notification service.
Get the HTML5 push notification service.
def get_service(hass, config, discovery_info=None): """Get the HTML5 push notification service.""" json_path = hass.config.path(REGISTRATIONS_FILE) registrations = _load_config(json_path) if registrations is None: return None vapid_pub_key = config.get(ATTR_VAPID_PUB_KEY) vapid_prv_ke...
[ "def", "get_service", "(", "hass", ",", "config", ",", "discovery_info", "=", "None", ")", ":", "json_path", "=", "hass", ".", "config", ".", "path", "(", "REGISTRATIONS_FILE", ")", "registrations", "=", "_load_config", "(", "json_path", ")", "if", "registra...
[ 169, 0 ]
[ 200, 5 ]
python
en
['en', 'en', 'en']
True
_load_config
(filename)
Load configuration.
Load configuration.
def _load_config(filename): """Load configuration.""" with suppress(HomeAssistantError): return load_json(filename) return {}
[ "def", "_load_config", "(", "filename", ")", ":", "with", "suppress", "(", "HomeAssistantError", ")", ":", "return", "load_json", "(", "filename", ")", "return", "{", "}" ]
[ 203, 0 ]
[ 207, 13 ]
python
en
['en', 'sm', 'en']
False
add_jwt
(timestamp, target, tag, jwt_secret)
Create JWT json to put into payload.
Create JWT json to put into payload.
def add_jwt(timestamp, target, tag, jwt_secret): """Create JWT json to put into payload.""" jwt_exp = datetime.fromtimestamp(timestamp) + timedelta(days=JWT_VALID_DAYS) jwt_claims = { "exp": jwt_exp, "nbf": timestamp, "iat": timestamp, ATTR_TARGET: target, ATTR_TAG: ...
[ "def", "add_jwt", "(", "timestamp", ",", "target", ",", "tag", ",", "jwt_secret", ")", ":", "jwt_exp", "=", "datetime", ".", "fromtimestamp", "(", "timestamp", ")", "+", "timedelta", "(", "days", "=", "JWT_VALID_DAYS", ")", "jwt_claims", "=", "{", "\"exp\"...
[ 550, 0 ]
[ 561, 45 ]
python
en
['en', 'en', 'en']
True
create_vapid_headers
(vapid_email, subscription_info, vapid_private_key)
Create encrypted headers to send to WebPusher.
Create encrypted headers to send to WebPusher.
def create_vapid_headers(vapid_email, subscription_info, vapid_private_key): """Create encrypted headers to send to WebPusher.""" if vapid_email and vapid_private_key and ATTR_ENDPOINT in subscription_info: url = urlparse(subscription_info.get(ATTR_ENDPOINT)) vapid_claims = { "sub":...
[ "def", "create_vapid_headers", "(", "vapid_email", ",", "subscription_info", ",", "vapid_private_key", ")", ":", "if", "vapid_email", "and", "vapid_private_key", "and", "ATTR_ENDPOINT", "in", "subscription_info", ":", "url", "=", "urlparse", "(", "subscription_info", ...
[ 564, 0 ]
[ 575, 15 ]
python
en
['en', 'en', 'en']
True
HTML5PushRegistrationView.__init__
(self, registrations, json_path)
Init HTML5PushRegistrationView.
Init HTML5PushRegistrationView.
def __init__(self, registrations, json_path): """Init HTML5PushRegistrationView.""" self.registrations = registrations self.json_path = json_path
[ "def", "__init__", "(", "self", ",", "registrations", ",", "json_path", ")", ":", "self", ".", "registrations", "=", "registrations", "self", ".", "json_path", "=", "json_path" ]
[ 216, 4 ]
[ 219, 34 ]
python
en
['en', 'ru-Latn', 'en']
False
HTML5PushRegistrationView.post
(self, request)
Accept the POST request for push registrations from a browser.
Accept the POST request for push registrations from a browser.
async def post(self, request): """Accept the POST request for push registrations from a browser.""" try: data = await request.json() except ValueError: return self.json_message("Invalid JSON", HTTP_BAD_REQUEST) try: data = REGISTER_SCHEMA(data) ...
[ "async", "def", "post", "(", "self", ",", "request", ")", ":", "try", ":", "data", "=", "await", "request", ".", "json", "(", ")", "except", "ValueError", ":", "return", "self", ".", "json_message", "(", "\"Invalid JSON\"", ",", "HTTP_BAD_REQUEST", ")", ...
[ 221, 4 ]
[ 255, 13 ]
python
en
['en', 'en', 'en']
True
HTML5PushRegistrationView.find_registration_name
(self, data, suggested=None)
Find a registration name matching data or generate a unique one.
Find a registration name matching data or generate a unique one.
def find_registration_name(self, data, suggested=None): """Find a registration name matching data or generate a unique one.""" endpoint = data.get(ATTR_SUBSCRIPTION).get(ATTR_ENDPOINT) for key, registration in self.registrations.items(): subscription = registration.get(ATTR_SUBSCRIPT...
[ "def", "find_registration_name", "(", "self", ",", "data", ",", "suggested", "=", "None", ")", ":", "endpoint", "=", "data", ".", "get", "(", "ATTR_SUBSCRIPTION", ")", ".", "get", "(", "ATTR_ENDPOINT", ")", "for", "key", ",", "registration", "in", "self", ...
[ 257, 4 ]
[ 264, 86 ]
python
en
['en', 'en', 'en']
True
HTML5PushRegistrationView.delete
(self, request)
Delete a registration.
Delete a registration.
async def delete(self, request): """Delete a registration.""" try: data = await request.json() except ValueError: return self.json_message("Invalid JSON", HTTP_BAD_REQUEST) subscription = data.get(ATTR_SUBSCRIPTION) found = None for key, registr...
[ "async", "def", "delete", "(", "self", ",", "request", ")", ":", "try", ":", "data", "=", "await", "request", ".", "json", "(", ")", "except", "ValueError", ":", "return", "self", ".", "json_message", "(", "\"Invalid JSON\"", ",", "HTTP_BAD_REQUEST", ")", ...
[ 266, 4 ]
[ 300, 78 ]
python
en
['en', 'da', 'en']
True
HTML5PushCallbackView.__init__
(self, registrations)
Init HTML5PushCallbackView.
Init HTML5PushCallbackView.
def __init__(self, registrations): """Init HTML5PushCallbackView.""" self.registrations = registrations
[ "def", "__init__", "(", "self", ",", "registrations", ")", ":", "self", ".", "registrations", "=", "registrations" ]
[ 310, 4 ]
[ 312, 42 ]
python
en
['en', 'zu', 'en']
False
HTML5PushCallbackView.decode_jwt
(self, token)
Find the registration that signed this JWT and return it.
Find the registration that signed this JWT and return it.
def decode_jwt(self, token): """Find the registration that signed this JWT and return it.""" # 1. Check claims w/o verifying to see if a target is in there. # 2. If target in claims, attempt to verify against the given name. # 2a. If decode is successful, return the payload. #...
[ "def", "decode_jwt", "(", "self", ",", "token", ")", ":", "# 1. Check claims w/o verifying to see if a target is in there.", "# 2. If target in claims, attempt to verify against the given name.", "# 2a. If decode is successful, return the payload.", "# 2b. If decode is unsuccessful, return a...
[ 314, 4 ]
[ 333, 9 ]
python
en
['en', 'en', 'en']
True
HTML5PushCallbackView.check_authorization_header
(self, request)
Check the authorization header.
Check the authorization header.
def check_authorization_header(self, request): """Check the authorization header.""" auth = request.headers.get(AUTHORIZATION) if not auth: return self.json_message( "Authorization header is expected", status_code=HTTP_UNAUTHORIZED ) parts = auth...
[ "def", "check_authorization_header", "(", "self", ",", "request", ")", ":", "auth", "=", "request", ".", "headers", ".", "get", "(", "AUTHORIZATION", ")", "if", "not", "auth", ":", "return", "self", ".", "json_message", "(", "\"Authorization header is expected\"...
[ 337, 4 ]
[ 364, 22 ]
python
en
['en', 'en', 'en']
True
HTML5PushCallbackView.post
(self, request)
Accept the POST request for push registrations event callback.
Accept the POST request for push registrations event callback.
async def post(self, request): """Accept the POST request for push registrations event callback.""" auth_check = self.check_authorization_header(request) if not isinstance(auth_check, dict): return auth_check try: data = await request.json() except ValueE...
[ "async", "def", "post", "(", "self", ",", "request", ")", ":", "auth_check", "=", "self", ".", "check_authorization_header", "(", "request", ")", "if", "not", "isinstance", "(", "auth_check", ",", "dict", ")", ":", "return", "auth_check", "try", ":", "data...
[ 366, 4 ]
[ 399, 77 ]
python
en
['en', 'en', 'en']
True
HTML5NotificationService.__init__
(self, hass, gcm_key, vapid_prv, vapid_email, registrations, json_path)
Initialize the service.
Initialize the service.
def __init__(self, hass, gcm_key, vapid_prv, vapid_email, registrations, json_path): """Initialize the service.""" self._gcm_key = gcm_key self._vapid_prv = vapid_prv self._vapid_email = vapid_email self.registrations = registrations self.registrations_json_path = json_pa...
[ "def", "__init__", "(", "self", ",", "hass", ",", "gcm_key", ",", "vapid_prv", ",", "vapid_email", ",", "registrations", ",", "json_path", ")", ":", "self", ".", "_gcm_key", "=", "gcm_key", "self", ".", "_vapid_prv", "=", "vapid_prv", "self", ".", "_vapid_...
[ 405, 4 ]
[ 431, 9 ]
python
en
['en', 'en', 'en']
True
HTML5NotificationService.targets
(self)
Return a dictionary of registered targets.
Return a dictionary of registered targets.
def targets(self): """Return a dictionary of registered targets.""" targets = {} for registration in self.registrations: targets[registration] = registration return targets
[ "def", "targets", "(", "self", ")", ":", "targets", "=", "{", "}", "for", "registration", "in", "self", ".", "registrations", ":", "targets", "[", "registration", "]", "=", "registration", "return", "targets" ]
[ 434, 4 ]
[ 439, 22 ]
python
en
['en', 'en', 'en']
True
HTML5NotificationService.dismiss
(self, **kwargs)
Dismisses a notification.
Dismisses a notification.
def dismiss(self, **kwargs): """Dismisses a notification.""" data = kwargs.get(ATTR_DATA) tag = data.get(ATTR_TAG) if data else "" payload = {ATTR_TAG: tag, ATTR_DISMISS: True, ATTR_DATA: {}} self._push_message(payload, **kwargs)
[ "def", "dismiss", "(", "self", ",", "*", "*", "kwargs", ")", ":", "data", "=", "kwargs", ".", "get", "(", "ATTR_DATA", ")", "tag", "=", "data", ".", "get", "(", "ATTR_TAG", ")", "if", "data", "else", "\"\"", "payload", "=", "{", "ATTR_TAG", ":", ...
[ 441, 4 ]
[ 447, 45 ]
python
en
['en', 'fr', 'en']
True
HTML5NotificationService.async_dismiss
(self, **kwargs)
Dismisses a notification. This method must be run in the event loop.
Dismisses a notification.
async def async_dismiss(self, **kwargs): """Dismisses a notification. This method must be run in the event loop. """ await self.hass.async_add_executor_job(partial(self.dismiss, **kwargs))
[ "async", "def", "async_dismiss", "(", "self", ",", "*", "*", "kwargs", ")", ":", "await", "self", ".", "hass", ".", "async_add_executor_job", "(", "partial", "(", "self", ".", "dismiss", ",", "*", "*", "kwargs", ")", ")" ]
[ 449, 4 ]
[ 454, 79 ]
python
en
['en', 'fr', 'en']
True
HTML5NotificationService.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.""" tag = str(uuid.uuid4()) payload = { "badge": "/static/images/notification-badge.png", "body": message, ATTR_DATA: {}, "icon": "/static/icons/favicon-192x192.png", ...
[ "def", "send_message", "(", "self", ",", "message", "=", "\"\"", ",", "*", "*", "kwargs", ")", ":", "tag", "=", "str", "(", "uuid", ".", "uuid4", "(", ")", ")", "payload", "=", "{", "\"badge\"", ":", "\"/static/images/notification-badge.png\"", ",", "\"b...
[ 456, 4 ]
[ 490, 45 ]
python
en
['en', 'en', 'en']
True
HTML5NotificationService._push_message
(self, payload, **kwargs)
Send the message.
Send the message.
def _push_message(self, payload, **kwargs): """Send the message.""" timestamp = int(time.time()) ttl = int(kwargs.get(ATTR_TTL, DEFAULT_TTL)) priority = kwargs.get(ATTR_PRIORITY, DEFAULT_PRIORITY) if priority not in ["normal", "high"]: priority = DEFAULT_PRIORITY ...
[ "def", "_push_message", "(", "self", ",", "payload", ",", "*", "*", "kwargs", ")", ":", "timestamp", "=", "int", "(", "time", ".", "time", "(", ")", ")", "ttl", "=", "int", "(", "kwargs", ".", "get", "(", "ATTR_TTL", ",", "DEFAULT_TTL", ")", ")", ...
[ 492, 4 ]
[ 547, 55 ]
python
en
['en', 'en', 'en']
True
AtagConfigFlow.async_step_user
(self, user_input=None)
Handle a flow initialized by the user.
Handle a flow initialized by the user.
async def async_step_user(self, user_input=None): """Handle a flow initialized by the user.""" if not user_input: return await self._show_form() atag = pyatag.AtagOne(session=async_get_clientsession(self.hass), **user_input) try: await atag.update() exc...
[ "async", "def", "async_step_user", "(", "self", ",", "user_input", "=", "None", ")", ":", "if", "not", "user_input", ":", "return", "await", "self", ".", "_show_form", "(", ")", "atag", "=", "pyatag", ".", "AtagOne", "(", "session", "=", "async_get_clients...
[ 21, 4 ]
[ 39, 70 ]
python
en
['en', 'en', 'en']
True
AtagConfigFlow._show_form
(self, errors=None)
Show the form to the user.
Show the form to the user.
async def _show_form(self, errors=None): """Show the form to the user.""" return self.async_show_form( step_id="user", data_schema=vol.Schema(DATA_SCHEMA), errors=errors if errors else {}, )
[ "async", "def", "_show_form", "(", "self", ",", "errors", "=", "None", ")", ":", "return", "self", ".", "async_show_form", "(", "step_id", "=", "\"user\"", ",", "data_schema", "=", "vol", ".", "Schema", "(", "DATA_SCHEMA", ")", ",", "errors", "=", "error...
[ 41, 4 ]
[ 47, 9 ]
python
en
['en', 'en', 'en']
True
messages_handler
(websocket_path, queue)
Handles server side messages, putting them into a queue.
Handles server side messages, putting them into a queue.
async def messages_handler(websocket_path, queue): """Handles server side messages, putting them into a queue.""" async with websockets.connect(websocket_path) as websocket: await websocket.send(json.dumps({"cmd": "join"})) while True: update = await websocket.recv() que...
[ "async", "def", "messages_handler", "(", "websocket_path", ",", "queue", ")", ":", "async", "with", "websockets", ".", "connect", "(", "websocket_path", ")", "as", "websocket", ":", "await", "websocket", ".", "send", "(", "json", ".", "dumps", "(", "{", "\...
[ 51, 0 ]
[ 58, 36 ]
python
en
['en', 'en', 'en']
True
mock_storage
(hass_storage)
Autouse hass_storage for the TestCase tests.
Autouse hass_storage for the TestCase tests.
def mock_storage(hass_storage): """Autouse hass_storage for the TestCase tests."""
[ "def", "mock_storage", "(", "hass_storage", ")", ":" ]
[ 27, 0 ]
[ 28, 54 ]
python
en
['en', 'en', 'en']
True
zwave_setup
(hass)
Zwave setup.
Zwave setup.
async def zwave_setup(hass): """Zwave setup.""" await async_setup_component(hass, "zwave", {"zwave": {}}) await hass.async_block_till_done()
[ "async", "def", "zwave_setup", "(", "hass", ")", ":", "await", "async_setup_component", "(", "hass", ",", "\"zwave\"", ",", "{", "\"zwave\"", ":", "{", "}", "}", ")", "await", "hass", ".", "async_block_till_done", "(", ")" ]
[ 32, 0 ]
[ 35, 38 ]
python
en
['en', 'bs', 'en']
False
zwave_setup_ready
(hass, zwave_setup)
Zwave setup and set network to ready.
Zwave setup and set network to ready.
async def zwave_setup_ready(hass, zwave_setup): """Zwave setup and set network to ready.""" zwave_network = hass.data[DATA_NETWORK] zwave_network.state = MockNetwork.STATE_READY await hass.async_start()
[ "async", "def", "zwave_setup_ready", "(", "hass", ",", "zwave_setup", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "zwave_network", ".", "state", "=", "MockNetwork", ".", "STATE_READY", "await", "hass", ".", "async_start", "("...
[ 39, 0 ]
[ 44, 28 ]
python
en
['en', 'en', 'en']
True
test_valid_device_config
(hass, mock_openzwave)
Test valid device config.
Test valid device config.
async def test_valid_device_config(hass, mock_openzwave): """Test valid device config.""" device_config = {"light.kitchen": {"ignored": "true"}} result = await async_setup_component( hass, "zwave", {"zwave": {"device_config": device_config}} ) await hass.async_block_till_done() assert r...
[ "async", "def", "test_valid_device_config", "(", "hass", ",", "mock_openzwave", ")", ":", "device_config", "=", "{", "\"light.kitchen\"", ":", "{", "\"ignored\"", ":", "\"true\"", "}", "}", "result", "=", "await", "async_setup_component", "(", "hass", ",", "\"zw...
[ 47, 0 ]
[ 55, 17 ]
python
en
['nl', 'en', 'en']
True
test_invalid_device_config
(hass, mock_openzwave)
Test invalid device config.
Test invalid device config.
async def test_invalid_device_config(hass, mock_openzwave): """Test invalid device config.""" device_config = {"light.kitchen": {"some_ignored": "true"}} result = await async_setup_component( hass, "zwave", {"zwave": {"device_config": device_config}} ) await hass.async_block_till_done() ...
[ "async", "def", "test_invalid_device_config", "(", "hass", ",", "mock_openzwave", ")", ":", "device_config", "=", "{", "\"light.kitchen\"", ":", "{", "\"some_ignored\"", ":", "\"true\"", "}", "}", "result", "=", "await", "async_setup_component", "(", "hass", ",", ...
[ 58, 0 ]
[ 66, 21 ]
python
en
['fr', 'en', 'en']
True
test_config_access_error
()
Test threading error accessing config values.
Test threading error accessing config values.
def test_config_access_error(): """Test threading error accessing config values.""" node = MagicMock() def side_effect(): raise RuntimeError node.values.values.side_effect = side_effect result = zwave.get_config_value(node, 1) assert result is None
[ "def", "test_config_access_error", "(", ")", ":", "node", "=", "MagicMock", "(", ")", "def", "side_effect", "(", ")", ":", "raise", "RuntimeError", "node", ".", "values", ".", "values", ".", "side_effect", "=", "side_effect", "result", "=", "zwave", ".", "...
[ 69, 0 ]
[ 78, 25 ]
python
en
['en', 'la', 'en']
True
test_network_options
(hass, mock_openzwave)
Test network options.
Test network options.
async def test_network_options(hass, mock_openzwave): """Test network options.""" result = await async_setup_component( hass, "zwave", {"zwave": {"usb_path": "mock_usb_path", "config_path": "mock_config_path"}}, ) await hass.async_block_till_done() assert result network...
[ "async", "def", "test_network_options", "(", "hass", ",", "mock_openzwave", ")", ":", "result", "=", "await", "async_setup_component", "(", "hass", ",", "\"zwave\"", ",", "{", "\"zwave\"", ":", "{", "\"usb_path\"", ":", "\"mock_usb_path\"", ",", "\"config_path\"",...
[ 81, 0 ]
[ 94, 60 ]
python
en
['en', 'en', 'en']
True
test_network_key_validation
(hass, mock_openzwave)
Test network key validation.
Test network key validation.
async def test_network_key_validation(hass, mock_openzwave): """Test network key validation.""" test_values = [ ( "0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, " "0x0C, 0x0D, 0x0E, 0x0F, 0x10" ), ( "0x01,0x02,0x03,0x04,0x05,0x06,0x...
[ "async", "def", "test_network_key_validation", "(", "hass", ",", "mock_openzwave", ")", ":", "test_values", "=", "[", "(", "\"0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, \"", "\"0x0C, 0x0D, 0x0E, 0x0F, 0x10\"", ")", ",", "(", "\"0x01,0x02,0x03,0x04,0x05,0x06...
[ 97, 0 ]
[ 111, 54 ]
python
en
['en', 'ru-Latn', 'en']
True
test_erronous_network_key_fails_validation
(hass, mock_openzwave)
Test failing erroneous network key validation.
Test failing erroneous network key validation.
async def test_erronous_network_key_fails_validation(hass, mock_openzwave): """Test failing erroneous network key validation.""" test_values = [ ( "0x 01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, " "0x0C, 0x0D, 0x0E, 0x0F, 0x10" ), ( ...
[ "async", "def", "test_erronous_network_key_fails_validation", "(", "hass", ",", "mock_openzwave", ")", ":", "test_values", "=", "[", "(", "\"0x 01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, \"", "\"0x0C, 0x0D, 0x0E, 0x0F, 0x10\"", ")", ",", "(", "\"0X01,0X02,0X0...
[ 114, 0 ]
[ 131, 66 ]
python
en
['en', 'zu', 'en']
True
test_auto_heal_midnight
(hass, mock_openzwave, legacy_patchable_time)
Test network auto-heal at midnight.
Test network auto-heal at midnight.
async def test_auto_heal_midnight(hass, mock_openzwave, legacy_patchable_time): """Test network auto-heal at midnight.""" await async_setup_component(hass, "zwave", {"zwave": {"autoheal": True}}) await hass.async_block_till_done() network = hass.data[zwave.DATA_NETWORK] assert not network.heal.call...
[ "async", "def", "test_auto_heal_midnight", "(", "hass", ",", "mock_openzwave", ",", "legacy_patchable_time", ")", ":", "await", "async_setup_component", "(", "hass", ",", "\"zwave\"", ",", "{", "\"zwave\"", ":", "{", "\"autoheal\"", ":", "True", "}", "}", ")", ...
[ 134, 0 ]
[ 147, 44 ]
python
en
['da', 'en', 'en']
True
test_auto_heal_disabled
(hass, mock_openzwave)
Test network auto-heal disabled.
Test network auto-heal disabled.
async def test_auto_heal_disabled(hass, mock_openzwave): """Test network auto-heal disabled.""" await async_setup_component(hass, "zwave", {"zwave": {"autoheal": False}}) await hass.async_block_till_done() network = hass.data[zwave.DATA_NETWORK] assert not network.heal.called time = datetime(2...
[ "async", "def", "test_auto_heal_disabled", "(", "hass", ",", "mock_openzwave", ")", ":", "await", "async_setup_component", "(", "hass", ",", "\"zwave\"", ",", "{", "\"zwave\"", ":", "{", "\"autoheal\"", ":", "False", "}", "}", ")", "await", "hass", ".", "asy...
[ 150, 0 ]
[ 161, 34 ]
python
en
['es', 'en', 'en']
True
test_setup_platform
(hass, mock_openzwave)
Test invalid device config.
Test invalid device config.
async def test_setup_platform(hass, mock_openzwave): """Test invalid device config.""" mock_device = MagicMock() hass.data[DATA_NETWORK] = MagicMock() hass.data[zwave.DATA_DEVICES] = {456: mock_device} async_add_entities = MagicMock() result = await zwave.async_setup_platform(hass, None, async_...
[ "async", "def", "test_setup_platform", "(", "hass", ",", "mock_openzwave", ")", ":", "mock_device", "=", "MagicMock", "(", ")", "hass", ".", "data", "[", "DATA_NETWORK", "]", "=", "MagicMock", "(", ")", "hass", ".", "data", "[", "zwave", ".", "DATA_DEVICES...
[ 164, 0 ]
[ 187, 66 ]
python
en
['fr', 'en', 'en']
True
test_zwave_ready_wait
(hass, mock_openzwave, zwave_setup)
Test that zwave continues after waiting for network ready.
Test that zwave continues after waiting for network ready.
async def test_zwave_ready_wait(hass, mock_openzwave, zwave_setup): """Test that zwave continues after waiting for network ready.""" sleeps = [] def utcnow(): return datetime.fromtimestamp(len(sleeps)) asyncio_sleep = asyncio.sleep async def sleep(duration, loop=None): if duration...
[ "async", "def", "test_zwave_ready_wait", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup", ")", ":", "sleeps", "=", "[", "]", "def", "utcnow", "(", ")", ":", "return", "datetime", ".", "fromtimestamp", "(", "len", "(", "sleeps", ")", ")", "asyncio_sl...
[ 190, 0 ]
[ 214, 87 ]
python
en
['en', 'en', 'en']
True
test_device_entity
(hass, mock_openzwave)
Test device entity base class.
Test device entity base class.
async def test_device_entity(hass, mock_openzwave): """Test device entity base class.""" node = MockNode(node_id="10", name="Mock Node") value = MockValue( data=False, node=node, instance=2, object_id="11", label="Sensor", command_class=const.COMMAND_CLASS_SEN...
[ "async", "def", "test_device_entity", "(", "hass", ",", "mock_openzwave", ")", ":", "node", "=", "MockNode", "(", "node_id", "=", "\"10\"", ",", "name", "=", "\"Mock Node\"", ")", "value", "=", "MockValue", "(", "data", "=", "False", ",", "node", "=", "n...
[ 217, 0 ]
[ 241, 68 ]
python
en
['en', 'en', 'en']
True
test_node_removed
(hass, mock_openzwave)
Test node removed in base class.
Test node removed in base class.
async def test_node_removed(hass, mock_openzwave): """Test node removed in base class.""" # Create a mock node & node entity node = MockNode(node_id="10", name="Mock Node") value = MockValue( data=False, node=node, instance=2, object_id="11", label="Sensor", ...
[ "async", "def", "test_node_removed", "(", "hass", ",", "mock_openzwave", ")", ":", "# Create a mock node & node entity", "node", "=", "MockNode", "(", "node_id", "=", "\"10\"", ",", "name", "=", "\"Mock Node\"", ")", "value", "=", "MockValue", "(", "data", "=", ...
[ 244, 0 ]
[ 288, 61 ]
python
en
['en', 'en', 'en']
True
test_node_discovery
(hass, mock_openzwave)
Test discovery of a node.
Test discovery of a node.
async def test_node_discovery(hass, mock_openzwave): """Test discovery of a node.""" mock_receivers = [] def mock_connect(receiver, signal, *args, **kwargs): if signal == MockNetwork.SIGNAL_NODE_ADDED: mock_receivers.append(receiver) with patch("pydispatch.dispatcher.connect", new=...
[ "async", "def", "test_node_discovery", "(", "hass", ",", "mock_openzwave", ")", ":", "mock_receivers", "=", "[", "]", "def", "mock_connect", "(", "receiver", ",", "signal", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "signal", "==", "MockN...
[ 291, 0 ]
[ 309, 64 ]
python
en
['en', 'en', 'en']
True
test_unparsed_node_discovery
(hass, mock_openzwave)
Test discovery of a node.
Test discovery of a node.
async def test_unparsed_node_discovery(hass, mock_openzwave): """Test discovery of a node.""" mock_receivers = [] def mock_connect(receiver, signal, *args, **kwargs): if signal == MockNetwork.SIGNAL_NODE_ADDED: mock_receivers.append(receiver) with patch("pydispatch.dispatcher.conne...
[ "async", "def", "test_unparsed_node_discovery", "(", "hass", ",", "mock_openzwave", ")", ":", "mock_receivers", "=", "[", "]", "def", "mock_connect", "(", "receiver", ",", "signal", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "signal", "==",...
[ 312, 0 ]
[ 353, 70 ]
python
en
['en', 'en', 'en']
True
test_node_ignored
(hass, mock_openzwave)
Test discovery of a node.
Test discovery of a node.
async def test_node_ignored(hass, mock_openzwave): """Test discovery of a node.""" mock_receivers = [] def mock_connect(receiver, signal, *args, **kwargs): if signal == MockNetwork.SIGNAL_NODE_ADDED: mock_receivers.append(receiver) with patch("pydispatch.dispatcher.connect", new=mo...
[ "async", "def", "test_node_ignored", "(", "hass", ",", "mock_openzwave", ")", ":", "mock_receivers", "=", "[", "]", "def", "mock_connect", "(", "receiver", ",", "signal", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "signal", "==", "MockNet...
[ 356, 0 ]
[ 378, 53 ]
python
en
['en', 'en', 'en']
True
test_value_discovery
(hass, mock_openzwave)
Test discovery of a node.
Test discovery of a node.
async def test_value_discovery(hass, mock_openzwave): """Test discovery of a node.""" mock_receivers = [] def mock_connect(receiver, signal, *args, **kwargs): if signal == MockNetwork.SIGNAL_VALUE_ADDED: mock_receivers.append(receiver) with patch("pydispatch.dispatcher.connect", ne...
[ "async", "def", "test_value_discovery", "(", "hass", ",", "mock_openzwave", ")", ":", "mock_receivers", "=", "[", "]", "def", "mock_connect", "(", "receiver", ",", "signal", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "signal", "==", "Mock...
[ 381, 0 ]
[ 408, 79 ]
python
en
['en', 'en', 'en']
True
test_value_entities
(hass, mock_openzwave)
Test discovery of a node.
Test discovery of a node.
async def test_value_entities(hass, mock_openzwave): """Test discovery of a node.""" mock_receivers = {} def mock_connect(receiver, signal, *args, **kwargs): mock_receivers[signal] = receiver with patch("pydispatch.dispatcher.connect", new=mock_connect): await async_setup_component(has...
[ "async", "def", "test_value_entities", "(", "hass", ",", "mock_openzwave", ")", ":", "mock_receivers", "=", "{", "}", "def", "mock_connect", "(", "receiver", ",", "signal", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "mock_receivers", "[", "signal...
[ 411, 0 ]
[ 573, 65 ]
python
en
['en', 'en', 'en']
True
test_value_discovery_existing_entity
(hass, mock_openzwave)
Test discovery of a node.
Test discovery of a node.
async def test_value_discovery_existing_entity(hass, mock_openzwave): """Test discovery of a node.""" mock_receivers = [] def mock_connect(receiver, signal, *args, **kwargs): if signal == MockNetwork.SIGNAL_VALUE_ADDED: mock_receivers.append(receiver) with patch("pydispatch.dispatc...
[ "async", "def", "test_value_discovery_existing_entity", "(", "hass", ",", "mock_openzwave", ")", ":", "mock_receivers", "=", "[", "]", "def", "mock_connect", "(", "receiver", ",", "signal", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "signal",...
[ 576, 0 ]
[ 656, 5 ]
python
en
['en', 'en', 'en']
True
test_value_discovery_legacy_thermostat
(hass, mock_openzwave)
Test discovery of a node. Special case for legacy thermostats.
Test discovery of a node. Special case for legacy thermostats.
async def test_value_discovery_legacy_thermostat(hass, mock_openzwave): """Test discovery of a node. Special case for legacy thermostats.""" mock_receivers = [] def mock_connect(receiver, signal, *args, **kwargs): if signal == MockNetwork.SIGNAL_VALUE_ADDED: mock_receivers.append(receiv...
[ "async", "def", "test_value_discovery_legacy_thermostat", "(", "hass", ",", "mock_openzwave", ")", ":", "mock_receivers", "=", "[", "]", "def", "mock_connect", "(", "receiver", ",", "signal", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "signal...
[ 659, 0 ]
[ 692, 5 ]
python
en
['en', 'en', 'en']
True
test_power_schemes
(hass, mock_openzwave)
Test power attribute.
Test power attribute.
async def test_power_schemes(hass, mock_openzwave): """Test power attribute.""" mock_receivers = [] def mock_connect(receiver, signal, *args, **kwargs): if signal == MockNetwork.SIGNAL_VALUE_ADDED: mock_receivers.append(receiver) with patch("pydispatch.dispatcher.connect", new=mock...
[ "async", "def", "test_power_schemes", "(", "hass", ",", "mock_openzwave", ")", ":", "mock_receivers", "=", "[", "]", "def", "mock_connect", "(", "receiver", ",", "signal", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "signal", "==", "MockNe...
[ 695, 0 ]
[ 749, 5 ]
python
en
['en', 'de', 'en']
True
test_network_ready
(hass, mock_openzwave)
Test Node network ready event.
Test Node network ready event.
async def test_network_ready(hass, mock_openzwave): """Test Node network ready event.""" mock_receivers = [] def mock_connect(receiver, signal, *args, **kwargs): if signal == MockNetwork.SIGNAL_ALL_NODES_QUERIED: mock_receivers.append(receiver) with patch("pydispatch.dispatcher.con...
[ "async", "def", "test_network_ready", "(", "hass", ",", "mock_openzwave", ")", ":", "mock_receivers", "=", "[", "]", "def", "mock_connect", "(", "receiver", ",", "signal", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "signal", "==", "MockNe...
[ 752, 0 ]
[ 776, 27 ]
python
en
['en', 'lb', 'en']
True
test_network_complete
(hass, mock_openzwave)
Test Node network complete event.
Test Node network complete event.
async def test_network_complete(hass, mock_openzwave): """Test Node network complete event.""" mock_receivers = [] def mock_connect(receiver, signal, *args, **kwargs): if signal == MockNetwork.SIGNAL_AWAKE_NODES_QUERIED: mock_receivers.append(receiver) with patch("pydispatch.dispat...
[ "async", "def", "test_network_complete", "(", "hass", ",", "mock_openzwave", ")", ":", "mock_receivers", "=", "[", "]", "def", "mock_connect", "(", "receiver", ",", "signal", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "signal", "==", "Moc...
[ 779, 0 ]
[ 803, 27 ]
python
da
['et', 'da', 'en']
False
test_network_complete_some_dead
(hass, mock_openzwave)
Test Node network complete some dead event.
Test Node network complete some dead event.
async def test_network_complete_some_dead(hass, mock_openzwave): """Test Node network complete some dead event.""" mock_receivers = [] def mock_connect(receiver, signal, *args, **kwargs): if signal == MockNetwork.SIGNAL_ALL_NODES_QUERIED_SOME_DEAD: mock_receivers.append(receiver) w...
[ "async", "def", "test_network_complete_some_dead", "(", "hass", ",", "mock_openzwave", ")", ":", "mock_receivers", "=", "[", "]", "def", "mock_connect", "(", "receiver", ",", "signal", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "signal", "=...
[ 806, 0 ]
[ 830, 27 ]
python
en
['no', 'en', 'en']
True
test_entity_discovery
( hass, mock_discovery, mock_import_module, mock_values, mock_openzwave, zwave_setup )
Test the creation of a new entity.
Test the creation of a new entity.
async def test_entity_discovery( hass, mock_discovery, mock_import_module, mock_values, mock_openzwave, zwave_setup ): """Test the creation of a new entity.""" (node, value_class, mock_schema) = mock_values registry = mock_registry(hass) entity_id = "mock_component.mock_node_mock_value" zwave_...
[ "async", "def", "test_entity_discovery", "(", "hass", ",", "mock_discovery", ",", "mock_import_module", ",", "mock_values", ",", "mock_openzwave", ",", "zwave_setup", ")", ":", "(", "node", ",", "value_class", ",", "mock_schema", ")", "=", "mock_values", "registry...
[ 833, 0 ]
[ 909, 60 ]
python
en
['en', 'en', 'en']
True
test_entity_existing_values
( hass, mock_discovery, mock_import_module, mock_values, mock_openzwave, zwave_setup )
Test the loading of already discovered values.
Test the loading of already discovered values.
async def test_entity_existing_values( hass, mock_discovery, mock_import_module, mock_values, mock_openzwave, zwave_setup ): """Test the loading of already discovered values.""" (node, value_class, mock_schema) = mock_values registry = mock_registry(hass) entity_id = "mock_component.mock_node_mock...
[ "async", "def", "test_entity_existing_values", "(", "hass", ",", "mock_discovery", ",", "mock_import_module", ",", "mock_values", ",", "mock_openzwave", ",", "zwave_setup", ")", ":", "(", "node", ",", "value_class", ",", "mock_schema", ")", "=", "mock_values", "re...
[ 912, 0 ]
[ 963, 5 ]
python
en
['en', 'en', 'en']
True
test_node_schema_mismatch
( hass, mock_discovery, mock_import_module, mock_values, mock_openzwave, zwave_setup )
Test node schema mismatch.
Test node schema mismatch.
async def test_node_schema_mismatch( hass, mock_discovery, mock_import_module, mock_values, mock_openzwave, zwave_setup ): """Test node schema mismatch.""" (node, value_class, mock_schema) = mock_values registry = mock_registry(hass) entity_id = "mock_component.mock_node_mock_value" zwave_conf...
[ "async", "def", "test_node_schema_mismatch", "(", "hass", ",", "mock_discovery", ",", "mock_import_module", ",", "mock_values", ",", "mock_openzwave", ",", "zwave_setup", ")", ":", "(", "node", ",", "value_class", ",", "mock_schema", ")", "=", "mock_values", "regi...
[ 966, 0 ]
[ 999, 60 ]
python
de
['nl', 'de', 'en']
False
test_entity_workaround_component
( hass, mock_discovery, mock_import_module, mock_values, mock_openzwave, zwave_setup )
Test component workaround.
Test component workaround.
async def test_entity_workaround_component( hass, mock_discovery, mock_import_module, mock_values, mock_openzwave, zwave_setup ): """Test component workaround.""" (node, value_class, mock_schema) = mock_values registry = mock_registry(hass) node.manufacturer_id = "010f" node.product_type = "0b...
[ "async", "def", "test_entity_workaround_component", "(", "hass", ",", "mock_discovery", ",", "mock_import_module", ",", "mock_values", ",", "mock_openzwave", ",", "zwave_setup", ")", ":", "(", "node", ",", "value_class", ",", "mock_schema", ")", "=", "mock_values", ...
[ 1002, 0 ]
[ 1049, 51 ]
python
de
['nl', 'de', 'en']
False
test_entity_workaround_ignore
( hass, mock_discovery, mock_import_module, mock_values, mock_openzwave, zwave_setup )
Test ignore workaround.
Test ignore workaround.
async def test_entity_workaround_ignore( hass, mock_discovery, mock_import_module, mock_values, mock_openzwave, zwave_setup ): """Test ignore workaround.""" (node, value_class, mock_schema) = mock_values registry = mock_registry(hass) entity_id = "mock_component.mock_node_mock_value" zwave_con...
[ "async", "def", "test_entity_workaround_ignore", "(", "hass", ",", "mock_discovery", ",", "mock_import_module", ",", "mock_values", ",", "mock_openzwave", ",", "zwave_setup", ")", ":", "(", "node", ",", "value_class", ",", "mock_schema", ")", "=", "mock_values", "...
[ 1052, 0 ]
[ 1091, 60 ]
python
en
['en', 'de', 'en']
True
test_entity_config_ignore
( hass, mock_discovery, mock_import_module, mock_values, mock_openzwave, zwave_setup )
Test ignore config.
Test ignore config.
async def test_entity_config_ignore( hass, mock_discovery, mock_import_module, mock_values, mock_openzwave, zwave_setup ): """Test ignore config.""" (node, value_class, mock_schema) = mock_values registry = mock_registry(hass) entity_id = "mock_component.mock_node_mock_value" zwave_config = {"...
[ "async", "def", "test_entity_config_ignore", "(", "hass", ",", "mock_discovery", ",", "mock_import_module", ",", "mock_values", ",", "mock_openzwave", ",", "zwave_setup", ")", ":", "(", "node", ",", "value_class", ",", "mock_schema", ")", "=", "mock_values", "regi...
[ 1094, 0 ]
[ 1126, 60 ]
python
en
['en', 'la', 'en']
True
test_entity_config_ignore_with_registry
( hass, mock_discovery, mock_import_module, mock_values, mock_openzwave, zwave_setup )
Test ignore config. The case when the device is in entity registry.
Test ignore config.
async def test_entity_config_ignore_with_registry( hass, mock_discovery, mock_import_module, mock_values, mock_openzwave, zwave_setup ): """Test ignore config. The case when the device is in entity registry. """ (node, value_class, mock_schema) = mock_values registry = mock_registry(hass) ...
[ "async", "def", "test_entity_config_ignore_with_registry", "(", "hass", ",", "mock_discovery", ",", "mock_import_module", ",", "mock_values", ",", "mock_openzwave", ",", "zwave_setup", ")", ":", "(", "node", ",", "value_class", ",", "mock_schema", ")", "=", "mock_va...
[ 1129, 0 ]
[ 1170, 60 ]
python
en
['en', 'la', 'en']
True
test_entity_platform_ignore
( hass, mock_discovery, mock_import_module, mock_values, mock_openzwave, zwave_setup )
Test platform ignore device.
Test platform ignore device.
async def test_entity_platform_ignore( hass, mock_discovery, mock_import_module, mock_values, mock_openzwave, zwave_setup ): """Test platform ignore device.""" (node, value_class, mock_schema) = mock_values registry = mock_registry(hass) entity_id = "mock_component.mock_node_mock_value" zwave_...
[ "async", "def", "test_entity_platform_ignore", "(", "hass", ",", "mock_discovery", ",", "mock_import_module", ",", "mock_values", ",", "mock_openzwave", ",", "zwave_setup", ")", ":", "(", "node", ",", "value_class", ",", "mock_schema", ")", "=", "mock_values", "re...
[ 1173, 0 ]
[ 1208, 60 ]
python
de
['it', 'de', 'en']
False
test_config_polling_intensity
( hass, mock_discovery, mock_import_module, mock_values, mock_openzwave, zwave_setup )
Test polling intensity.
Test polling intensity.
async def test_config_polling_intensity( hass, mock_discovery, mock_import_module, mock_values, mock_openzwave, zwave_setup ): """Test polling intensity.""" (node, value_class, mock_schema) = mock_values registry = mock_registry(hass) entity_id = "mock_component.mock_node_mock_value" zwave_con...
[ "async", "def", "test_config_polling_intensity", "(", "hass", ",", "mock_discovery", ",", "mock_import_module", ",", "mock_values", ",", "mock_openzwave", ",", "zwave_setup", ")", ":", "(", "node", ",", "value_class", ",", "mock_schema", ")", "=", "mock_values", "...
[ 1211, 0 ]
[ 1247, 69 ]
python
en
['en', 'jv', 'en']
True
test_device_config_glob_is_ordered
()
Test that device_config_glob preserves order.
Test that device_config_glob preserves order.
async def test_device_config_glob_is_ordered(): """Test that device_config_glob preserves order.""" conf = CONFIG_SCHEMA({"zwave": {CONF_DEVICE_CONFIG_GLOB: OrderedDict()}}) assert isinstance(conf["zwave"][CONF_DEVICE_CONFIG_GLOB], OrderedDict)
[ "async", "def", "test_device_config_glob_is_ordered", "(", ")", ":", "conf", "=", "CONFIG_SCHEMA", "(", "{", "\"zwave\"", ":", "{", "CONF_DEVICE_CONFIG_GLOB", ":", "OrderedDict", "(", ")", "}", "}", ")", "assert", "isinstance", "(", "conf", "[", "\"zwave\"", "...
[ 1250, 0 ]
[ 1253, 74 ]
python
en
['en', 'en', 'en']
True
test_add_node
(hass, mock_openzwave, zwave_setup_ready)
Test zwave add_node service.
Test zwave add_node service.
async def test_add_node(hass, mock_openzwave, zwave_setup_ready): """Test zwave add_node service.""" zwave_network = hass.data[DATA_NETWORK] await hass.services.async_call("zwave", "add_node", {}) await hass.async_block_till_done() assert zwave_network.controller.add_node.called assert len(zwa...
[ "async", "def", "test_add_node", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "await", "hass", ".", "services", ".", "async_call", "(", "\"zwave\"", ",", "\"add_nod...
[ 1256, 0 ]
[ 1265, 71 ]
python
de
['pl', 'de', 'sw']
False
test_add_node_secure
(hass, mock_openzwave, zwave_setup_ready)
Test zwave add_node_secure service.
Test zwave add_node_secure service.
async def test_add_node_secure(hass, mock_openzwave, zwave_setup_ready): """Test zwave add_node_secure service.""" zwave_network = hass.data[DATA_NETWORK] await hass.services.async_call("zwave", "add_node_secure", {}) await hass.async_block_till_done() assert zwave_network.controller.add_node.call...
[ "async", "def", "test_add_node_secure", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "await", "hass", ".", "services", ".", "async_call", "(", "\"zwave\"", ",", "\"...
[ 1268, 0 ]
[ 1277, 72 ]
python
da
['pl', 'da', 'en']
False
test_remove_node
(hass, mock_openzwave, zwave_setup_ready)
Test zwave remove_node service.
Test zwave remove_node service.
async def test_remove_node(hass, mock_openzwave, zwave_setup_ready): """Test zwave remove_node service.""" zwave_network = hass.data[DATA_NETWORK] await hass.services.async_call("zwave", "remove_node", {}) await hass.async_block_till_done() assert zwave_network.controller.remove_node.called as...
[ "async", "def", "test_remove_node", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "await", "hass", ".", "services", ".", "async_call", "(", "\"zwave\"", ",", "\"remo...
[ 1280, 0 ]
[ 1288, 68 ]
python
de
['pl', 'de', 'sw']
False
test_cancel_command
(hass, mock_openzwave, zwave_setup_ready)
Test zwave cancel_command service.
Test zwave cancel_command service.
async def test_cancel_command(hass, mock_openzwave, zwave_setup_ready): """Test zwave cancel_command service.""" zwave_network = hass.data[DATA_NETWORK] await hass.services.async_call("zwave", "cancel_command", {}) await hass.async_block_till_done() assert zwave_network.controller.cancel_command.c...
[ "async", "def", "test_cancel_command", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "await", "hass", ".", "services", ".", "async_call", "(", "\"zwave\"", ",", "\"c...
[ 1291, 0 ]
[ 1299, 71 ]
python
de
['de', 'de', 'en']
True
test_heal_network
(hass, mock_openzwave, zwave_setup_ready)
Test zwave heal_network service.
Test zwave heal_network service.
async def test_heal_network(hass, mock_openzwave, zwave_setup_ready): """Test zwave heal_network service.""" zwave_network = hass.data[DATA_NETWORK] await hass.services.async_call("zwave", "heal_network", {}) await hass.async_block_till_done() assert zwave_network.heal.called assert len(zwave_...
[ "async", "def", "test_heal_network", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "await", "hass", ".", "services", ".", "async_call", "(", "\"zwave\"", ",", "\"hea...
[ 1302, 0 ]
[ 1310, 50 ]
python
de
['pl', 'de', 'it']
False
test_soft_reset
(hass, mock_openzwave, zwave_setup_ready)
Test zwave soft_reset service.
Test zwave soft_reset service.
async def test_soft_reset(hass, mock_openzwave, zwave_setup_ready): """Test zwave soft_reset service.""" zwave_network = hass.data[DATA_NETWORK] await hass.services.async_call("zwave", "soft_reset", {}) await hass.async_block_till_done() assert zwave_network.controller.soft_reset.called assert...
[ "async", "def", "test_soft_reset", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "await", "hass", ".", "services", ".", "async_call", "(", "\"zwave\"", ",", "\"soft_...
[ 1313, 0 ]
[ 1321, 67 ]
python
de
['de', 'de', 'it']
True
test_test_network
(hass, mock_openzwave, zwave_setup_ready)
Test zwave test_network service.
Test zwave test_network service.
async def test_test_network(hass, mock_openzwave, zwave_setup_ready): """Test zwave test_network service.""" zwave_network = hass.data[DATA_NETWORK] await hass.services.async_call("zwave", "test_network", {}) await hass.async_block_till_done() assert zwave_network.test.called assert len(zwave_...
[ "async", "def", "test_test_network", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "await", "hass", ".", "services", ".", "async_call", "(", "\"zwave\"", ",", "\"tes...
[ 1324, 0 ]
[ 1332, 50 ]
python
de
['pl', 'de', 'it']
False
test_stop_network
(hass, mock_openzwave, zwave_setup_ready)
Test zwave stop_network service.
Test zwave stop_network service.
async def test_stop_network(hass, mock_openzwave, zwave_setup_ready): """Test zwave stop_network service.""" zwave_network = hass.data[DATA_NETWORK] with patch.object(hass.bus, "fire") as mock_fire: await hass.services.async_call("zwave", "stop_network", {}) await hass.async_block_till_done...
[ "async", "def", "test_stop_network", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "with", "patch", ".", "object", "(", "hass", ".", "bus", ",", "\"fire\"", ")", ...
[ 1335, 0 ]
[ 1347, 72 ]
python
de
['pl', 'de', 'it']
False
test_rename_node
(hass, mock_openzwave, zwave_setup_ready)
Test zwave rename_node service.
Test zwave rename_node service.
async def test_rename_node(hass, mock_openzwave, zwave_setup_ready): """Test zwave rename_node service.""" zwave_network = hass.data[DATA_NETWORK] zwave_network.nodes = {11: MagicMock()} await hass.services.async_call( "zwave", "rename_node", {const.ATTR_NODE_ID: 11, ATTR_NAME: ...
[ "async", "def", "test_rename_node", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "zwave_network", ".", "nodes", "=", "{", "11", ":", "MagicMock", "(", ")", "}", ...
[ 1350, 0 ]
[ 1362, 54 ]
python
da
['pl', 'da', 'sw']
False
test_rename_value
(hass, mock_openzwave, zwave_setup_ready)
Test zwave rename_value service.
Test zwave rename_value service.
async def test_rename_value(hass, mock_openzwave, zwave_setup_ready): """Test zwave rename_value service.""" zwave_network = hass.data[DATA_NETWORK] node = MockNode(node_id=14) value = MockValue(index=12, value_id=123456, label="Old Label") node.values = {123456: value} zwave_network.nodes = {1...
[ "async", "def", "test_rename_value", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "node", "=", "MockNode", "(", "node_id", "=", "14", ")", "value", "=", "MockValu...
[ 1365, 0 ]
[ 1386, 37 ]
python
da
['pl', 'da', 'en']
False
test_set_poll_intensity_enable
(hass, mock_openzwave, zwave_setup_ready)
Test zwave set_poll_intensity service, successful set.
Test zwave set_poll_intensity service, successful set.
async def test_set_poll_intensity_enable(hass, mock_openzwave, zwave_setup_ready): """Test zwave set_poll_intensity service, successful set.""" zwave_network = hass.data[DATA_NETWORK] node = MockNode(node_id=14) value = MockValue(index=12, value_id=123456, poll_intensity=0) node.values = {123456: v...
[ "async", "def", "test_set_poll_intensity_enable", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "node", "=", "MockNode", "(", "node_id", "=", "14", ")", "value", "="...
[ 1389, 0 ]
[ 1413, 47 ]
python
de
['pl', 'de', 'en']
False
test_set_poll_intensity_enable_failed
( hass, mock_openzwave, zwave_setup_ready )
Test zwave set_poll_intensity service, failed set.
Test zwave set_poll_intensity service, failed set.
async def test_set_poll_intensity_enable_failed( hass, mock_openzwave, zwave_setup_ready ): """Test zwave set_poll_intensity service, failed set.""" zwave_network = hass.data[DATA_NETWORK] node = MockNode(node_id=14) value = MockValue(index=12, value_id=123456, poll_intensity=0) value.enable_po...
[ "async", "def", "test_set_poll_intensity_enable_failed", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "node", "=", "MockNode", "(", "node_id", "=", "14", ")", "value"...
[ 1416, 0 ]
[ 1442, 43 ]
python
en
['en', 'lb', 'en']
True
test_set_poll_intensity_disable
(hass, mock_openzwave, zwave_setup_ready)
Test zwave set_poll_intensity service, successful disable.
Test zwave set_poll_intensity service, successful disable.
async def test_set_poll_intensity_disable(hass, mock_openzwave, zwave_setup_ready): """Test zwave set_poll_intensity service, successful disable.""" zwave_network = hass.data[DATA_NETWORK] node = MockNode(node_id=14) value = MockValue(index=12, value_id=123456, poll_intensity=4) node.values = {1234...
[ "async", "def", "test_set_poll_intensity_disable", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "node", "=", "MockNode", "(", "node_id", "=", "14", ")", "value", "=...
[ 1445, 0 ]
[ 1468, 44 ]
python
en
['en', 'en', 'en']
True
test_set_poll_intensity_disable_failed
( hass, mock_openzwave, zwave_setup_ready )
Test zwave set_poll_intensity service, failed disable.
Test zwave set_poll_intensity service, failed disable.
async def test_set_poll_intensity_disable_failed( hass, mock_openzwave, zwave_setup_ready ): """Test zwave set_poll_intensity service, failed disable.""" zwave_network = hass.data[DATA_NETWORK] node = MockNode(node_id=14) value = MockValue(index=12, value_id=123456, poll_intensity=4) value.disa...
[ "async", "def", "test_set_poll_intensity_disable_failed", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "node", "=", "MockNode", "(", "node_id", "=", "14", ")", "value...
[ 1471, 0 ]
[ 1497, 44 ]
python
en
['en', 'en', 'en']
True
test_remove_failed_node
(hass, mock_openzwave, zwave_setup_ready)
Test zwave remove_failed_node service.
Test zwave remove_failed_node service.
async def test_remove_failed_node(hass, mock_openzwave, zwave_setup_ready): """Test zwave remove_failed_node service.""" zwave_network = hass.data[DATA_NETWORK] await hass.services.async_call( "zwave", "remove_failed_node", {const.ATTR_NODE_ID: 12} ) await hass.async_block_till_done() ...
[ "async", "def", "test_remove_failed_node", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "await", "hass", ".", "services", ".", "async_call", "(", "\"zwave\"", ",", ...
[ 1500, 0 ]
[ 1512, 55 ]
python
de
['de', 'fr', 'en']
False
test_replace_failed_node
(hass, mock_openzwave, zwave_setup_ready)
Test zwave replace_failed_node service.
Test zwave replace_failed_node service.
async def test_replace_failed_node(hass, mock_openzwave, zwave_setup_ready): """Test zwave replace_failed_node service.""" zwave_network = hass.data[DATA_NETWORK] await hass.services.async_call( "zwave", "replace_failed_node", {const.ATTR_NODE_ID: 13} ) await hass.async_block_till_done() ...
[ "async", "def", "test_replace_failed_node", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "await", "hass", ".", "services", ".", "async_call", "(", "\"zwave\"", ",", ...
[ 1515, 0 ]
[ 1527, 56 ]
python
en
['de', 'en', 'en']
True
test_set_config_parameter
(hass, mock_openzwave, zwave_setup_ready)
Test zwave set_config_parameter service.
Test zwave set_config_parameter service.
async def test_set_config_parameter(hass, mock_openzwave, zwave_setup_ready): """Test zwave set_config_parameter service.""" zwave_network = hass.data[DATA_NETWORK] value_byte = MockValue( index=12, command_class=const.COMMAND_CLASS_CONFIGURATION, type=const.TYPE_BYTE, ) val...
[ "async", "def", "test_set_config_parameter", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "value_byte", "=", "MockValue", "(", "index", "=", "12", ",", "command_class...
[ 1530, 0 ]
[ 1674, 38 ]
python
da
['de', 'da', 'en']
False
test_print_config_parameter
(hass, mock_openzwave, zwave_setup_ready, caplog)
Test zwave print_config_parameter service.
Test zwave print_config_parameter service.
async def test_print_config_parameter(hass, mock_openzwave, zwave_setup_ready, caplog): """Test zwave print_config_parameter service.""" zwave_network = hass.data[DATA_NETWORK] value1 = MockValue( index=12, command_class=const.COMMAND_CLASS_CONFIGURATION, data=1234 ) value2 = MockValue( ...
[ "async", "def", "test_print_config_parameter", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ",", "caplog", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "value1", "=", "MockValue", "(", "index", "=", "12", ",",...
[ 1677, 0 ]
[ 1700, 64 ]
python
da
['de', 'da', 'en']
False
test_print_node
(hass, mock_openzwave, zwave_setup_ready)
Test zwave print_node_parameter service.
Test zwave print_node_parameter service.
async def test_print_node(hass, mock_openzwave, zwave_setup_ready): """Test zwave print_node_parameter service.""" zwave_network = hass.data[DATA_NETWORK] node = MockNode(node_id=14) zwave_network.nodes = {14: node} with patch.object(zwave, "_LOGGER") as mock_logger: await hass.services.a...
[ "async", "def", "test_print_node", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "node", "=", "MockNode", "(", "node_id", "=", "14", ")", "zwave_network", ".", "no...
[ 1703, 0 ]
[ 1715, 68 ]
python
de
['de', 'lb', 'it']
False
test_set_wakeup
(hass, mock_openzwave, zwave_setup_ready)
Test zwave set_wakeup service.
Test zwave set_wakeup service.
async def test_set_wakeup(hass, mock_openzwave, zwave_setup_ready): """Test zwave set_wakeup service.""" zwave_network = hass.data[DATA_NETWORK] value = MockValue(index=12, command_class=const.COMMAND_CLASS_WAKE_UP) node = MockNode(node_id=14) node.values = {12: value} node.get_values.return_va...
[ "async", "def", "test_set_wakeup", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "value", "=", "MockValue", "(", "index", "=", "12", ",", "command_class", "=", "co...
[ 1718, 0 ]
[ 1741, 27 ]
python
pl
['pl', 'su', 'sw']
False
test_reset_node_meters
(hass, mock_openzwave, zwave_setup_ready)
Test zwave reset_node_meters service.
Test zwave reset_node_meters service.
async def test_reset_node_meters(hass, mock_openzwave, zwave_setup_ready): """Test zwave reset_node_meters service.""" zwave_network = hass.data[DATA_NETWORK] value = MockValue( instance=1, index=8, data=99.5, command_class=const.COMMAND_CLASS_METER ) reset_value = MockValue( instan...
[ "async", "def", "test_reset_node_meters", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "value", "=", "MockValue", "(", "instance", "=", "1", ",", "index", "=", "8...
[ 1744, 0 ]
[ 1779, 43 ]
python
de
['de', 'nl', 'en']
False
test_add_association
(hass, mock_openzwave, zwave_setup_ready)
Test zwave change_association service.
Test zwave change_association service.
async def test_add_association(hass, mock_openzwave, zwave_setup_ready): """Test zwave change_association service.""" zwave_network = hass.data[DATA_NETWORK] ZWaveGroup = mock_openzwave.group.ZWaveGroup group = MagicMock() ZWaveGroup.return_value = group value = MockValue(index=12, command_cla...
[ "async", "def", "test_add_association", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "ZWaveGroup", "=", "mock_openzwave", ".", "group", ".", "ZWaveGroup", "group", "=...
[ 1782, 0 ]
[ 1816, 57 ]
python
de
['pl', 'de', 'en']
False
test_remove_association
(hass, mock_openzwave, zwave_setup_ready)
Test zwave change_association service.
Test zwave change_association service.
async def test_remove_association(hass, mock_openzwave, zwave_setup_ready): """Test zwave change_association service.""" zwave_network = hass.data[DATA_NETWORK] ZWaveGroup = mock_openzwave.group.ZWaveGroup group = MagicMock() ZWaveGroup.return_value = group value = MockValue(index=12, command_...
[ "async", "def", "test_remove_association", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "ZWaveGroup", "=", "mock_openzwave", ".", "group", ".", "ZWaveGroup", "group", ...
[ 1819, 0 ]
[ 1853, 60 ]
python
de
['pl', 'de', 'en']
False
test_refresh_entity
(hass, mock_openzwave, zwave_setup_ready)
Test zwave refresh_entity service.
Test zwave refresh_entity service.
async def test_refresh_entity(hass, mock_openzwave, zwave_setup_ready): """Test zwave refresh_entity service.""" node = MockNode() value = MockValue( data=False, node=node, command_class=const.COMMAND_CLASS_SENSOR_BINARY ) power_value = MockValue(data=50, node=node, command_class=const.COMMA...
[ "async", "def", "test_refresh_entity", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "node", "=", "MockNode", "(", ")", "value", "=", "MockValue", "(", "data", "=", "False", ",", "node", "=", "node", ",", "command_class", "=", "co...
[ 1856, 0 ]
[ 1885, 5 ]
python
de
['pl', 'de', 'en']
False
test_refresh_node
(hass, mock_openzwave, zwave_setup_ready)
Test zwave refresh_node service.
Test zwave refresh_node service.
async def test_refresh_node(hass, mock_openzwave, zwave_setup_ready): """Test zwave refresh_node service.""" zwave_network = hass.data[DATA_NETWORK] node = MockNode(node_id=14) zwave_network.nodes = {14: node} await hass.services.async_call("zwave", "refresh_node", {const.ATTR_NODE_ID: 14}) awa...
[ "async", "def", "test_refresh_node", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "node", "=", "MockNode", "(", "node_id", "=", "14", ")", "zwave_network", ".", "...
[ 1888, 0 ]
[ 1898, 49 ]
python
de
['pl', 'de', 'it']
False
test_set_node_value
(hass, mock_openzwave, zwave_setup_ready)
Test zwave set_node_value service.
Test zwave set_node_value service.
async def test_set_node_value(hass, mock_openzwave, zwave_setup_ready): """Test zwave set_node_value service.""" zwave_network = hass.data[DATA_NETWORK] value = MockValue(index=12, command_class=const.COMMAND_CLASS_INDICATOR, data=4) node = MockNode(node_id=14, command_classes=[const.COMMAND_CLASS_INDI...
[ "async", "def", "test_set_node_value", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "value", "=", "MockValue", "(", "index", "=", "12", ",", "command_class", "=", ...
[ 1901, 0 ]
[ 1922, 55 ]
python
da
['de', 'da', 'en']
False
test_set_node_value_with_long_id_and_text_value
( hass, mock_openzwave, zwave_setup_ready )
Test zwave set_node_value service.
Test zwave set_node_value service.
async def test_set_node_value_with_long_id_and_text_value( hass, mock_openzwave, zwave_setup_ready ): """Test zwave set_node_value service.""" zwave_network = hass.data[DATA_NETWORK] value = MockValue( index=87512398541236578, command_class=const.COMMAND_CLASS_SWITCH_COLOR, data...
[ "async", "def", "test_set_node_value_with_long_id_and_text_value", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "value", "=", "MockValue", "(", "index", "=", "87512398541...
[ 1925, 0 ]
[ 1952, 78 ]
python
da
['de', 'da', 'en']
False
test_refresh_node_value
(hass, mock_openzwave, zwave_setup_ready)
Test zwave refresh_node_value service.
Test zwave refresh_node_value service.
async def test_refresh_node_value(hass, mock_openzwave, zwave_setup_ready): """Test zwave refresh_node_value service.""" zwave_network = hass.data[DATA_NETWORK] node = MockNode( node_id=14, command_classes=[const.COMMAND_CLASS_INDICATOR], network=zwave_network, ) value = Moc...
[ "async", "def", "test_refresh_node_value", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "node", "=", "MockNode", "(", "node_id", "=", "14", ",", "command_classes", ...
[ 1955, 0 ]
[ 1980, 31 ]
python
de
['pl', 'de', 'it']
False
test_heal_node
(hass, mock_openzwave, zwave_setup_ready)
Test zwave heal_node service.
Test zwave heal_node service.
async def test_heal_node(hass, mock_openzwave, zwave_setup_ready): """Test zwave heal_node service.""" zwave_network = hass.data[DATA_NETWORK] node = MockNode(node_id=19) zwave_network.nodes = {19: node} await hass.services.async_call("zwave", "heal_node", {const.ATTR_NODE_ID: 19}) await hass.a...
[ "async", "def", "test_heal_node", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "node", "=", "MockNode", "(", "node_id", "=", "19", ")", "zwave_network", ".", "nod...
[ 1983, 0 ]
[ 1993, 41 ]
python
de
['pl', 'de', 'sw']
False
test_test_node
(hass, mock_openzwave, zwave_setup_ready)
Test the zwave test_node service.
Test the zwave test_node service.
async def test_test_node(hass, mock_openzwave, zwave_setup_ready): """Test the zwave test_node service.""" zwave_network = hass.data[DATA_NETWORK] node = MockNode(node_id=19) zwave_network.nodes = {19: node} await hass.services.async_call("zwave", "test_node", {const.ATTR_NODE_ID: 19}) await ha...
[ "async", "def", "test_test_node", "(", "hass", ",", "mock_openzwave", ",", "zwave_setup_ready", ")", ":", "zwave_network", "=", "hass", ".", "data", "[", "DATA_NETWORK", "]", "node", "=", "MockNode", "(", "node_id", "=", "19", ")", "zwave_network", ".", "nod...
[ 1996, 0 ]
[ 2006, 41 ]
python
en
['en', 'de', 'en']
True
buildmodule
(m, um)
Return
Return
def buildmodule(m, um): """ Return """ outmess('\tBuilding module "%s"...\n' % (m['name'])) ret = {} mod_rules = defmod_rules[:] vrd = capi_maps.modsign2map(m) rd = dictappend({'f2py_version': f2py_version}, vrd) funcwrappers = [] funcwrappers2 = [] # F90 codes for n in m['i...
[ "def", "buildmodule", "(", "m", ",", "um", ")", ":", "outmess", "(", "'\\tBuilding module \"%s\"...\\n'", "%", "(", "m", "[", "'name'", "]", ")", ")", "ret", "=", "{", "}", "mod_rules", "=", "defmod_rules", "[", ":", "]", "vrd", "=", "capi_maps", ".", ...
[ 1155, 0 ]
[ 1328, 14 ]
python
en
['en', 'error', 'th']
False
setup_platform
(hass, config, add_entities, discovery_info=None)
Set up the XS1 sensor platform.
Set up the XS1 sensor platform.
def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the XS1 sensor platform.""" sensors = hass.data[COMPONENT_DOMAIN][SENSORS] actuators = hass.data[COMPONENT_DOMAIN][ACTUATORS] sensor_entities = [] for sensor in sensors: belongs_to_climate_actuator = False ...
[ "def", "setup_platform", "(", "hass", ",", "config", ",", "add_entities", ",", "discovery_info", "=", "None", ")", ":", "sensors", "=", "hass", ".", "data", "[", "COMPONENT_DOMAIN", "]", "[", "SENSORS", "]", "actuators", "=", "hass", ".", "data", "[", "C...
[ 8, 0 ]
[ 27, 33 ]
python
en
['en', 'su', 'en']
True
XS1Sensor.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.device.name()
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "device", ".", "name", "(", ")" ]
[ 34, 4 ]
[ 36, 33 ]
python
en
['en', 'mi', 'en']
True
XS1Sensor.native_value
(self)
Return the state of the sensor.
Return the state of the sensor.
def native_value(self): """Return the state of the sensor.""" return self.device.value()
[ "def", "native_value", "(", "self", ")", ":", "return", "self", ".", "device", ".", "value", "(", ")" ]
[ 39, 4 ]
[ 41, 34 ]
python
en
['en', 'en', 'en']
True
XS1Sensor.native_unit_of_measurement
(self)
Return the unit of measurement.
Return the unit of measurement.
def native_unit_of_measurement(self): """Return the unit of measurement.""" return self.device.unit()
[ "def", "native_unit_of_measurement", "(", "self", ")", ":", "return", "self", ".", "device", ".", "unit", "(", ")" ]
[ 44, 4 ]
[ 46, 33 ]
python
en
['en', 'la', 'en']
True
call_from_config
( hass: HomeAssistant, config: ConfigType, blocking: bool = False, variables: TemplateVarsType = None, validate_config: bool = True, )
Call a service based on a config hash.
Call a service based on a config hash.
def call_from_config( hass: HomeAssistant, config: ConfigType, blocking: bool = False, variables: TemplateVarsType = None, validate_config: bool = True, ) -> None: """Call a service based on a config hash.""" asyncio.run_coroutine_threadsafe( async_call_from_config(hass, config, bloc...
[ "def", "call_from_config", "(", "hass", ":", "HomeAssistant", ",", "config", ":", "ConfigType", ",", "blocking", ":", "bool", "=", "False", ",", "variables", ":", "TemplateVarsType", "=", "None", ",", "validate_config", ":", "bool", "=", "True", ",", ")", ...
[ 131, 0 ]
[ 142, 14 ]
python
en
['en', 'en', 'en']
True
async_call_from_config
( hass: HomeAssistant, config: ConfigType, blocking: bool = False, variables: TemplateVarsType = None, validate_config: bool = True, context: Context | None = None, )
Call a service based on a config hash.
Call a service based on a config hash.
async def async_call_from_config( hass: HomeAssistant, config: ConfigType, blocking: bool = False, variables: TemplateVarsType = None, validate_config: bool = True, context: Context | None = None, ) -> None: """Call a service based on a config hash.""" try: params = async_prepare...
[ "async", "def", "async_call_from_config", "(", "hass", ":", "HomeAssistant", ",", "config", ":", "ConfigType", ",", "blocking", ":", "bool", "=", "False", ",", "variables", ":", "TemplateVarsType", "=", "None", ",", "validate_config", ":", "bool", "=", "True",...
[ 146, 0 ]
[ 164, 84 ]
python
en
['en', 'en', 'en']
True
async_prepare_call_from_config
( hass: HomeAssistant, config: ConfigType, variables: TemplateVarsType = None, validate_config: bool = False, )
Prepare to call a service based on a config hash.
Prepare to call a service based on a config hash.
def async_prepare_call_from_config( hass: HomeAssistant, config: ConfigType, variables: TemplateVarsType = None, validate_config: bool = False, ) -> ServiceParams: """Prepare to call a service based on a config hash.""" if validate_config: try: config = cv.SERVICE_SCHEMA(conf...
[ "def", "async_prepare_call_from_config", "(", "hass", ":", "HomeAssistant", ",", "config", ":", "ConfigType", ",", "variables", ":", "TemplateVarsType", "=", "None", ",", "validate_config", ":", "bool", "=", "False", ",", ")", "->", "ServiceParams", ":", "if", ...
[ 169, 0 ]
[ 249, 5 ]
python
en
['en', 'en', 'en']
True
extract_entity_ids
( hass: HomeAssistant, service_call: ServiceCall, expand_group: bool = True )
Extract a list of entity ids from a service call. Will convert group entity ids to the entity ids it represents.
Extract a list of entity ids from a service call.
def extract_entity_ids( hass: HomeAssistant, service_call: ServiceCall, expand_group: bool = True ) -> set[str]: """Extract a list of entity ids from a service call. Will convert group entity ids to the entity ids it represents. """ return asyncio.run_coroutine_threadsafe( async_extract_ent...
[ "def", "extract_entity_ids", "(", "hass", ":", "HomeAssistant", ",", "service_call", ":", "ServiceCall", ",", "expand_group", ":", "bool", "=", "True", ")", "->", "set", "[", "str", "]", ":", "return", "asyncio", ".", "run_coroutine_threadsafe", "(", "async_ex...
[ 253, 0 ]
[ 262, 14 ]
python
en
['en', 'en', 'en']
True
async_extract_entities
( hass: HomeAssistant, entities: Iterable[Entity], service_call: ServiceCall, expand_group: bool = True, )
Extract a list of entity objects from a service call. Will convert group entity ids to the entity ids it represents.
Extract a list of entity objects from a service call.
async def async_extract_entities( hass: HomeAssistant, entities: Iterable[Entity], service_call: ServiceCall, expand_group: bool = True, ) -> list[Entity]: """Extract a list of entity objects from a service call. Will convert group entity ids to the entity ids it represents. """ data_en...
[ "async", "def", "async_extract_entities", "(", "hass", ":", "HomeAssistant", ",", "entities", ":", "Iterable", "[", "Entity", "]", ",", "service_call", ":", "ServiceCall", ",", "expand_group", ":", "bool", "=", "True", ",", ")", "->", "list", "[", "Entity", ...
[ 266, 0 ]
[ 301, 16 ]
python
en
['en', 'en', 'en']
True
async_extract_entity_ids
( hass: HomeAssistant, service_call: ServiceCall, expand_group: bool = True )
Extract a set of entity ids from a service call. Will convert group entity ids to the entity ids it represents.
Extract a set of entity ids from a service call.
async def async_extract_entity_ids( hass: HomeAssistant, service_call: ServiceCall, expand_group: bool = True ) -> set[str]: """Extract a set of entity ids from a service call. Will convert group entity ids to the entity ids it represents. """ referenced = await async_extract_referenced_entity_ids(...
[ "async", "def", "async_extract_entity_ids", "(", "hass", ":", "HomeAssistant", ",", "service_call", ":", "ServiceCall", ",", "expand_group", ":", "bool", "=", "True", ")", "->", "set", "[", "str", "]", ":", "referenced", "=", "await", "async_extract_referenced_e...
[ 305, 0 ]
[ 315, 67 ]
python
en
['en', 'en', 'en']
True
_has_match
(ids: str | list | None)
Check if ids can match anything.
Check if ids can match anything.
def _has_match(ids: str | list | None) -> bool: """Check if ids can match anything.""" return ids not in (None, ENTITY_MATCH_NONE)
[ "def", "_has_match", "(", "ids", ":", "str", "|", "list", "|", "None", ")", "->", "bool", ":", "return", "ids", "not", "in", "(", "None", ",", "ENTITY_MATCH_NONE", ")" ]
[ 318, 0 ]
[ 320, 47 ]
python
en
['en', 'en', 'en']
True