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
GitLabSensor.__init__
(self, gitlab_data, name)
Initialize the GitLab sensor.
Initialize the GitLab sensor.
def __init__(self, gitlab_data, name): """Initialize the GitLab sensor.""" self._available = False self._state = None self._started_at = None self._finished_at = None self._duration = None self._commit_id = None self._commit_date = None self._build...
[ "def", "__init__", "(", "self", ",", "gitlab_data", ",", "name", ")", ":", "self", ".", "_available", "=", "False", "self", ".", "_state", "=", "None", "self", ".", "_started_at", "=", "None", "self", ".", "_finished_at", "=", "None", "self", ".", "_du...
[ 70, 4 ]
[ 82, 25 ]
python
en
['en', 'pt', 'en']
True
GitLabSensor.name
(self)
Return the name of the sensor.
Return the name of the sensor.
def name(self): """Return the name of the sensor.""" return self._name
[ "def", "name", "(", "self", ")", ":", "return", "self", ".", "_name" ]
[ 85, 4 ]
[ 87, 25 ]
python
en
['en', 'mi', 'en']
True
GitLabSensor.native_value
(self)
Return the state of the sensor.
Return the state of the sensor.
def native_value(self): """Return the state of the sensor.""" return self._state
[ "def", "native_value", "(", "self", ")", ":", "return", "self", ".", "_state" ]
[ 90, 4 ]
[ 92, 26 ]
python
en
['en', 'en', 'en']
True
GitLabSensor.available
(self)
Return True if entity is available.
Return True if entity is available.
def available(self): """Return True if entity is available.""" return self._available
[ "def", "available", "(", "self", ")", ":", "return", "self", ".", "_available" ]
[ 95, 4 ]
[ 97, 30 ]
python
en
['en', 'en', 'en']
True
GitLabSensor.extra_state_attributes
(self)
Return the state attributes.
Return the state attributes.
def extra_state_attributes(self): """Return the state attributes.""" return { ATTR_ATTRIBUTION: ATTRIBUTION, ATTR_BUILD_STATUS: self._state, ATTR_BUILD_STARTED: self._started_at, ATTR_BUILD_FINISHED: self._finished_at, ATTR_BUILD_DURATION: self...
[ "def", "extra_state_attributes", "(", "self", ")", ":", "return", "{", "ATTR_ATTRIBUTION", ":", "ATTRIBUTION", ",", "ATTR_BUILD_STATUS", ":", "self", ".", "_state", ",", "ATTR_BUILD_STARTED", ":", "self", ".", "_started_at", ",", "ATTR_BUILD_FINISHED", ":", "self"...
[ 100, 4 ]
[ 112, 9 ]
python
en
['en', 'en', 'en']
True
GitLabSensor.icon
(self)
Return the icon to use in the frontend.
Return the icon to use in the frontend.
def icon(self): """Return the icon to use in the frontend.""" if self._state == "success": return ICON_HAPPY if self._state == "failed": return ICON_SAD return ICON_OTHER
[ "def", "icon", "(", "self", ")", ":", "if", "self", ".", "_state", "==", "\"success\"", ":", "return", "ICON_HAPPY", "if", "self", ".", "_state", "==", "\"failed\"", ":", "return", "ICON_SAD", "return", "ICON_OTHER" ]
[ 115, 4 ]
[ 121, 25 ]
python
en
['en', 'en', 'en']
True
GitLabSensor.update
(self)
Collect updated data from GitLab API.
Collect updated data from GitLab API.
def update(self): """Collect updated data from GitLab API.""" self._gitlab_data.update() self._state = self._gitlab_data.status self._started_at = self._gitlab_data.started_at self._finished_at = self._gitlab_data.finished_at self._duration = self._gitlab_data.duration ...
[ "def", "update", "(", "self", ")", ":", "self", ".", "_gitlab_data", ".", "update", "(", ")", "self", ".", "_state", "=", "self", ".", "_gitlab_data", ".", "status", "self", ".", "_started_at", "=", "self", ".", "_gitlab_data", ".", "started_at", "self",...
[ 123, 4 ]
[ 135, 53 ]
python
en
['en', 'en', 'en']
True
GitLabData.__init__
(self, gitlab_id, priv_token, interval, url)
Fetch data from GitLab API for most recent CI job.
Fetch data from GitLab API for most recent CI job.
def __init__(self, gitlab_id, priv_token, interval, url): """Fetch data from GitLab API for most recent CI job.""" self._gitlab_id = gitlab_id self._gitlab = Gitlab(url, private_token=priv_token, per_page=1) self._gitlab.auth() self.update = Throttle(interval)(self._update) ...
[ "def", "__init__", "(", "self", ",", "gitlab_id", ",", "priv_token", ",", "interval", ",", "url", ")", ":", "self", ".", "_gitlab_id", "=", "gitlab_id", "self", ".", "_gitlab", "=", "Gitlab", "(", "url", ",", "private_token", "=", "priv_token", ",", "per...
[ 141, 4 ]
[ 157, 26 ]
python
en
['en', 'en', 'en']
True
Whale.openapi_types
()
This must be a method because a model may have properties that are of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type.
This must be a method because a model may have properties that are of type self, this must run after the class is loaded
def openapi_types(): """ This must be a method because a model may have properties that are of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ retu...
[ "def", "openapi_types", "(", ")", ":", "return", "{", "'class_name'", ":", "(", "str", ",", ")", ",", "# noqa: E501", "'has_baleen'", ":", "(", "bool", ",", ")", ",", "# noqa: E501", "'has_teeth'", ":", "(", "bool", ",", ")", ",", "# noqa: E501", "}" ]
[ 64, 4 ]
[ 77, 9 ]
python
en
['en', 'error', 'th']
False
Whale.__init__
(self, class_name, *args, **kwargs)
Whale - a model defined in OpenAPI Args: class_name (str): Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is ...
Whale - a model defined in OpenAPI
def __init__(self, class_name, *args, **kwargs): # noqa: E501 """Whale - a model defined in OpenAPI Args: class_name (str): Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a Type...
[ "def", "__init__", "(", "self", ",", "class_name", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# noqa: E501", "_check_type", "=", "kwargs", ".", "pop", "(", "'_check_type'", ",", "True", ")", "_spec_property_naming", "=", "kwargs", ".", "pop", ...
[ 102, 4 ]
[ 174, 46 ]
python
en
['en', 'en', 'en']
True
async_setup_entry
( hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback, )
Set up Verisure alarm control panel from a config entry.
Set up Verisure alarm control panel from a config entry.
async def async_setup_entry( hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback, ) -> None: """Set up Verisure alarm control panel from a config entry.""" coordinator: VerisureDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id] platform = async_get_current_pl...
[ "async", "def", "async_setup_entry", "(", "hass", ":", "HomeAssistant", ",", "entry", ":", "ConfigEntry", ",", "async_add_entities", ":", "AddEntitiesCallback", ",", ")", "->", "None", ":", "coordinator", ":", "VerisureDataUpdateCoordinator", "=", "hass", ".", "da...
[ 31, 0 ]
[ 54, 5 ]
python
en
['en', 'en', 'en']
True
VerisureDoorlock.__init__
( self, coordinator: VerisureDataUpdateCoordinator, serial_number: str )
Initialize the Verisure lock.
Initialize the Verisure lock.
def __init__( self, coordinator: VerisureDataUpdateCoordinator, serial_number: str ) -> None: """Initialize the Verisure lock.""" super().__init__(coordinator) self._attr_name = coordinator.data["locks"][serial_number]["area"] self._attr_unique_id = serial_number se...
[ "def", "__init__", "(", "self", ",", "coordinator", ":", "VerisureDataUpdateCoordinator", ",", "serial_number", ":", "str", ")", "->", "None", ":", "super", "(", ")", ".", "__init__", "(", "coordinator", ")", "self", ".", "_attr_name", "=", "coordinator", "....
[ 62, 4 ]
[ 75, 9 ]
python
en
['en', 'co', 'en']
True
VerisureDoorlock.device_info
(self)
Return device information about this entity.
Return device information about this entity.
def device_info(self) -> DeviceInfo: """Return device information about this entity.""" area = self.coordinator.data["locks"][self.serial_number]["area"] return { "name": area, "suggested_area": area, "manufacturer": "Verisure", "model": "Lockguard...
[ "def", "device_info", "(", "self", ")", "->", "DeviceInfo", ":", "area", "=", "self", ".", "coordinator", ".", "data", "[", "\"locks\"", "]", "[", "self", ".", "serial_number", "]", "[", "\"area\"", "]", "return", "{", "\"name\"", ":", "area", ",", "\"...
[ 78, 4 ]
[ 88, 9 ]
python
en
['en', 'en', 'en']
True
VerisureDoorlock.available
(self)
Return True if entity is available.
Return True if entity is available.
def available(self) -> bool: """Return True if entity is available.""" return ( super().available and self.serial_number in self.coordinator.data["locks"] )
[ "def", "available", "(", "self", ")", "->", "bool", ":", "return", "(", "super", "(", ")", ".", "available", "and", "self", ".", "serial_number", "in", "self", ".", "coordinator", ".", "data", "[", "\"locks\"", "]", ")" ]
[ 91, 4 ]
[ 95, 9 ]
python
en
['en', 'en', 'en']
True
VerisureDoorlock.changed_by
(self)
Last change triggered by.
Last change triggered by.
def changed_by(self) -> str | None: """Last change triggered by.""" return self.coordinator.data["locks"][self.serial_number].get("userString")
[ "def", "changed_by", "(", "self", ")", "->", "str", "|", "None", ":", "return", "self", ".", "coordinator", ".", "data", "[", "\"locks\"", "]", "[", "self", ".", "serial_number", "]", ".", "get", "(", "\"userString\"", ")" ]
[ 98, 4 ]
[ 100, 83 ]
python
en
['en', 'en', 'en']
True
VerisureDoorlock.code_format
(self)
Return the required six digit code.
Return the required six digit code.
def code_format(self) -> str: """Return the required six digit code.""" return "^\\d{%s}$" % self._digits
[ "def", "code_format", "(", "self", ")", "->", "str", ":", "return", "\"^\\\\d{%s}$\"", "%", "self", ".", "_digits" ]
[ 103, 4 ]
[ 105, 41 ]
python
en
['en', 'en', 'en']
True
VerisureDoorlock.is_locked
(self)
Return true if lock is locked.
Return true if lock is locked.
def is_locked(self) -> bool: """Return true if lock is locked.""" return ( self.coordinator.data["locks"][self.serial_number]["lockedState"] == "LOCKED" )
[ "def", "is_locked", "(", "self", ")", "->", "bool", ":", "return", "(", "self", ".", "coordinator", ".", "data", "[", "\"locks\"", "]", "[", "self", ".", "serial_number", "]", "[", "\"lockedState\"", "]", "==", "\"LOCKED\"", ")" ]
[ 108, 4 ]
[ 113, 9 ]
python
en
['en', 'mt', 'en']
True
VerisureDoorlock.async_unlock
(self, **kwargs)
Send unlock command.
Send unlock command.
async def async_unlock(self, **kwargs) -> None: """Send unlock command.""" code = kwargs.get( ATTR_CODE, self.coordinator.entry.options.get(CONF_LOCK_DEFAULT_CODE) ) if code is None: LOGGER.error("Code required but none provided") return await...
[ "async", "def", "async_unlock", "(", "self", ",", "*", "*", "kwargs", ")", "->", "None", ":", "code", "=", "kwargs", ".", "get", "(", "ATTR_CODE", ",", "self", ".", "coordinator", ".", "entry", ".", "options", ".", "get", "(", "CONF_LOCK_DEFAULT_CODE", ...
[ 115, 4 ]
[ 124, 61 ]
python
en
['en', 'zh', 'en']
True
VerisureDoorlock.async_lock
(self, **kwargs)
Send lock command.
Send lock command.
async def async_lock(self, **kwargs) -> None: """Send lock command.""" code = kwargs.get( ATTR_CODE, self.coordinator.entry.options.get(CONF_LOCK_DEFAULT_CODE) ) if code is None: LOGGER.error("Code required but none provided") return await sel...
[ "async", "def", "async_lock", "(", "self", ",", "*", "*", "kwargs", ")", "->", "None", ":", "code", "=", "kwargs", ".", "get", "(", "ATTR_CODE", ",", "self", ".", "coordinator", ".", "entry", ".", "options", ".", "get", "(", "CONF_LOCK_DEFAULT_CODE", "...
[ 126, 4 ]
[ 135, 59 ]
python
en
['en', 'zh', 'en']
True
VerisureDoorlock.async_set_lock_state
(self, code: str, state: str)
Send set lock state command.
Send set lock state command.
async def async_set_lock_state(self, code: str, state: str) -> None: """Send set lock state command.""" target_state = "lock" if state == STATE_LOCKED else "unlock" lock_state = await self.hass.async_add_executor_job( self.coordinator.verisure.set_lock_state, code, ...
[ "async", "def", "async_set_lock_state", "(", "self", ",", "code", ":", "str", ",", "state", ":", "str", ")", "->", "None", ":", "target_state", "=", "\"lock\"", "if", "state", "==", "STATE_LOCKED", "else", "\"unlock\"", "lock_state", "=", "await", "self", ...
[ 137, 4 ]
[ 161, 31 ]
python
en
['en', 'en', 'en']
True
VerisureDoorlock.disable_autolock
(self)
Disable autolock on a doorlock.
Disable autolock on a doorlock.
def disable_autolock(self) -> None: """Disable autolock on a doorlock.""" try: self.coordinator.verisure.set_lock_config( self.serial_number, auto_lock_enabled=False ) LOGGER.debug("Disabling autolock on %s", self.serial_number) except Verisure...
[ "def", "disable_autolock", "(", "self", ")", "->", "None", ":", "try", ":", "self", ".", "coordinator", ".", "verisure", ".", "set_lock_config", "(", "self", ".", "serial_number", ",", "auto_lock_enabled", "=", "False", ")", "LOGGER", ".", "debug", "(", "\...
[ 163, 4 ]
[ 171, 62 ]
python
en
['en', 'fi', 'en']
True
VerisureDoorlock.enable_autolock
(self)
Enable autolock on a doorlock.
Enable autolock on a doorlock.
def enable_autolock(self) -> None: """Enable autolock on a doorlock.""" try: self.coordinator.verisure.set_lock_config( self.serial_number, auto_lock_enabled=True ) LOGGER.debug("Enabling autolock on %s", self.serial_number) except VerisureErro...
[ "def", "enable_autolock", "(", "self", ")", "->", "None", ":", "try", ":", "self", ".", "coordinator", ".", "verisure", ".", "set_lock_config", "(", "self", ".", "serial_number", ",", "auto_lock_enabled", "=", "True", ")", "LOGGER", ".", "debug", "(", "\"E...
[ 173, 4 ]
[ 181, 61 ]
python
en
['en', 'nl', 'en']
True
TestFormatTest.make_instance
(self, include_optional)
Test FormatTest include_option is a boolean, when False only required params are included, when True both required and optional params are included
Test FormatTest include_option is a boolean, when False only required params are included, when True both required and optional params are included
def make_instance(self, include_optional): """Test FormatTest include_option is a boolean, when False only required params are included, when True both required and optional params are included """ # model = petstore_api.models.format_test.FormatTest() # noqa: E501 ...
[ "def", "make_instance", "(", "self", ",", "include_optional", ")", ":", "# model = petstore_api.models.format_test.FormatTest() # noqa: E501", "if", "include_optional", ":", "return", "FormatTest", "(", "integer", "=", "1E+1", ",", "int32", "=", "2E+1", ",", "int64", ...
[ 30, 4 ]
[ 59, 9 ]
python
en
['en', 'de', 'en']
False
TestFormatTest.testFormatTest
(self)
Test FormatTest
Test FormatTest
def testFormatTest(self): """Test FormatTest""" inst_req_only = self.make_instance(include_optional=False) inst_req_and_optional = self.make_instance(include_optional=True)
[ "def", "testFormatTest", "(", "self", ")", ":", "inst_req_only", "=", "self", ".", "make_instance", "(", "include_optional", "=", "False", ")", "inst_req_and_optional", "=", "self", ".", "make_instance", "(", "include_optional", "=", "True", ")" ]
[ 61, 4 ]
[ 64, 73 ]
python
en
['en', 'de', 'en']
False
test_proxy_request
(init, session)
If proxy authentication is enabled, the failing hacky request is issued with correct timeout set.
If proxy authentication is enabled, the failing hacky request is issued with correct timeout set.
def test_proxy_request(init, session): """ If proxy authentication is enabled, the failing hacky request is issued with correct timeout set. """ config = Mock() # The constructor is bypassed, because it itself runs the _init_session method. connection = InsightsConnection(None) connection.c...
[ "def", "test_proxy_request", "(", "init", ",", "session", ")", ":", "config", "=", "Mock", "(", ")", "# The constructor is bypassed, because it itself runs the _init_session method.", "connection", "=", "InsightsConnection", "(", "None", ")", "connection", ".", "config", ...
[ 6, 0 ]
[ 30, 5 ]
python
en
['en', 'error', 'th']
False
test_request_sync_service
(aioclient_mock, hass)
Test that it posts to the request_sync url.
Test that it posts to the request_sync url.
async def test_request_sync_service(aioclient_mock, hass): """Test that it posts to the request_sync url.""" aioclient_mock.post( ga.const.HOMEGRAPH_TOKEN_URL, status=200, json={"access_token": "1234", "expires_in": 3600}, ) aioclient_mock.post(ga.const.REQUEST_SYNC_BASE_URL, st...
[ "async", "def", "test_request_sync_service", "(", "aioclient_mock", ",", "hass", ")", ":", "aioclient_mock", ".", "post", "(", "ga", ".", "const", ".", "HOMEGRAPH_TOKEN_URL", ",", "status", "=", "200", ",", "json", "=", "{", "\"access_token\"", ":", "\"1234\""...
[ 8, 0 ]
[ 32, 41 ]
python
en
['en', 'en', 'en']
True
is_on
(hass: HomeAssistant, entity_id: str)
Return if the remote is on based on the statemachine.
Return if the remote is on based on the statemachine.
def is_on(hass: HomeAssistant, entity_id: str) -> bool: """Return if the remote is on based on the statemachine.""" return hass.states.is_state(entity_id, STATE_ON)
[ "def", "is_on", "(", "hass", ":", "HomeAssistant", ",", "entity_id", ":", "str", ")", "->", "bool", ":", "return", "hass", ".", "states", ".", "is_state", "(", "entity_id", ",", "STATE_ON", ")" ]
[ 73, 0 ]
[ 75, 52 ]
python
en
['en', 'en', 'en']
True
async_setup
(hass: HomeAssistant, config: ConfigType)
Track states and offer events for remotes.
Track states and offer events for remotes.
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Track states and offer events for remotes.""" component = hass.data[DOMAIN] = EntityComponent( _LOGGER, DOMAIN, hass, SCAN_INTERVAL ) await component.async_setup(config) component.async_register_entity_service( ...
[ "async", "def", "async_setup", "(", "hass", ":", "HomeAssistant", ",", "config", ":", "ConfigType", ")", "->", "bool", ":", "component", "=", "hass", ".", "data", "[", "DOMAIN", "]", "=", "EntityComponent", "(", "_LOGGER", ",", "DOMAIN", ",", "hass", ","...
[ 78, 0 ]
[ 132, 15 ]
python
en
['en', 'en', 'en']
True
async_setup_entry
(hass: HomeAssistant, entry: ConfigEntry)
Set up a config entry.
Set up a config entry.
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up a config entry.""" return await cast(EntityComponent, hass.data[DOMAIN]).async_setup_entry(entry)
[ "async", "def", "async_setup_entry", "(", "hass", ":", "HomeAssistant", ",", "entry", ":", "ConfigEntry", ")", "->", "bool", ":", "return", "await", "cast", "(", "EntityComponent", ",", "hass", ".", "data", "[", "DOMAIN", "]", ")", ".", "async_setup_entry", ...
[ 135, 0 ]
[ 137, 82 ]
python
en
['en', 'en', 'en']
True
async_unload_entry
(hass: HomeAssistant, entry: ConfigEntry)
Unload a config entry.
Unload a config entry.
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Unload a config entry.""" return await cast(EntityComponent, hass.data[DOMAIN]).async_unload_entry(entry)
[ "async", "def", "async_unload_entry", "(", "hass", ":", "HomeAssistant", ",", "entry", ":", "ConfigEntry", ")", "->", "bool", ":", "return", "await", "cast", "(", "EntityComponent", ",", "hass", ".", "data", "[", "DOMAIN", "]", ")", ".", "async_unload_entry"...
[ 140, 0 ]
[ 142, 83 ]
python
en
['en', 'es', 'en']
True
RemoteEntity.supported_features
(self)
Flag supported features.
Flag supported features.
def supported_features(self) -> int: """Flag supported features.""" return self._attr_supported_features
[ "def", "supported_features", "(", "self", ")", "->", "int", ":", "return", "self", ".", "_attr_supported_features" ]
[ 159, 4 ]
[ 161, 44 ]
python
en
['da', 'en', 'en']
True
RemoteEntity.current_activity
(self)
Active activity.
Active activity.
def current_activity(self) -> str | None: """Active activity.""" return self._attr_current_activity
[ "def", "current_activity", "(", "self", ")", "->", "str", "|", "None", ":", "return", "self", ".", "_attr_current_activity" ]
[ 164, 4 ]
[ 166, 42 ]
python
en
['en', 'nl', 'en']
False
RemoteEntity.activity_list
(self)
List of available activities.
List of available activities.
def activity_list(self) -> list[str] | None: """List of available activities.""" return self._attr_activity_list
[ "def", "activity_list", "(", "self", ")", "->", "list", "[", "str", "]", "|", "None", ":", "return", "self", ".", "_attr_activity_list" ]
[ 169, 4 ]
[ 171, 39 ]
python
en
['en', 'en', 'en']
True
RemoteEntity.state_attributes
(self)
Return optional state attributes.
Return optional state attributes.
def state_attributes(self) -> dict[str, Any] | None: """Return optional state attributes.""" if not self.supported_features & SUPPORT_ACTIVITY: return None return { ATTR_ACTIVITY_LIST: self.activity_list, ATTR_CURRENT_ACTIVITY: self.current_activity, ...
[ "def", "state_attributes", "(", "self", ")", "->", "dict", "[", "str", ",", "Any", "]", "|", "None", ":", "if", "not", "self", ".", "supported_features", "&", "SUPPORT_ACTIVITY", ":", "return", "None", "return", "{", "ATTR_ACTIVITY_LIST", ":", "self", ".",...
[ 175, 4 ]
[ 183, 9 ]
python
en
['en', 'en', 'en']
True
RemoteEntity.send_command
(self, command: Iterable[str], **kwargs: Any)
Send commands to a device.
Send commands to a device.
def send_command(self, command: Iterable[str], **kwargs: Any) -> None: """Send commands to a device.""" raise NotImplementedError()
[ "def", "send_command", "(", "self", ",", "command", ":", "Iterable", "[", "str", "]", ",", "*", "*", "kwargs", ":", "Any", ")", "->", "None", ":", "raise", "NotImplementedError", "(", ")" ]
[ 185, 4 ]
[ 187, 35 ]
python
en
['en', 'en', 'en']
True
RemoteEntity.async_send_command
(self, command: Iterable[str], **kwargs: Any)
Send commands to a device.
Send commands to a device.
async def async_send_command(self, command: Iterable[str], **kwargs: Any) -> None: """Send commands to a device.""" await self.hass.async_add_executor_job( ft.partial(self.send_command, command, **kwargs) )
[ "async", "def", "async_send_command", "(", "self", ",", "command", ":", "Iterable", "[", "str", "]", ",", "*", "*", "kwargs", ":", "Any", ")", "->", "None", ":", "await", "self", ".", "hass", ".", "async_add_executor_job", "(", "ft", ".", "partial", "(...
[ 189, 4 ]
[ 193, 9 ]
python
en
['en', 'en', 'en']
True
RemoteEntity.learn_command
(self, **kwargs: Any)
Learn a command from a device.
Learn a command from a device.
def learn_command(self, **kwargs: Any) -> None: """Learn a command from a device.""" raise NotImplementedError()
[ "def", "learn_command", "(", "self", ",", "*", "*", "kwargs", ":", "Any", ")", "->", "None", ":", "raise", "NotImplementedError", "(", ")" ]
[ 195, 4 ]
[ 197, 35 ]
python
en
['en', 'en', 'en']
True
RemoteEntity.async_learn_command
(self, **kwargs: Any)
Learn a command from a device.
Learn a command from a device.
async def async_learn_command(self, **kwargs: Any) -> None: """Learn a command from a device.""" await self.hass.async_add_executor_job(ft.partial(self.learn_command, **kwargs))
[ "async", "def", "async_learn_command", "(", "self", ",", "*", "*", "kwargs", ":", "Any", ")", "->", "None", ":", "await", "self", ".", "hass", ".", "async_add_executor_job", "(", "ft", ".", "partial", "(", "self", ".", "learn_command", ",", "*", "*", "...
[ 199, 4 ]
[ 201, 88 ]
python
en
['en', 'en', 'en']
True
RemoteEntity.delete_command
(self, **kwargs: Any)
Delete commands from the database.
Delete commands from the database.
def delete_command(self, **kwargs: Any) -> None: """Delete commands from the database.""" raise NotImplementedError()
[ "def", "delete_command", "(", "self", ",", "*", "*", "kwargs", ":", "Any", ")", "->", "None", ":", "raise", "NotImplementedError", "(", ")" ]
[ 203, 4 ]
[ 205, 35 ]
python
en
['en', 'en', 'en']
True
RemoteEntity.async_delete_command
(self, **kwargs: Any)
Delete commands from the database.
Delete commands from the database.
async def async_delete_command(self, **kwargs: Any) -> None: """Delete commands from the database.""" await self.hass.async_add_executor_job( ft.partial(self.delete_command, **kwargs) )
[ "async", "def", "async_delete_command", "(", "self", ",", "*", "*", "kwargs", ":", "Any", ")", "->", "None", ":", "await", "self", ".", "hass", ".", "async_add_executor_job", "(", "ft", ".", "partial", "(", "self", ".", "delete_command", ",", "*", "*", ...
[ 207, 4 ]
[ 211, 9 ]
python
en
['en', 'en', 'en']
True
RemoteDevice.__init_subclass__
(cls, **kwargs)
Print deprecation warning.
Print deprecation warning.
def __init_subclass__(cls, **kwargs): """Print deprecation warning.""" super().__init_subclass__(**kwargs) _LOGGER.warning( "RemoteDevice is deprecated, modify %s to extend RemoteEntity", cls.__name__, )
[ "def", "__init_subclass__", "(", "cls", ",", "*", "*", "kwargs", ")", ":", "super", "(", ")", ".", "__init_subclass__", "(", "*", "*", "kwargs", ")", "_LOGGER", ".", "warning", "(", "\"RemoteDevice is deprecated, modify %s to extend RemoteEntity\"", ",", "cls", ...
[ 217, 4 ]
[ 223, 9 ]
python
de
['de', 'sv', 'en']
False
switchbox_fixture
()
Return a default switchBox switch entity mock.
Return a default switchBox switch entity mock.
def switchbox_fixture(): """Return a default switchBox switch entity mock.""" feature = mock_feature( "switches", blebox_uniapi.switch.Switch, unique_id="BleBox-switchBox-1afe34e750b8-0.relay", full_name="switchBox-0.relay", device_class="relay", is_on=False, ...
[ "def", "switchbox_fixture", "(", ")", ":", "feature", "=", "mock_feature", "(", "\"switches\"", ",", "blebox_uniapi", ".", "switch", ".", "Switch", ",", "unique_id", "=", "\"BleBox-switchBox-1afe34e750b8-0.relay\"", ",", "full_name", "=", "\"switchBox-0.relay\"", ",",...
[ 27, 0 ]
[ 41, 48 ]
python
en
['en', 'cy', 'en']
True
test_switchbox_init
(switchbox, hass, config)
Test switch default state.
Test switch default state.
async def test_switchbox_init(switchbox, hass, config): """Test switch default state.""" feature_mock, entity_id = switchbox feature_mock.async_update = AsyncMock() entry = await async_setup_entity(hass, config, entity_id) assert entry.unique_id == "BleBox-switchBox-1afe34e750b8-0.relay" stat...
[ "async", "def", "test_switchbox_init", "(", "switchbox", ",", "hass", ",", "config", ")", ":", "feature_mock", ",", "entity_id", "=", "switchbox", "feature_mock", ".", "async_update", "=", "AsyncMock", "(", ")", "entry", "=", "await", "async_setup_entity", "(", ...
[ 44, 0 ]
[ 67, 38 ]
python
en
['de', 'en', 'en']
True
test_switchbox_update_when_off
(switchbox, hass, config)
Test switch updating when off.
Test switch updating when off.
async def test_switchbox_update_when_off(switchbox, hass, config): """Test switch updating when off.""" feature_mock, entity_id = switchbox def initial_update(): feature_mock.is_on = False feature_mock.async_update = AsyncMock(side_effect=initial_update) await async_setup_entity(hass, con...
[ "async", "def", "test_switchbox_update_when_off", "(", "switchbox", ",", "hass", ",", "config", ")", ":", "feature_mock", ",", "entity_id", "=", "switchbox", "def", "initial_update", "(", ")", ":", "feature_mock", ".", "is_on", "=", "False", "feature_mock", ".",...
[ 70, 0 ]
[ 82, 35 ]
python
en
['en', 'en', 'en']
True
test_switchbox_update_when_on
(switchbox, hass, config)
Test switch updating when on.
Test switch updating when on.
async def test_switchbox_update_when_on(switchbox, hass, config): """Test switch updating when on.""" feature_mock, entity_id = switchbox def initial_update(): feature_mock.is_on = True feature_mock.async_update = AsyncMock(side_effect=initial_update) await async_setup_entity(hass, config...
[ "async", "def", "test_switchbox_update_when_on", "(", "switchbox", ",", "hass", ",", "config", ")", ":", "feature_mock", ",", "entity_id", "=", "switchbox", "def", "initial_update", "(", ")", ":", "feature_mock", ".", "is_on", "=", "True", "feature_mock", ".", ...
[ 85, 0 ]
[ 97, 34 ]
python
en
['en', 'en', 'en']
True
test_switchbox_on
(switchbox, hass, config)
Test turning switch on.
Test turning switch on.
async def test_switchbox_on(switchbox, hass, config): """Test turning switch on.""" feature_mock, entity_id = switchbox def initial_update(): feature_mock.is_on = False feature_mock.async_update = AsyncMock(side_effect=initial_update) await async_setup_entity(hass, config, entity_id) ...
[ "async", "def", "test_switchbox_on", "(", "switchbox", ",", "hass", ",", "config", ")", ":", "feature_mock", ",", "entity_id", "=", "switchbox", "def", "initial_update", "(", ")", ":", "feature_mock", ".", "is_on", "=", "False", "feature_mock", ".", "async_upd...
[ 100, 0 ]
[ 125, 34 ]
python
en
['en', 'en', 'en']
True
test_switchbox_off
(switchbox, hass, config)
Test turning switch off.
Test turning switch off.
async def test_switchbox_off(switchbox, hass, config): """Test turning switch off.""" feature_mock, entity_id = switchbox def initial_update(): feature_mock.is_on = True feature_mock.async_update = AsyncMock(side_effect=initial_update) await async_setup_entity(hass, config, entity_id) ...
[ "async", "def", "test_switchbox_off", "(", "switchbox", ",", "hass", ",", "config", ")", ":", "feature_mock", ",", "entity_id", "=", "switchbox", "def", "initial_update", "(", ")", ":", "feature_mock", ".", "is_on", "=", "True", "feature_mock", ".", "async_upd...
[ 128, 0 ]
[ 152, 35 ]
python
en
['en', 'en', 'en']
True
relay_mock
(relay_id=0)
Return a default switchBoxD switch entity mock.
Return a default switchBoxD switch entity mock.
def relay_mock(relay_id=0): """Return a default switchBoxD switch entity mock.""" return mock_only_feature( blebox_uniapi.switch.Switch, unique_id=f"BleBox-switchBoxD-1afe34e750b8-{relay_id}.relay", full_name=f"switchBoxD-{relay_id}.relay", device_class="relay", is_on=No...
[ "def", "relay_mock", "(", "relay_id", "=", "0", ")", ":", "return", "mock_only_feature", "(", "blebox_uniapi", ".", "switch", ".", "Switch", ",", "unique_id", "=", "f\"BleBox-switchBoxD-1afe34e750b8-{relay_id}.relay\"", ",", "full_name", "=", "f\"switchBoxD-{relay_id}.r...
[ 155, 0 ]
[ 164, 5 ]
python
en
['en', 'pl', 'en']
True
switchbox_d_fixture
()
Set up two mocked Switch features representing a switchBoxD.
Set up two mocked Switch features representing a switchBoxD.
def switchbox_d_fixture(): """Set up two mocked Switch features representing a switchBoxD.""" relay1 = relay_mock(0) relay2 = relay_mock(1) features = [relay1, relay2] product = setup_product_mock("switches", features) type(product).name = PropertyMock(return_value="My relays") type(produ...
[ "def", "switchbox_d_fixture", "(", ")", ":", "relay1", "=", "relay_mock", "(", "0", ")", "relay2", "=", "relay_mock", "(", "1", ")", "features", "=", "[", "relay1", ",", "relay2", "]", "product", "=", "setup_product_mock", "(", "\"switches\"", ",", "featur...
[ 168, 0 ]
[ 186, 81 ]
python
en
['en', 'en', 'en']
True
test_switchbox_d_init
(switchbox_d, hass, config)
Test switch default state.
Test switch default state.
async def test_switchbox_d_init(switchbox_d, hass, config): """Test switch default state.""" feature_mocks, entity_ids = switchbox_d feature_mocks[0].async_update = AsyncMock() feature_mocks[1].async_update = AsyncMock() entries = await async_setup_entities(hass, config, entity_ids) entry = e...
[ "async", "def", "test_switchbox_d_init", "(", "switchbox_d", ",", "hass", ",", "config", ")", ":", "feature_mocks", ",", "entity_ids", "=", "switchbox_d", "feature_mocks", "[", "0", "]", ".", "async_update", "=", "AsyncMock", "(", ")", "feature_mocks", "[", "1...
[ 189, 0 ]
[ 230, 38 ]
python
en
['de', 'en', 'en']
True
test_switchbox_d_update_when_off
(switchbox_d, hass, config)
Test switch updating when off.
Test switch updating when off.
async def test_switchbox_d_update_when_off(switchbox_d, hass, config): """Test switch updating when off.""" feature_mocks, entity_ids = switchbox_d def initial_update0(): feature_mocks[0].is_on = False feature_mocks[1].is_on = False feature_mocks[0].async_update = AsyncMock(side_effec...
[ "async", "def", "test_switchbox_d_update_when_off", "(", "switchbox_d", ",", "hass", ",", "config", ")", ":", "feature_mocks", ",", "entity_ids", "=", "switchbox_d", "def", "initial_update0", "(", ")", ":", "feature_mocks", "[", "0", "]", ".", "is_on", "=", "F...
[ 233, 0 ]
[ 247, 60 ]
python
en
['en', 'en', 'en']
True
test_switchbox_d_update_when_second_off
(switchbox_d, hass, config)
Test switch updating when off.
Test switch updating when off.
async def test_switchbox_d_update_when_second_off(switchbox_d, hass, config): """Test switch updating when off.""" feature_mocks, entity_ids = switchbox_d def initial_update0(): feature_mocks[0].is_on = True feature_mocks[1].is_on = False feature_mocks[0].async_update = AsyncMock(side...
[ "async", "def", "test_switchbox_d_update_when_second_off", "(", "switchbox_d", ",", "hass", ",", "config", ")", ":", "feature_mocks", ",", "entity_ids", "=", "switchbox_d", "def", "initial_update0", "(", ")", ":", "feature_mocks", "[", "0", "]", ".", "is_on", "=...
[ 250, 0 ]
[ 264, 60 ]
python
en
['en', 'en', 'en']
True
test_switchbox_d_turn_first_on
(switchbox_d, hass, config)
Test turning switch on.
Test turning switch on.
async def test_switchbox_d_turn_first_on(switchbox_d, hass, config): """Test turning switch on.""" feature_mocks, entity_ids = switchbox_d def initial_update0(): feature_mocks[0].is_on = False feature_mocks[1].is_on = False feature_mocks[0].async_update = AsyncMock(side_effect=initial...
[ "async", "def", "test_switchbox_d_turn_first_on", "(", "switchbox_d", ",", "hass", ",", "config", ")", ":", "feature_mocks", ",", "entity_ids", "=", "switchbox_d", "def", "initial_update0", "(", ")", ":", "feature_mocks", "[", "0", "]", ".", "is_on", "=", "Fal...
[ 267, 0 ]
[ 293, 60 ]
python
en
['en', 'en', 'en']
True
test_switchbox_d_second_on
(switchbox_d, hass, config)
Test turning switch on.
Test turning switch on.
async def test_switchbox_d_second_on(switchbox_d, hass, config): """Test turning switch on.""" feature_mocks, entity_ids = switchbox_d def initial_update0(): feature_mocks[0].is_on = False feature_mocks[1].is_on = False feature_mocks[0].async_update = AsyncMock(side_effect=initial_upd...
[ "async", "def", "test_switchbox_d_second_on", "(", "switchbox_d", ",", "hass", ",", "config", ")", ":", "feature_mocks", ",", "entity_ids", "=", "switchbox_d", "def", "initial_update0", "(", ")", ":", "feature_mocks", "[", "0", "]", ".", "is_on", "=", "False",...
[ 296, 0 ]
[ 322, 59 ]
python
en
['en', 'en', 'en']
True
test_switchbox_d_first_off
(switchbox_d, hass, config)
Test turning switch on.
Test turning switch on.
async def test_switchbox_d_first_off(switchbox_d, hass, config): """Test turning switch on.""" feature_mocks, entity_ids = switchbox_d def initial_update_any(): feature_mocks[0].is_on = True feature_mocks[1].is_on = True feature_mocks[0].async_update = AsyncMock(side_effect=initial_up...
[ "async", "def", "test_switchbox_d_first_off", "(", "switchbox_d", ",", "hass", ",", "config", ")", ":", "feature_mocks", ",", "entity_ids", "=", "switchbox_d", "def", "initial_update_any", "(", ")", ":", "feature_mocks", "[", "0", "]", ".", "is_on", "=", "True...
[ 325, 0 ]
[ 351, 59 ]
python
en
['en', 'en', 'en']
True
test_switchbox_d_second_off
(switchbox_d, hass, config)
Test turning switch on.
Test turning switch on.
async def test_switchbox_d_second_off(switchbox_d, hass, config): """Test turning switch on.""" feature_mocks, entity_ids = switchbox_d def initial_update_any(): feature_mocks[0].is_on = True feature_mocks[1].is_on = True feature_mocks[0].async_update = AsyncMock(side_effect=initial_u...
[ "async", "def", "test_switchbox_d_second_off", "(", "switchbox_d", ",", "hass", ",", "config", ")", ":", "feature_mocks", ",", "entity_ids", "=", "switchbox_d", "def", "initial_update_any", "(", ")", ":", "feature_mocks", "[", "0", "]", ".", "is_on", "=", "Tru...
[ 354, 0 ]
[ 379, 60 ]
python
en
['en', 'en', 'en']
True
test_update_failure
(feature, hass, config, caplog)
Test that update failures are logged.
Test that update failures are logged.
async def test_update_failure(feature, hass, config, caplog): """Test that update failures are logged.""" caplog.set_level(logging.ERROR) feature_mock, entity_id = feature if isinstance(feature_mock, list): feature_mock[0].async_update = AsyncMock() feature_mock[1].async_update = Asyn...
[ "async", "def", "test_update_failure", "(", "feature", ",", "hass", ",", "config", ",", "caplog", ")", ":", "caplog", ".", "set_level", "(", "logging", ".", "ERROR", ")", "feature_mock", ",", "entity_id", "=", "feature", "if", "isinstance", "(", "feature_moc...
[ 386, 0 ]
[ 402, 73 ]
python
en
['en', 'en', 'en']
True
UpCloudConfigFlow.async_step_user
( self, user_input: dict[str, Any] | None = None )
Handle user initiated flow.
Handle user initiated flow.
async def async_step_user( self, user_input: dict[str, Any] | None = None ) -> FlowResult: """Handle user initiated flow.""" if user_input is None: return self._async_show_form(step_id="user") await self.async_set_unique_id(user_input[CONF_USERNAME]) manager = u...
[ "async", "def", "async_step_user", "(", "self", ",", "user_input", ":", "dict", "[", "str", ",", "Any", "]", "|", "None", "=", "None", ")", "->", "FlowResult", ":", "if", "user_input", "is", "None", ":", "return", "self", ".", "_async_show_form", "(", ...
[ 29, 4 ]
[ 57, 88 ]
python
en
['en', 'nl', 'en']
True
UpCloudConfigFlow._async_show_form
( self, step_id: str, user_input: dict[str, Any] | None = None, errors: dict[str, str] | None = None, )
Show our form.
Show our form.
def _async_show_form( self, step_id: str, user_input: dict[str, Any] | None = None, errors: dict[str, str] | None = None, ) -> FlowResult: """Show our form.""" if user_input is None: user_input = {} return self.async_show_form( step_id=...
[ "def", "_async_show_form", "(", "self", ",", "step_id", ":", "str", ",", "user_input", ":", "dict", "[", "str", ",", "Any", "]", "|", "None", "=", "None", ",", "errors", ":", "dict", "[", "str", ",", "str", "]", "|", "None", "=", "None", ",", ")"...
[ 60, 4 ]
[ 82, 9 ]
python
en
['en', 'en', 'en']
True
UpCloudConfigFlow.async_get_options_flow
( config_entry: config_entries.ConfigEntry, )
Get options flow.
Get options flow.
def async_get_options_flow( config_entry: config_entries.ConfigEntry, ) -> UpCloudOptionsFlow: """Get options flow.""" return UpCloudOptionsFlow(config_entry)
[ "def", "async_get_options_flow", "(", "config_entry", ":", "config_entries", ".", "ConfigEntry", ",", ")", "->", "UpCloudOptionsFlow", ":", "return", "UpCloudOptionsFlow", "(", "config_entry", ")" ]
[ 86, 4 ]
[ 90, 47 ]
python
en
['en', 'nl', 'en']
True
UpCloudOptionsFlow.__init__
(self, config_entry: config_entries.ConfigEntry)
Initialize options flow.
Initialize options flow.
def __init__(self, config_entry: config_entries.ConfigEntry) -> None: """Initialize options flow.""" self.config_entry = config_entry
[ "def", "__init__", "(", "self", ",", "config_entry", ":", "config_entries", ".", "ConfigEntry", ")", "->", "None", ":", "self", ".", "config_entry", "=", "config_entry" ]
[ 96, 4 ]
[ 98, 40 ]
python
en
['en', 'en', 'en']
True
UpCloudOptionsFlow.async_step_init
( self, user_input: dict[str, Any] | None = None )
Handle options flow.
Handle options flow.
async def async_step_init( self, user_input: dict[str, Any] | None = None ) -> FlowResult: """Handle options flow.""" if user_input is not None: return self.async_create_entry(title="", data=user_input) data_schema = vol.Schema( { vol.Optiona...
[ "async", "def", "async_step_init", "(", "self", ",", "user_input", ":", "dict", "[", "str", ",", "Any", "]", "|", "None", "=", "None", ")", "->", "FlowResult", ":", "if", "user_input", "is", "not", "None", ":", "return", "self", ".", "async_create_entry"...
[ 100, 4 ]
[ 117, 76 ]
python
en
['en', 'nl', 'en']
True
load_manifest
(data)
Helper for loading a manifest yaml doc.
Helper for loading a manifest yaml doc.
def load_manifest(data): """ Helper for loading a manifest yaml doc. """ if isinstance(data, dict): return data doc = yaml.safe_load(data) if not isinstance(doc, dict): raise Exception("Manifest didn't result in dict.") return doc
[ "def", "load_manifest", "(", "data", ")", ":", "if", "isinstance", "(", "data", ",", "dict", ")", ":", "return", "data", "doc", "=", "yaml", ".", "safe_load", "(", "data", ")", "if", "not", "isinstance", "(", "doc", ",", "dict", ")", ":", "raise", ...
[ 185, 0 ]
[ 192, 14 ]
python
en
['en', 'cy', 'en']
True
create_context
(ctx)
Loads and constructs the specified context with the specified arguments. If a '.' isn't in the class name, the 'insights.core.context' package is assumed.
Loads and constructs the specified context with the specified arguments. If a '.' isn't in the class name, the 'insights.core.context' package is assumed.
def create_context(ctx): """ Loads and constructs the specified context with the specified arguments. If a '.' isn't in the class name, the 'insights.core.context' package is assumed. """ ctx_cls_name = ctx.get("class", "insights.core.context.HostContext") if "." not in ctx_cls_name: ...
[ "def", "create_context", "(", "ctx", ")", ":", "ctx_cls_name", "=", "ctx", ".", "get", "(", "\"class\"", ",", "\"insights.core.context.HostContext\"", ")", "if", "\".\"", "not", "in", "ctx_cls_name", ":", "ctx_cls_name", "=", "\"insights.core.context.\"", "+", "ct...
[ 214, 0 ]
[ 225, 30 ]
python
en
['en', 'error', 'th']
False
get_to_persist
(persisters)
Given a specification of what to persist, generates the corresponding set of components.
Given a specification of what to persist, generates the corresponding set of components.
def get_to_persist(persisters): """ Given a specification of what to persist, generates the corresponding set of components. """ def specs(): for p in persisters: if isinstance(p, dict): yield p["name"], p.get("enabled", True) else: yie...
[ "def", "get_to_persist", "(", "persisters", ")", ":", "def", "specs", "(", ")", ":", "for", "p", "in", "persisters", ":", "if", "isinstance", "(", "p", ",", "dict", ")", ":", "yield", "p", "[", "\"name\"", "]", ",", "p", ".", "get", "(", "\"enabled...
[ 228, 0 ]
[ 251, 18 ]
python
en
['en', 'error', 'th']
False
create_archive
(path, remove_path=True)
Creates a tar.gz of the path using the path basename + "tar.gz" The resulting file is in the parent directory of the original path, and the original path is removed.
Creates a tar.gz of the path using the path basename + "tar.gz" The resulting file is in the parent directory of the original path, and the original path is removed.
def create_archive(path, remove_path=True): """ Creates a tar.gz of the path using the path basename + "tar.gz" The resulting file is in the parent directory of the original path, and the original path is removed. """ root_path = os.path.dirname(path) relative_path = os.path.basename(path) ...
[ "def", "create_archive", "(", "path", ",", "remove_path", "=", "True", ")", ":", "root_path", "=", "os", ".", "path", ".", "dirname", "(", "path", ")", "relative_path", "=", "os", ".", "path", ".", "basename", "(", "path", ")", "archive_path", "=", "pa...
[ 254, 0 ]
[ 268, 23 ]
python
en
['en', 'error', 'th']
False
get_pool
(parallel, kwargs)
Yields: a ThreadPoolExecutor if parallel is True and `concurrent.futures` exists. `None` otherwise.
Yields: a ThreadPoolExecutor if parallel is True and `concurrent.futures` exists. `None` otherwise.
def get_pool(parallel, kwargs): """ Yields: a ThreadPoolExecutor if parallel is True and `concurrent.futures` exists. `None` otherwise. """ if parallel: try: from concurrent.futures import ThreadPoolExecutor with ThreadPoolExecutor(thread_name_prefix="ins...
[ "def", "get_pool", "(", "parallel", ",", "kwargs", ")", ":", "if", "parallel", ":", "try", ":", "from", "concurrent", ".", "futures", "import", "ThreadPoolExecutor", "with", "ThreadPoolExecutor", "(", "thread_name_prefix", "=", "\"insights-collector-pool\"", ",", ...
[ 272, 0 ]
[ 287, 18 ]
python
en
['en', 'error', 'th']
False
collect
(manifest=default_manifest, tmp_path=None, compress=False, rm_conf=None, client_timeout=None)
This is the collection entry point. It accepts a manifest, a temporary directory in which to store output, and a boolean for optional compression. Args: manifest (str or dict): json document or dictionary containing the collection manifest. See default_manifest for an example. ...
This is the collection entry point. It accepts a manifest, a temporary directory in which to store output, and a boolean for optional compression.
def collect(manifest=default_manifest, tmp_path=None, compress=False, rm_conf=None, client_timeout=None): """ This is the collection entry point. It accepts a manifest, a temporary directory in which to store output, and a boolean for optional compression. Args: manifest (str or dict): json doc...
[ "def", "collect", "(", "manifest", "=", "default_manifest", ",", "tmp_path", "=", "None", ",", "compress", "=", "False", ",", "rm_conf", "=", "None", ",", "client_timeout", "=", "None", ")", ":", "manifest", "=", "load_manifest", "(", "manifest", ")", "cli...
[ 290, 0 ]
[ 374, 22 ]
python
en
['en', 'error', 'th']
False
setup_platform
(hass, config, add_entities, discovery_info=None)
Set up the Blinkt Light platform.
Set up the Blinkt Light platform.
def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Blinkt Light platform.""" blinkt = importlib.import_module("blinkt") # ensure that the lights are off when exiting blinkt.set_clear_on_exit() name = config[CONF_NAME] add_entities( [BlinktLight(blinkt, ...
[ "def", "setup_platform", "(", "hass", ",", "config", ",", "add_entities", ",", "discovery_info", "=", "None", ")", ":", "blinkt", "=", "importlib", ".", "import_module", "(", "\"blinkt\"", ")", "# ensure that the lights are off when exiting", "blinkt", ".", "set_cle...
[ 26, 0 ]
[ 37, 5 ]
python
en
['en', 'da', 'en']
True
BlinktLight.__init__
(self, blinkt, name, index)
Initialize a Blinkt Light. Default brightness and white color.
Initialize a Blinkt Light.
def __init__(self, blinkt, name, index): """Initialize a Blinkt Light. Default brightness and white color. """ self._blinkt = blinkt self._attr_name = f"{name}_{index}" self._index = index self._attr_is_on = False self._attr_brightness = 255 self....
[ "def", "__init__", "(", "self", ",", "blinkt", ",", "name", ",", "index", ")", ":", "self", ".", "_blinkt", "=", "blinkt", "self", ".", "_attr_name", "=", "f\"{name}_{index}\"", "self", ".", "_index", "=", "index", "self", ".", "_attr_is_on", "=", "False...
[ 47, 4 ]
[ 57, 36 ]
python
en
['en', 'lb', 'it']
False
BlinktLight.turn_on
(self, **kwargs)
Instruct the light to turn on and set correct brightness & color.
Instruct the light to turn on and set correct brightness & color.
def turn_on(self, **kwargs): """Instruct the light to turn on and set correct brightness & color.""" if ATTR_HS_COLOR in kwargs: self._attr_hs_color = kwargs[ATTR_HS_COLOR] if ATTR_BRIGHTNESS in kwargs: self._attr_brightness = kwargs[ATTR_BRIGHTNESS] percent_brig...
[ "def", "turn_on", "(", "self", ",", "*", "*", "kwargs", ")", ":", "if", "ATTR_HS_COLOR", "in", "kwargs", ":", "self", ".", "_attr_hs_color", "=", "kwargs", "[", "ATTR_HS_COLOR", "]", "if", "ATTR_BRIGHTNESS", "in", "kwargs", ":", "self", ".", "_attr_brightn...
[ 59, 4 ]
[ 75, 39 ]
python
en
['en', 'en', 'en']
True
BlinktLight.turn_off
(self, **kwargs)
Instruct the light to turn off.
Instruct the light to turn off.
def turn_off(self, **kwargs): """Instruct the light to turn off.""" self._blinkt.set_pixel(self._index, 0, 0, 0, 0) self._blinkt.show() self._attr_is_on = False self.schedule_update_ha_state()
[ "def", "turn_off", "(", "self", ",", "*", "*", "kwargs", ")", ":", "self", ".", "_blinkt", ".", "set_pixel", "(", "self", ".", "_index", ",", "0", ",", "0", ",", "0", ",", "0", ")", "self", ".", "_blinkt", ".", "show", "(", ")", "self", ".", ...
[ 77, 4 ]
[ 82, 39 ]
python
en
['en', 'en', 'en']
True
validate_input
(hass: core.HomeAssistant, data)
Validate the user input allows us to connect.
Validate the user input allows us to connect.
async def validate_input(hass: core.HomeAssistant, data): """Validate the user input allows us to connect.""" try: async with aiosyncthing.Syncthing( data[CONF_TOKEN], url=data[CONF_URL], verify_ssl=data[CONF_VERIFY_SSL], loop=hass.loop, ) as clie...
[ "async", "def", "validate_input", "(", "hass", ":", "core", ".", "HomeAssistant", ",", "data", ")", ":", "try", ":", "async", "with", "aiosyncthing", ".", "Syncthing", "(", "data", "[", "CONF_TOKEN", "]", ",", "url", "=", "data", "[", "CONF_URL", "]", ...
[ 22, 0 ]
[ 37, 38 ]
python
en
['en', 'en', 'en']
True
ConfigFlow.async_step_user
(self, user_input=None)
Handle the initial step.
Handle the initial step.
async def async_step_user(self, user_input=None): """Handle the initial step.""" errors = {} if user_input is not None: try: info = await validate_input(self.hass, user_input) except CannotConnect: errors["base"] = "cannot_connect" ...
[ "async", "def", "async_step_user", "(", "self", ",", "user_input", "=", "None", ")", ":", "errors", "=", "{", "}", "if", "user_input", "is", "not", "None", ":", "try", ":", "info", "=", "await", "validate_input", "(", "self", ".", "hass", ",", "user_in...
[ 45, 4 ]
[ 63, 9 ]
python
en
['en', 'en', 'en']
True
test_binary_sensor
(hass, generic_data, binary_sensor_msg)
Test setting up config entry.
Test setting up config entry.
async def test_binary_sensor(hass, generic_data, binary_sensor_msg): """Test setting up config entry.""" receive_msg = await setup_ozw(hass, fixture=generic_data) # Test Legacy sensor (disabled by default) registry = er.async_get(hass) entity_id = "binary_sensor.trisensor_sensor" state = hass.s...
[ "async", "def", "test_binary_sensor", "(", "hass", ",", "generic_data", ",", "binary_sensor_msg", ")", ":", "receive_msg", "=", "await", "setup_ozw", "(", "hass", ",", "fixture", "=", "generic_data", ")", "# Test Legacy sensor (disabled by default)", "registry", "=", ...
[ 12, 0 ]
[ 43, 30 ]
python
en
['en', 'en', 'en']
True
test_sensor_enabled
(hass, generic_data, binary_sensor_alt_msg)
Test enabling a legacy binary_sensor.
Test enabling a legacy binary_sensor.
async def test_sensor_enabled(hass, generic_data, binary_sensor_alt_msg): """Test enabling a legacy binary_sensor.""" registry = er.async_get(hass) entry = registry.async_get_or_create( BINARY_SENSOR_DOMAIN, DOMAIN, "1-37-625737744", suggested_object_id="trisensor_sensor_in...
[ "async", "def", "test_sensor_enabled", "(", "hass", ",", "generic_data", ",", "binary_sensor_alt_msg", ")", ":", "registry", "=", "er", ".", "async_get", "(", "hass", ")", "entry", "=", "registry", ".", "async_get_or_create", "(", "BINARY_SENSOR_DOMAIN", ",", "D...
[ 46, 0 ]
[ 66, 30 ]
python
en
['en', 'cy', 'en']
True
DevoloHomeControlFlowHandler.__init__
(self)
Initialize devolo Home Control flow.
Initialize devolo Home Control flow.
def __init__(self) -> None: """Initialize devolo Home Control flow.""" self.data_schema = { vol.Required(CONF_USERNAME): str, vol.Required(CONF_PASSWORD): str, } self._reauth_entry: ConfigEntry | None = None self._url = DEFAULT_MYDEVOLO
[ "def", "__init__", "(", "self", ")", "->", "None", ":", "self", ".", "data_schema", "=", "{", "vol", ".", "Required", "(", "CONF_USERNAME", ")", ":", "str", ",", "vol", ".", "Required", "(", "CONF_PASSWORD", ")", ":", "str", ",", "}", "self", ".", ...
[ 24, 4 ]
[ 31, 36 ]
python
it
['it', 'fr', 'it']
True
DevoloHomeControlFlowHandler.async_step_user
( self, user_input: dict[str, Any] | None = None )
Handle a flow initiated by the user.
Handle a flow initiated by the user.
async def async_step_user( self, user_input: dict[str, Any] | None = None ) -> FlowResult: """Handle a flow initiated by the user.""" if self.show_advanced_options: self.data_schema[vol.Required(CONF_MYDEVOLO, default=self._url)] = str if user_input is None: r...
[ "async", "def", "async_step_user", "(", "self", ",", "user_input", ":", "dict", "[", "str", ",", "Any", "]", "|", "None", "=", "None", ")", "->", "FlowResult", ":", "if", "self", ".", "show_advanced_options", ":", "self", ".", "data_schema", "[", "vol", ...
[ 33, 4 ]
[ 44, 83 ]
python
en
['en', 'en', 'en']
True
DevoloHomeControlFlowHandler.async_step_zeroconf
( self, discovery_info: DiscoveryInfoType )
Handle zeroconf discovery.
Handle zeroconf discovery.
async def async_step_zeroconf( self, discovery_info: DiscoveryInfoType ) -> FlowResult: """Handle zeroconf discovery.""" # Check if it is a gateway if discovery_info.get("properties", {}).get("MT") in SUPPORTED_MODEL_TYPES: await self._async_handle_discovery_without_uniqu...
[ "async", "def", "async_step_zeroconf", "(", "self", ",", "discovery_info", ":", "DiscoveryInfoType", ")", "->", "FlowResult", ":", "# Check if it is a gateway", "if", "discovery_info", ".", "get", "(", "\"properties\"", ",", "{", "}", ")", ".", "get", "(", "\"MT...
[ 46, 4 ]
[ 54, 76 ]
python
de
['de', 'sr', 'en']
False
DevoloHomeControlFlowHandler.async_step_zeroconf_confirm
( self, user_input: dict[str, Any] | None = None )
Handle a flow initiated by zeroconf.
Handle a flow initiated by zeroconf.
async def async_step_zeroconf_confirm( self, user_input: dict[str, Any] | None = None ) -> FlowResult: """Handle a flow initiated by zeroconf.""" if user_input is None: return self._show_form(step_id="zeroconf_confirm") try: return await self._connect_mydevolo...
[ "async", "def", "async_step_zeroconf_confirm", "(", "self", ",", "user_input", ":", "dict", "[", "str", ",", "Any", "]", "|", "None", "=", "None", ")", "->", "FlowResult", ":", "if", "user_input", "is", "None", ":", "return", "self", ".", "_show_form", "...
[ 56, 4 ]
[ 67, 13 ]
python
en
['en', 'en', 'en']
True
DevoloHomeControlFlowHandler.async_step_reauth
(self, user_input: dict[str, Any])
Handle reauthentication.
Handle reauthentication.
async def async_step_reauth(self, user_input: dict[str, Any]) -> FlowResult: """Handle reauthentication.""" self._reauth_entry = self.hass.config_entries.async_get_entry( self.context["entry_id"] ) self._url = user_input[CONF_MYDEVOLO] self.data_schema = { ...
[ "async", "def", "async_step_reauth", "(", "self", ",", "user_input", ":", "dict", "[", "str", ",", "Any", "]", ")", "->", "FlowResult", ":", "self", ".", "_reauth_entry", "=", "self", ".", "hass", ".", "config_entries", ".", "async_get_entry", "(", "self",...
[ 69, 4 ]
[ 79, 53 ]
python
de
['de', 'fr', 'en']
False
DevoloHomeControlFlowHandler.async_step_reauth_confirm
( self, user_input: dict[str, Any] | None = None )
Handle a flow initiated by reauthentication.
Handle a flow initiated by reauthentication.
async def async_step_reauth_confirm( self, user_input: dict[str, Any] | None = None ) -> FlowResult: """Handle a flow initiated by reauthentication.""" if user_input is None: return self._show_form(step_id="reauth_confirm") try: return await self._connect_myde...
[ "async", "def", "async_step_reauth_confirm", "(", "self", ",", "user_input", ":", "dict", "[", "str", ",", "Any", "]", "|", "None", "=", "None", ")", "->", "FlowResult", ":", "if", "user_input", "is", "None", ":", "return", "self", ".", "_show_form", "("...
[ 81, 4 ]
[ 96, 13 ]
python
en
['en', 'en', 'en']
True
DevoloHomeControlFlowHandler._connect_mydevolo
(self, user_input: dict[str, Any])
Connect to mydevolo.
Connect to mydevolo.
async def _connect_mydevolo(self, user_input: dict[str, Any]) -> FlowResult: """Connect to mydevolo.""" user_input[CONF_MYDEVOLO] = user_input.get(CONF_MYDEVOLO, self._url) mydevolo = configure_mydevolo(conf=user_input) credentials_valid = await self.hass.async_add_executor_job( ...
[ "async", "def", "_connect_mydevolo", "(", "self", ",", "user_input", ":", "dict", "[", "str", ",", "Any", "]", ")", "->", "FlowResult", ":", "user_input", "[", "CONF_MYDEVOLO", "]", "=", "user_input", ".", "get", "(", "CONF_MYDEVOLO", ",", "self", ".", "...
[ 98, 4 ]
[ 131, 59 ]
python
en
['en', 'en', 'en']
True
DevoloHomeControlFlowHandler._show_form
( self, step_id: str, errors: dict[str, str] | None = None )
Show the form to the user.
Show the form to the user.
def _show_form( self, step_id: str, errors: dict[str, str] | None = None ) -> FlowResult: """Show the form to the user.""" return self.async_show_form( step_id=step_id, data_schema=vol.Schema(self.data_schema), errors=errors if errors else {}, )
[ "def", "_show_form", "(", "self", ",", "step_id", ":", "str", ",", "errors", ":", "dict", "[", "str", ",", "str", "]", "|", "None", "=", "None", ")", "->", "FlowResult", ":", "return", "self", ".", "async_show_form", "(", "step_id", "=", "step_id", "...
[ 134, 4 ]
[ 142, 9 ]
python
en
['en', 'en', 'en']
True
mock_weather
()
Mock weather data.
Mock weather data.
def mock_weather(): """Mock weather data.""" with patch("metno.MetWeatherData") as mock_data: mock_data = mock_data.return_value mock_data.fetching_data = AsyncMock(return_value=True) mock_data.get_current_weather.return_value = { "condition": "cloudy", "temperatu...
[ "def", "mock_weather", "(", ")", ":", "with", "patch", "(", "\"metno.MetWeatherData\"", ")", "as", "mock_data", ":", "mock_data", "=", "mock_data", ".", "return_value", "mock_data", ".", "fetching_data", "=", "AsyncMock", "(", "return_value", "=", "True", ")", ...
[ 7, 0 ]
[ 21, 23 ]
python
en
['en', 'xh', 'en']
True
async_setup
(hass: HomeAssistant, config: ConfigType)
Set up the KNX integration.
Set up the KNX integration.
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the KNX integration.""" try: knx_module = KNXModule(hass, config) hass.data[DOMAIN] = knx_module await knx_module.start() except XKNXException as ex: _LOGGER.warning("Could not connect to KNX in...
[ "async", "def", "async_setup", "(", "hass", ":", "HomeAssistant", ",", "config", ":", "ConfigType", ")", "->", "bool", ":", "try", ":", "knx_module", "=", "KNXModule", "(", "hass", ",", "config", ")", "hass", ".", "data", "[", "DOMAIN", "]", "=", "knx_...
[ 171, 0 ]
[ 256, 15 ]
python
en
['en', 'da', 'en']
True
KNXModule.__init__
(self, hass: HomeAssistant, config: ConfigType)
Initialize KNX module.
Initialize KNX module.
def __init__(self, hass: HomeAssistant, config: ConfigType) -> None: """Initialize KNX module.""" self.hass = hass self.config = config self.connected = False self.exposures: list[KNXExposeSensor | KNXExposeTime] = [] self.service_exposures: dict[str, KNXExposeSensor | KN...
[ "def", "__init__", "(", "self", ",", "hass", ":", "HomeAssistant", ",", "config", ":", "ConfigType", ")", "->", "None", ":", "self", ".", "hass", "=", "hass", "self", ".", "config", "=", "config", "self", ".", "connected", "=", "False", "self", ".", ...
[ 262, 4 ]
[ 271, 83 ]
python
co
['en', 'co', 'it']
False
KNXModule.init_xknx
(self)
Initialize XKNX object.
Initialize XKNX object.
def init_xknx(self) -> None: """Initialize XKNX object.""" self.xknx = XKNX( own_address=self.config[DOMAIN][CONF_KNX_INDIVIDUAL_ADDRESS], rate_limit=self.config[DOMAIN][ConnectionSchema.CONF_KNX_RATE_LIMIT], multicast_group=self.config[DOMAIN][ConnectionSchema.CONF_K...
[ "def", "init_xknx", "(", "self", ")", "->", "None", ":", "self", ".", "xknx", "=", "XKNX", "(", "own_address", "=", "self", ".", "config", "[", "DOMAIN", "]", "[", "CONF_KNX_INDIVIDUAL_ADDRESS", "]", ",", "rate_limit", "=", "self", ".", "config", "[", ...
[ 273, 4 ]
[ 282, 9 ]
python
en
['en', 'pl', 'it']
False
KNXModule.start
(self)
Start XKNX object. Connect to tunneling or Routing device.
Start XKNX object. Connect to tunneling or Routing device.
async def start(self) -> None: """Start XKNX object. Connect to tunneling or Routing device.""" await self.xknx.start() self.hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, self.stop) self.connected = True
[ "async", "def", "start", "(", "self", ")", "->", "None", ":", "await", "self", ".", "xknx", ".", "start", "(", ")", "self", ".", "hass", ".", "bus", ".", "async_listen_once", "(", "EVENT_HOMEASSISTANT_STOP", ",", "self", ".", "stop", ")", "self", ".", ...
[ 284, 4 ]
[ 288, 29 ]
python
en
['en', 'en', 'en']
True
KNXModule.stop
(self, event: Event)
Stop XKNX object. Disconnect from tunneling or Routing device.
Stop XKNX object. Disconnect from tunneling or Routing device.
async def stop(self, event: Event) -> None: """Stop XKNX object. Disconnect from tunneling or Routing device.""" await self.xknx.stop()
[ "async", "def", "stop", "(", "self", ",", "event", ":", "Event", ")", "->", "None", ":", "await", "self", ".", "xknx", ".", "stop", "(", ")" ]
[ 290, 4 ]
[ 292, 30 ]
python
en
['en', 'en', 'en']
True
KNXModule.connection_config
(self)
Return the connection_config.
Return the connection_config.
def connection_config(self) -> ConnectionConfig: """Return the connection_config.""" if CONF_KNX_TUNNELING in self.config[DOMAIN]: return self.connection_config_tunneling() if CONF_KNX_ROUTING in self.config[DOMAIN]: return self.connection_config_routing() return ...
[ "def", "connection_config", "(", "self", ")", "->", "ConnectionConfig", ":", "if", "CONF_KNX_TUNNELING", "in", "self", ".", "config", "[", "DOMAIN", "]", ":", "return", "self", ".", "connection_config_tunneling", "(", ")", "if", "CONF_KNX_ROUTING", "in", "self",...
[ 294, 4 ]
[ 300, 52 ]
python
en
['en', 'en', 'en']
True
KNXModule.connection_config_routing
(self)
Return the connection_config if routing is configured.
Return the connection_config if routing is configured.
def connection_config_routing(self) -> ConnectionConfig: """Return the connection_config if routing is configured.""" local_ip = None # all configuration values are optional if self.config[DOMAIN][CONF_KNX_ROUTING] is not None: local_ip = self.config[DOMAIN][CONF_KNX_ROUTING]...
[ "def", "connection_config_routing", "(", "self", ")", "->", "ConnectionConfig", ":", "local_ip", "=", "None", "# all configuration values are optional", "if", "self", ".", "config", "[", "DOMAIN", "]", "[", "CONF_KNX_ROUTING", "]", "is", "not", "None", ":", "local...
[ 302, 4 ]
[ 312, 9 ]
python
en
['en', 'en', 'en']
True
KNXModule.connection_config_tunneling
(self)
Return the connection_config if tunneling is configured.
Return the connection_config if tunneling is configured.
def connection_config_tunneling(self) -> ConnectionConfig: """Return the connection_config if tunneling is configured.""" gateway_ip = self.config[DOMAIN][CONF_KNX_TUNNELING][CONF_HOST] gateway_port = self.config[DOMAIN][CONF_KNX_TUNNELING][CONF_PORT] local_ip = self.config[DOMAIN][CONF_...
[ "def", "connection_config_tunneling", "(", "self", ")", "->", "ConnectionConfig", ":", "gateway_ip", "=", "self", ".", "config", "[", "DOMAIN", "]", "[", "CONF_KNX_TUNNELING", "]", "[", "CONF_HOST", "]", "gateway_port", "=", "self", ".", "config", "[", "DOMAIN...
[ 314, 4 ]
[ 331, 9 ]
python
en
['en', 'en', 'en']
True
KNXModule.telegram_received_cb
(self, telegram: Telegram)
Call invoked after a KNX telegram was received.
Call invoked after a KNX telegram was received.
async def telegram_received_cb(self, telegram: Telegram) -> None: """Call invoked after a KNX telegram was received.""" data = None # Not all telegrams have serializable data. if ( isinstance(telegram.payload, (GroupValueWrite, GroupValueResponse)) and telegram.pa...
[ "async", "def", "telegram_received_cb", "(", "self", ",", "telegram", ":", "Telegram", ")", "->", "None", ":", "data", "=", "None", "# Not all telegrams have serializable data.", "if", "(", "isinstance", "(", "telegram", ".", "payload", ",", "(", "GroupValueWrite"...
[ 333, 4 ]
[ 352, 9 ]
python
en
['en', 'en', 'en']
True
KNXModule.register_callback
(self)
Register callback within XKNX TelegramQueue.
Register callback within XKNX TelegramQueue.
def register_callback(self) -> TelegramQueue.Callback: """Register callback within XKNX TelegramQueue.""" address_filters = list( map(AddressFilter, self.config[DOMAIN][CONF_KNX_EVENT_FILTER]) ) return self.xknx.telegram_queue.register_telegram_received_cb( self.t...
[ "def", "register_callback", "(", "self", ")", "->", "TelegramQueue", ".", "Callback", ":", "address_filters", "=", "list", "(", "map", "(", "AddressFilter", ",", "self", ".", "config", "[", "DOMAIN", "]", "[", "CONF_KNX_EVENT_FILTER", "]", ")", ")", "return"...
[ 354, 4 ]
[ 364, 9 ]
python
en
['en', 'la', 'en']
True
KNXModule.service_event_register_modify
(self, call: ServiceCall)
Service for adding or removing a GroupAddress to the knx_event filter.
Service for adding or removing a GroupAddress to the knx_event filter.
async def service_event_register_modify(self, call: ServiceCall) -> None: """Service for adding or removing a GroupAddress to the knx_event filter.""" attr_address = call.data[KNX_ADDRESS] group_addresses = map(parse_device_group_address, attr_address) if call.data.get(SERVICE_KNX_ATTR_...
[ "async", "def", "service_event_register_modify", "(", "self", ",", "call", ":", "ServiceCall", ")", "->", "None", ":", "attr_address", "=", "call", ".", "data", "[", "KNX_ADDRESS", "]", "group_addresses", "=", "map", "(", "parse_device_group_address", ",", "attr...
[ 366, 4 ]
[ 389, 13 ]
python
en
['en', 'en', 'en']
True
KNXModule.service_exposure_register_modify
(self, call: ServiceCall)
Service for adding or removing an exposure to KNX bus.
Service for adding or removing an exposure to KNX bus.
async def service_exposure_register_modify(self, call: ServiceCall) -> None: """Service for adding or removing an exposure to KNX bus.""" group_address = call.data[KNX_ADDRESS] if call.data.get(SERVICE_KNX_ATTR_REMOVE): try: removed_exposure = self.service_exposures....
[ "async", "def", "service_exposure_register_modify", "(", "self", ",", "call", ":", "ServiceCall", ")", "->", "None", ":", "group_address", "=", "call", ".", "data", "[", "KNX_ADDRESS", "]", "if", "call", ".", "data", ".", "get", "(", "SERVICE_KNX_ATTR_REMOVE",...
[ 391, 4 ]
[ 420, 9 ]
python
en
['en', 'en', 'en']
True
KNXModule.service_send_to_knx_bus
(self, call: ServiceCall)
Service for sending an arbitrary KNX message to the KNX bus.
Service for sending an arbitrary KNX message to the KNX bus.
async def service_send_to_knx_bus(self, call: ServiceCall) -> None: """Service for sending an arbitrary KNX message to the KNX bus.""" attr_address = call.data[KNX_ADDRESS] attr_payload = call.data[SERVICE_KNX_ATTR_PAYLOAD] attr_type = call.data.get(SERVICE_KNX_ATTR_TYPE) payloa...
[ "async", "def", "service_send_to_knx_bus", "(", "self", ",", "call", ":", "ServiceCall", ")", "->", "None", ":", "attr_address", "=", "call", ".", "data", "[", "KNX_ADDRESS", "]", "attr_payload", "=", "call", ".", "data", "[", "SERVICE_KNX_ATTR_PAYLOAD", "]", ...
[ 422, 4 ]
[ 444, 51 ]
python
en
['en', 'en', 'en']
True
KNXModule.service_read_to_knx_bus
(self, call: ServiceCall)
Service for sending a GroupValueRead telegram to the KNX bus.
Service for sending a GroupValueRead telegram to the KNX bus.
async def service_read_to_knx_bus(self, call: ServiceCall) -> None: """Service for sending a GroupValueRead telegram to the KNX bus.""" for address in call.data[KNX_ADDRESS]: telegram = Telegram( destination_address=parse_device_group_address(address), payload...
[ "async", "def", "service_read_to_knx_bus", "(", "self", ",", "call", ":", "ServiceCall", ")", "->", "None", ":", "for", "address", "in", "call", ".", "data", "[", "KNX_ADDRESS", "]", ":", "telegram", "=", "Telegram", "(", "destination_address", "=", "parse_d...
[ 446, 4 ]
[ 453, 51 ]
python
en
['en', 'en', 'en']
True
install_osx
()
Set up to run via launchd on OS X.
Set up to run via launchd on OS X.
def install_osx(): """Set up to run via launchd on OS X.""" with os.popen("which hass") as inp: hass_path = inp.read().strip() with os.popen("whoami") as inp: user = inp.read().strip() template_path = os.path.join(os.path.dirname(__file__), "launchd.plist") with open(template_path...
[ "def", "install_osx", "(", ")", ":", "with", "os", ".", "popen", "(", "\"which hass\"", ")", "as", "inp", ":", "hass_path", "=", "inp", ".", "read", "(", ")", ".", "strip", "(", ")", "with", "os", ".", "popen", "(", "\"whoami\"", ")", "as", "inp", ...
[ 7, 0 ]
[ 37, 5 ]
python
en
['en', 'en', 'en']
True