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
HassioOSBinarySensor.is_on
(self)
Return true if the binary sensor is on.
Return true if the binary sensor is on.
def is_on(self) -> bool: """Return true if the binary sensor is on.""" return self.coordinator.data[DATA_KEY_OS][self.entity_description.key]
[ "def", "is_on", "(", "self", ")", "->", "bool", ":", "return", "self", ".", "coordinator", ".", "data", "[", "DATA_KEY_OS", "]", "[", "self", ".", "entity_description", ".", "key", "]" ]
[ 72, 4 ]
[ 74, 78 ]
python
en
['en', 'fy', 'en']
True
test_form
(hass)
Test we get the form.
Test we get the form.
async def test_form(hass): """Test we get the form.""" result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": config_entries.SOURCE_USER} ) assert result["type"] == "form" assert result["errors"] == {} with patch( "homeassistant.components.risco.config_fl...
[ "async", "def", "test_form", "(", "hass", ")", ":", "result", "=", "await", "hass", ".", "config_entries", ".", "flow", ".", "async_init", "(", "DOMAIN", ",", "context", "=", "{", "\"source\"", ":", "config_entries", ".", "SOURCE_USER", "}", ")", "assert",...
[ 44, 0 ]
[ 73, 36 ]
python
en
['en', 'en', 'en']
True
test_form_invalid_auth
(hass)
Test we handle invalid auth.
Test we handle invalid auth.
async def test_form_invalid_auth(hass): """Test we handle invalid auth.""" result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": config_entries.SOURCE_USER} ) with patch( "homeassistant.components.risco.config_flow.RiscoAPI.login", side_effect=Unauthoriz...
[ "async", "def", "test_form_invalid_auth", "(", "hass", ")", ":", "result", "=", "await", "hass", ".", "config_entries", ".", "flow", ".", "async_init", "(", "DOMAIN", ",", "context", "=", "{", "\"source\"", ":", "config_entries", ".", "SOURCE_USER", "}", ")"...
[ 76, 0 ]
[ 92, 36 ]
python
en
['en', 'en', 'en']
True
test_form_cannot_connect
(hass)
Test we handle cannot connect error.
Test we handle cannot connect error.
async def test_form_cannot_connect(hass): """Test we handle cannot connect error.""" result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": config_entries.SOURCE_USER} ) with patch( "homeassistant.components.risco.config_flow.RiscoAPI.login", side_effect=...
[ "async", "def", "test_form_cannot_connect", "(", "hass", ")", ":", "result", "=", "await", "hass", ".", "config_entries", ".", "flow", ".", "async_init", "(", "DOMAIN", ",", "context", "=", "{", "\"source\"", ":", "config_entries", ".", "SOURCE_USER", "}", "...
[ 95, 0 ]
[ 111, 36 ]
python
en
['en', 'en', 'en']
True
test_form_exception
(hass)
Test we handle unknown exception.
Test we handle unknown exception.
async def test_form_exception(hass): """Test we handle unknown exception.""" result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": config_entries.SOURCE_USER} ) with patch( "homeassistant.components.risco.config_flow.RiscoAPI.login", side_effect=Exceptio...
[ "async", "def", "test_form_exception", "(", "hass", ")", ":", "result", "=", "await", "hass", ".", "config_entries", ".", "flow", ".", "async_init", "(", "DOMAIN", ",", "context", "=", "{", "\"source\"", ":", "config_entries", ".", "SOURCE_USER", "}", ")", ...
[ 114, 0 ]
[ 130, 36 ]
python
en
['en', 'en', 'en']
True
test_form_already_exists
(hass)
Test that a flow with an existing username aborts.
Test that a flow with an existing username aborts.
async def test_form_already_exists(hass): """Test that a flow with an existing username aborts.""" entry = MockConfigEntry( domain=DOMAIN, unique_id=TEST_DATA["username"], data=TEST_DATA, ) entry.add_to_hass(hass) result = await hass.config_entries.flow.async_init( ...
[ "async", "def", "test_form_already_exists", "(", "hass", ")", ":", "entry", "=", "MockConfigEntry", "(", "domain", "=", "DOMAIN", ",", "unique_id", "=", "TEST_DATA", "[", "\"username\"", "]", ",", "data", "=", "TEST_DATA", ",", ")", "entry", ".", "add_to_has...
[ 133, 0 ]
[ 152, 52 ]
python
en
['en', 'en', 'en']
True
test_options_flow
(hass)
Test options flow.
Test options flow.
async def test_options_flow(hass): """Test options flow.""" entry = MockConfigEntry( domain=DOMAIN, unique_id=TEST_DATA["username"], data=TEST_DATA, ) entry.add_to_hass(hass) result = await hass.config_entries.options.async_init(entry.entry_id) assert result["type"] ==...
[ "async", "def", "test_options_flow", "(", "hass", ")", ":", "entry", "=", "MockConfigEntry", "(", "domain", "=", "DOMAIN", ",", "unique_id", "=", "TEST_DATA", "[", "\"username\"", "]", ",", "data", "=", "TEST_DATA", ",", ")", "entry", ".", "add_to_hass", "...
[ 155, 0 ]
[ 196, 5 ]
python
en
['en', 'fr', 'en']
True
test_ha_to_risco_schema
(hass)
Test that the schema for the ha-to-risco mapping step is generated properly.
Test that the schema for the ha-to-risco mapping step is generated properly.
async def test_ha_to_risco_schema(hass): """Test that the schema for the ha-to-risco mapping step is generated properly.""" entry = MockConfigEntry( domain=DOMAIN, unique_id=TEST_DATA["username"], data=TEST_DATA, ) entry.add_to_hass(hass) result = await hass.config_entries....
[ "async", "def", "test_ha_to_risco_schema", "(", "hass", ")", ":", "entry", "=", "MockConfigEntry", "(", "domain", "=", "DOMAIN", ",", "unique_id", "=", "TEST_DATA", "[", "\"username\"", "]", ",", "data", "=", "TEST_DATA", ",", ")", "entry", ".", "add_to_hass...
[ 199, 0 ]
[ 232, 9 ]
python
en
['en', 'en', 'en']
True
calls
(hass)
Track calls to a mock service.
Track calls to a mock service.
def calls(hass): """Track calls to a mock service.""" return async_mock_service(hass, "test", "automation")
[ "def", "calls", "(", "hass", ")", ":", "return", "async_mock_service", "(", "hass", ",", "\"test\"", ",", "\"automation\"", ")" ]
[ 25, 0 ]
[ 27, 57 ]
python
en
['en', 'en', 'en']
True
test_get_conditions
(hass, client, lock_schlage_be469, integration)
Test we get the expected onditions from a zwave_js.
Test we get the expected onditions from a zwave_js.
async def test_get_conditions(hass, client, lock_schlage_be469, integration) -> None: """Test we get the expected onditions from a zwave_js.""" dev_reg = device_registry.async_get(hass) device = device_registry.async_entries_for_config_entry( dev_reg, integration.entry_id )[0] config_value =...
[ "async", "def", "test_get_conditions", "(", "hass", ",", "client", ",", "lock_schlage_be469", ",", "integration", ")", "->", "None", ":", "dev_reg", "=", "device_registry", ".", "async_get", "(", "hass", ")", "device", "=", "device_registry", ".", "async_entries...
[ 30, 0 ]
[ 64, 38 ]
python
en
['en', 'en', 'en']
True
test_node_status_state
( hass, client, lock_schlage_be469, integration, calls )
Test for node_status conditions.
Test for node_status conditions.
async def test_node_status_state( hass, client, lock_schlage_be469, integration, calls ) -> None: """Test for node_status conditions.""" dev_reg = device_registry.async_get(hass) device = device_registry.async_entries_for_config_entry( dev_reg, integration.entry_id )[0] assert await asy...
[ "async", "def", "test_node_status_state", "(", "hass", ",", "client", ",", "lock_schlage_be469", ",", "integration", ",", "calls", ")", "->", "None", ":", "dev_reg", "=", "device_registry", ".", "async_get", "(", "hass", ")", "device", "=", "device_registry", ...
[ 67, 0 ]
[ 223, 38 ]
python
en
['en', 'en', 'en']
True
test_config_parameter_state
( hass, client, lock_schlage_be469, integration, calls )
Test for config_parameter conditions.
Test for config_parameter conditions.
async def test_config_parameter_state( hass, client, lock_schlage_be469, integration, calls ) -> None: """Test for config_parameter conditions.""" dev_reg = device_registry.async_get(hass) device = device_registry.async_entries_for_config_entry( dev_reg, integration.entry_id )[0] assert...
[ "async", "def", "test_config_parameter_state", "(", "hass", ",", "client", ",", "lock_schlage_be469", ",", "integration", ",", "calls", ")", "->", "None", ":", "dev_reg", "=", "device_registry", ".", "async_get", "(", "hass", ")", "device", "=", "device_registry...
[ 226, 0 ]
[ 332, 76 ]
python
en
['en', 'en', 'en']
True
test_value_state
( hass, client, lock_schlage_be469, integration, calls )
Test for value conditions.
Test for value conditions.
async def test_value_state( hass, client, lock_schlage_be469, integration, calls ) -> None: """Test for value conditions.""" dev_reg = device_registry.async_get(hass) device = device_registry.async_entries_for_config_entry( dev_reg, integration.entry_id )[0] assert await async_setup_com...
[ "async", "def", "test_value_state", "(", "hass", ",", "client", ",", "lock_schlage_be469", ",", "integration", ",", "calls", ")", "->", "None", ":", "dev_reg", "=", "device_registry", ".", "async_get", "(", "hass", ")", "device", "=", "device_registry", ".", ...
[ 335, 0 ]
[ 376, 65 ]
python
en
['en', 'en', 'en']
True
test_get_condition_capabilities_node_status
( hass, client, lock_schlage_be469, integration )
Test we don't get capabilities from a node_status condition.
Test we don't get capabilities from a node_status condition.
async def test_get_condition_capabilities_node_status( hass, client, lock_schlage_be469, integration ): """Test we don't get capabilities from a node_status condition.""" dev_reg = device_registry.async_get(hass) device = device_registry.async_entries_for_config_entry( dev_reg, integration.entry...
[ "async", "def", "test_get_condition_capabilities_node_status", "(", "hass", ",", "client", ",", "lock_schlage_be469", ",", "integration", ")", ":", "dev_reg", "=", "device_registry", ".", "async_get", "(", "hass", ")", "device", "=", "device_registry", ".", "async_e...
[ 379, 0 ]
[ 412, 5 ]
python
en
['en', 'en', 'en']
True
test_get_condition_capabilities_value
( hass, client, lock_schlage_be469, integration )
Test we get the expected capabilities from a value condition.
Test we get the expected capabilities from a value condition.
async def test_get_condition_capabilities_value( hass, client, lock_schlage_be469, integration ): """Test we get the expected capabilities from a value condition.""" dev_reg = device_registry.async_get(hass) device = device_registry.async_entries_for_config_entry( dev_reg, integration.entry_id ...
[ "async", "def", "test_get_condition_capabilities_value", "(", "hass", ",", "client", ",", "lock_schlage_be469", ",", "integration", ")", ":", "dev_reg", "=", "device_registry", ".", "async_get", "(", "hass", ")", "device", "=", "device_registry", ".", "async_entries...
[ 415, 0 ]
[ 460, 5 ]
python
en
['en', 'en', 'en']
True
test_get_condition_capabilities_config_parameter
( hass, client, climate_radio_thermostat_ct100_plus, integration )
Test we get the expected capabilities from a config_parameter condition.
Test we get the expected capabilities from a config_parameter condition.
async def test_get_condition_capabilities_config_parameter( hass, client, climate_radio_thermostat_ct100_plus, integration ): """Test we get the expected capabilities from a config_parameter condition.""" node = climate_radio_thermostat_ct100_plus dev_reg = device_registry.async_get(hass) device = d...
[ "async", "def", "test_get_condition_capabilities_config_parameter", "(", "hass", ",", "client", ",", "climate_radio_thermostat_ct100_plus", ",", "integration", ")", ":", "node", "=", "climate_radio_thermostat_ct100_plus", "dev_reg", "=", "device_registry", ".", "async_get", ...
[ 463, 0 ]
[ 542, 27 ]
python
en
['en', 'en', 'en']
True
test_failure_scenarios
(hass, client, hank_binary_switch, integration)
Test failure scenarios.
Test failure scenarios.
async def test_failure_scenarios(hass, client, hank_binary_switch, integration): """Test failure scenarios.""" dev_reg = device_registry.async_get(hass) device = device_registry.async_entries_for_config_entry( dev_reg, integration.entry_id )[0] with pytest.raises(HomeAssistantError): ...
[ "async", "def", "test_failure_scenarios", "(", "hass", ",", "client", ",", "hank_binary_switch", ",", "integration", ")", ":", "dev_reg", "=", "device_registry", ".", "async_get", "(", "hass", ")", "device", "=", "device_registry", ".", "async_entries_for_config_ent...
[ 545, 0 ]
[ 593, 5 ]
python
en
['lt', 'la', 'en']
False
test_get_value_from_config_failure
( hass, client, hank_binary_switch, integration )
Test get_value_from_config invalid value ID.
Test get_value_from_config invalid value ID.
async def test_get_value_from_config_failure( hass, client, hank_binary_switch, integration ): """Test get_value_from_config invalid value ID.""" with pytest.raises(vol.Invalid): get_zwave_value_from_config( hank_binary_switch, { "command_class": CommandClass....
[ "async", "def", "test_get_value_from_config_failure", "(", "hass", ",", "client", ",", "hank_binary_switch", ",", "integration", ")", ":", "with", "pytest", ".", "raises", "(", "vol", ".", "Invalid", ")", ":", "get_zwave_value_from_config", "(", "hank_binary_switch"...
[ 596, 0 ]
[ 609, 9 ]
python
en
['en', 'en', 'en']
True
async_setup_sensor
(hass, devices={}, structures={})
Set up the platform and prerequisites.
Set up the platform and prerequisites.
async def async_setup_sensor(hass, devices={}, structures={}): """Set up the platform and prerequisites.""" return await async_setup_sdm_platform(hass, PLATFORM, devices, structures)
[ "async", "def", "async_setup_sensor", "(", "hass", ",", "devices", "=", "{", "}", ",", "structures", "=", "{", "}", ")", ":", "return", "await", "async_setup_sdm_platform", "(", "hass", ",", "PLATFORM", ",", "devices", ",", "structures", ")" ]
[ 19, 0 ]
[ 21, 78 ]
python
en
['en', 'en', 'en']
True
test_thermostat_device
(hass)
Test a thermostat with temperature and humidity sensors.
Test a thermostat with temperature and humidity sensors.
async def test_thermostat_device(hass): """Test a thermostat with temperature and humidity sensors.""" devices = { "some-device-id": Device.MakeDevice( { "name": "some-device-id", "type": THERMOSTAT_TYPE, "traits": { "sdm.de...
[ "async", "def", "test_thermostat_device", "(", "hass", ")", ":", "devices", "=", "{", "\"some-device-id\"", ":", "Device", ".", "MakeDevice", "(", "{", "\"name\"", ":", "\"some-device-id\"", ",", "\"type\"", ":", "THERMOSTAT_TYPE", ",", "\"traits\"", ":", "{", ...
[ 24, 0 ]
[ 66, 61 ]
python
en
['en', 'en', 'en']
True
test_no_devices
(hass)
Test no devices returned by the api.
Test no devices returned by the api.
async def test_no_devices(hass): """Test no devices returned by the api.""" await async_setup_sensor(hass) temperature = hass.states.get("sensor.my_sensor_temperature") assert temperature is None humidity = hass.states.get("sensor.my_sensor_humidity") assert humidity is None
[ "async", "def", "test_no_devices", "(", "hass", ")", ":", "await", "async_setup_sensor", "(", "hass", ")", "temperature", "=", "hass", ".", "states", ".", "get", "(", "\"sensor.my_sensor_temperature\"", ")", "assert", "temperature", "is", "None", "humidity", "="...
[ 69, 0 ]
[ 77, 27 ]
python
en
['en', 'en', 'en']
True
test_device_no_sensor_traits
(hass)
Test a device with applicable sensor traits.
Test a device with applicable sensor traits.
async def test_device_no_sensor_traits(hass): """Test a device with applicable sensor traits.""" devices = { "some-device-id": Device.MakeDevice( { "name": "some-device-id", "type": THERMOSTAT_TYPE, "traits": {}, }, auth...
[ "async", "def", "test_device_no_sensor_traits", "(", "hass", ")", ":", "devices", "=", "{", "\"some-device-id\"", ":", "Device", ".", "MakeDevice", "(", "{", "\"name\"", ":", "\"some-device-id\"", ",", "\"type\"", ":", "THERMOSTAT_TYPE", ",", "\"traits\"", ":", ...
[ 80, 0 ]
[ 98, 27 ]
python
en
['en', 'en', 'en']
True
test_device_name_from_structure
(hass)
Test a device without a custom name, inferring name from structure.
Test a device without a custom name, inferring name from structure.
async def test_device_name_from_structure(hass): """Test a device without a custom name, inferring name from structure.""" devices = { "some-device-id": Device.MakeDevice( { "name": "some-device-id", "type": THERMOSTAT_TYPE, "traits": { ...
[ "async", "def", "test_device_name_from_structure", "(", "hass", ")", ":", "devices", "=", "{", "\"some-device-id\"", ":", "Device", ".", "MakeDevice", "(", "{", "\"name\"", ":", "\"some-device-id\"", ",", "\"type\"", ":", "THERMOSTAT_TYPE", ",", "\"traits\"", ":",...
[ 101, 0 ]
[ 124, 38 ]
python
en
['en', 'en', 'en']
True
test_event_updates_sensor
(hass)
Test a pubsub message received by subscriber to update temperature.
Test a pubsub message received by subscriber to update temperature.
async def test_event_updates_sensor(hass): """Test a pubsub message received by subscriber to update temperature.""" devices = { "some-device-id": Device.MakeDevice( { "name": "some-device-id", "type": THERMOSTAT_TYPE, "traits": { ...
[ "async", "def", "test_event_updates_sensor", "(", "hass", ")", ":", "devices", "=", "{", "\"some-device-id\"", ":", "Device", ".", "MakeDevice", "(", "{", "\"name\"", ":", "\"some-device-id\"", ",", "\"type\"", ":", "THERMOSTAT_TYPE", ",", "\"traits\"", ":", "{"...
[ 127, 0 ]
[ 173, 38 ]
python
en
['en', 'en', 'en']
True
test_device_with_unknown_type
(hass)
Test a device without a custom name, inferring name from structure.
Test a device without a custom name, inferring name from structure.
async def test_device_with_unknown_type(hass): """Test a device without a custom name, inferring name from structure.""" devices = { "some-device-id": Device.MakeDevice( { "name": "some-device-id", "type": "some-unknown-type", "traits": { ...
[ "async", "def", "test_device_with_unknown_type", "(", "hass", ")", ":", "devices", "=", "{", "\"some-device-id\"", ":", "Device", ".", "MakeDevice", "(", "{", "\"name\"", ":", "\"some-device-id\"", ",", "\"type\"", ":", "\"some-unknown-type\"", ",", "\"traits\"", ...
[ 176, 0 ]
[ 211, 61 ]
python
en
['en', 'en', 'en']
True
async_setup_platform
(hass, config, async_add_entities, discovery_info=None)
Perform the setup for Envisalink alarm panels.
Perform the setup for Envisalink alarm panels.
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Perform the setup for Envisalink alarm panels.""" configured_partitions = discovery_info["partitions"] code = discovery_info[CONF_CODE] panic_type = discovery_info[CONF_PANIC] devices = [] for part_num in ...
[ "async", "def", "async_setup_platform", "(", "hass", ",", "config", ",", "async_add_entities", ",", "discovery_info", "=", "None", ")", ":", "configured_partitions", "=", "discovery_info", "[", "\"partitions\"", "]", "code", "=", "discovery_info", "[", "CONF_CODE", ...
[ 53, 0 ]
[ 95, 15 ]
python
en
['en', 'da', 'en']
True
EnvisalinkAlarm.__init__
( self, hass, partition_number, alarm_name, code, panic_type, info, controller )
Initialize the alarm panel.
Initialize the alarm panel.
def __init__( self, hass, partition_number, alarm_name, code, panic_type, info, controller ): """Initialize the alarm panel.""" self._partition_number = partition_number self._code = code self._panic_type = panic_type _LOGGER.debug("Setting up alarm: %s", alarm_name)...
[ "def", "__init__", "(", "self", ",", "hass", ",", "partition_number", ",", "alarm_name", ",", "code", ",", "panic_type", ",", "info", ",", "controller", ")", ":", "self", ".", "_partition_number", "=", "partition_number", "self", ".", "_code", "=", "code", ...
[ 101, 4 ]
[ 110, 54 ]
python
en
['en', 'en', 'en']
True
EnvisalinkAlarm.async_added_to_hass
(self)
Register callbacks.
Register callbacks.
async def async_added_to_hass(self): """Register callbacks.""" self.async_on_remove( async_dispatcher_connect( self.hass, SIGNAL_KEYPAD_UPDATE, self._update_callback ) ) self.async_on_remove( async_dispatcher_connect( se...
[ "async", "def", "async_added_to_hass", "(", "self", ")", ":", "self", ".", "async_on_remove", "(", "async_dispatcher_connect", "(", "self", ".", "hass", ",", "SIGNAL_KEYPAD_UPDATE", ",", "self", ".", "_update_callback", ")", ")", "self", ".", "async_on_remove", ...
[ 112, 4 ]
[ 123, 9 ]
python
en
['en', 'no', 'en']
False
EnvisalinkAlarm._update_callback
(self, partition)
Update Home Assistant state, if needed.
Update Home Assistant state, if needed.
def _update_callback(self, partition): """Update Home Assistant state, if needed.""" if partition is None or int(partition) == self._partition_number: self.async_write_ha_state()
[ "def", "_update_callback", "(", "self", ",", "partition", ")", ":", "if", "partition", "is", "None", "or", "int", "(", "partition", ")", "==", "self", ".", "_partition_number", ":", "self", ".", "async_write_ha_state", "(", ")" ]
[ 126, 4 ]
[ 129, 39 ]
python
en
['en', 'en', 'en']
True
EnvisalinkAlarm.code_format
(self)
Regex for code format or None if no code is required.
Regex for code format or None if no code is required.
def code_format(self): """Regex for code format or None if no code is required.""" if self._code: return None return FORMAT_NUMBER
[ "def", "code_format", "(", "self", ")", ":", "if", "self", ".", "_code", ":", "return", "None", "return", "FORMAT_NUMBER" ]
[ 132, 4 ]
[ 136, 28 ]
python
en
['en', 'en', 'en']
True
EnvisalinkAlarm.state
(self)
Return the state of the device.
Return the state of the device.
def state(self): """Return the state of the device.""" state = STATE_UNKNOWN if self._info["status"]["alarm"]: state = STATE_ALARM_TRIGGERED elif self._info["status"]["armed_zero_entry_delay"]: state = STATE_ALARM_ARMED_NIGHT elif self._info["status"]["ar...
[ "def", "state", "(", "self", ")", ":", "state", "=", "STATE_UNKNOWN", "if", "self", ".", "_info", "[", "\"status\"", "]", "[", "\"alarm\"", "]", ":", "state", "=", "STATE_ALARM_TRIGGERED", "elif", "self", ".", "_info", "[", "\"status\"", "]", "[", "\"arm...
[ 139, 4 ]
[ 157, 20 ]
python
en
['en', 'en', 'en']
True
EnvisalinkAlarm.supported_features
(self)
Return the list of supported features.
Return the list of supported features.
def supported_features(self) -> int: """Return the list of supported features.""" return ( SUPPORT_ALARM_ARM_HOME | SUPPORT_ALARM_ARM_AWAY | SUPPORT_ALARM_ARM_NIGHT | SUPPORT_ALARM_TRIGGER )
[ "def", "supported_features", "(", "self", ")", "->", "int", ":", "return", "(", "SUPPORT_ALARM_ARM_HOME", "|", "SUPPORT_ALARM_ARM_AWAY", "|", "SUPPORT_ALARM_ARM_NIGHT", "|", "SUPPORT_ALARM_TRIGGER", ")" ]
[ 160, 4 ]
[ 167, 9 ]
python
en
['en', 'en', 'en']
True
EnvisalinkAlarm.async_alarm_disarm
(self, code=None)
Send disarm command.
Send disarm command.
async def async_alarm_disarm(self, code=None): """Send disarm command.""" if code: self.hass.data[DATA_EVL].disarm_partition(str(code), self._partition_number) else: self.hass.data[DATA_EVL].disarm_partition( str(self._code), self._partition_number ...
[ "async", "def", "async_alarm_disarm", "(", "self", ",", "code", "=", "None", ")", ":", "if", "code", ":", "self", ".", "hass", ".", "data", "[", "DATA_EVL", "]", ".", "disarm_partition", "(", "str", "(", "code", ")", ",", "self", ".", "_partition_numbe...
[ 169, 4 ]
[ 176, 13 ]
python
en
['en', 'pt', 'en']
True
EnvisalinkAlarm.async_alarm_arm_home
(self, code=None)
Send arm home command.
Send arm home command.
async def async_alarm_arm_home(self, code=None): """Send arm home command.""" if code: self.hass.data[DATA_EVL].arm_stay_partition( str(code), self._partition_number ) else: self.hass.data[DATA_EVL].arm_stay_partition( str(self....
[ "async", "def", "async_alarm_arm_home", "(", "self", ",", "code", "=", "None", ")", ":", "if", "code", ":", "self", ".", "hass", ".", "data", "[", "DATA_EVL", "]", ".", "arm_stay_partition", "(", "str", "(", "code", ")", ",", "self", ".", "_partition_n...
[ 178, 4 ]
[ 187, 13 ]
python
en
['en', 'pt', 'en']
True
EnvisalinkAlarm.async_alarm_arm_away
(self, code=None)
Send arm away command.
Send arm away command.
async def async_alarm_arm_away(self, code=None): """Send arm away command.""" if code: self.hass.data[DATA_EVL].arm_away_partition( str(code), self._partition_number ) else: self.hass.data[DATA_EVL].arm_away_partition( str(self....
[ "async", "def", "async_alarm_arm_away", "(", "self", ",", "code", "=", "None", ")", ":", "if", "code", ":", "self", ".", "hass", ".", "data", "[", "DATA_EVL", "]", ".", "arm_away_partition", "(", "str", "(", "code", ")", ",", "self", ".", "_partition_n...
[ 189, 4 ]
[ 198, 13 ]
python
en
['en', 'en', 'en']
True
EnvisalinkAlarm.async_alarm_trigger
(self, code=None)
Alarm trigger command. Will be used to trigger a panic alarm.
Alarm trigger command. Will be used to trigger a panic alarm.
async def async_alarm_trigger(self, code=None): """Alarm trigger command. Will be used to trigger a panic alarm.""" self.hass.data[DATA_EVL].panic_alarm(self._panic_type)
[ "async", "def", "async_alarm_trigger", "(", "self", ",", "code", "=", "None", ")", ":", "self", ".", "hass", ".", "data", "[", "DATA_EVL", "]", ".", "panic_alarm", "(", "self", ".", "_panic_type", ")" ]
[ 200, 4 ]
[ 202, 62 ]
python
en
['en', 'en', 'en']
True
EnvisalinkAlarm.async_alarm_arm_night
(self, code=None)
Send arm night command.
Send arm night command.
async def async_alarm_arm_night(self, code=None): """Send arm night command.""" self.hass.data[DATA_EVL].arm_night_partition( str(code) if code else str(self._code), self._partition_number )
[ "async", "def", "async_alarm_arm_night", "(", "self", ",", "code", "=", "None", ")", ":", "self", ".", "hass", ".", "data", "[", "DATA_EVL", "]", ".", "arm_night_partition", "(", "str", "(", "code", ")", "if", "code", "else", "str", "(", "self", ".", ...
[ 204, 4 ]
[ 208, 9 ]
python
en
['en', 'zh', 'en']
True
EnvisalinkAlarm.async_alarm_keypress
(self, keypress=None)
Send custom keypress.
Send custom keypress.
def async_alarm_keypress(self, keypress=None): """Send custom keypress.""" if keypress: self.hass.data[DATA_EVL].keypresses_to_partition( self._partition_number, keypress )
[ "def", "async_alarm_keypress", "(", "self", ",", "keypress", "=", "None", ")", ":", "if", "keypress", ":", "self", ".", "hass", ".", "data", "[", "DATA_EVL", "]", ".", "keypresses_to_partition", "(", "self", ".", "_partition_number", ",", "keypress", ")" ]
[ 211, 4 ]
[ 216, 13 ]
python
en
['en', 'cy', 'en']
True
AdditionalPropertiesClass.__init__
(self, map_string=None, map_number=None, map_integer=None, map_boolean=None, map_array_integer=None, map_array_anytype=None, map_map_string=None, map_map_anytype=None, anytype_1=None, anytype_2=None, anytype_3=None, local_vars_configuration=None)
AdditionalPropertiesClass - a model defined in OpenAPI
AdditionalPropertiesClass - a model defined in OpenAPI
def __init__(self, map_string=None, map_number=None, map_integer=None, map_boolean=None, map_array_integer=None, map_array_anytype=None, map_map_string=None, map_map_anytype=None, anytype_1=None, anytype_2=None, anytype_3=None, local_vars_configuration=None): # noqa: E501 """AdditionalPropertiesClass - a model...
[ "def", "__init__", "(", "self", ",", "map_string", "=", "None", ",", "map_number", "=", "None", ",", "map_integer", "=", "None", ",", "map_boolean", "=", "None", ",", "map_array_integer", "=", "None", ",", "map_array_anytype", "=", "None", ",", "map_map_stri...
[ 62, 4 ]
[ 102, 38 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.map_string
(self)
Gets the map_string of this AdditionalPropertiesClass. # noqa: E501 :return: The map_string of this AdditionalPropertiesClass. # noqa: E501 :rtype: dict(str, str)
Gets the map_string of this AdditionalPropertiesClass. # noqa: E501
def map_string(self): """Gets the map_string of this AdditionalPropertiesClass. # noqa: E501 :return: The map_string of this AdditionalPropertiesClass. # noqa: E501 :rtype: dict(str, str) """ return self._map_string
[ "def", "map_string", "(", "self", ")", ":", "return", "self", ".", "_map_string" ]
[ 105, 4 ]
[ 112, 31 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.map_string
(self, map_string)
Sets the map_string of this AdditionalPropertiesClass. :param map_string: The map_string of this AdditionalPropertiesClass. # noqa: E501 :type map_string: dict(str, str)
Sets the map_string of this AdditionalPropertiesClass.
def map_string(self, map_string): """Sets the map_string of this AdditionalPropertiesClass. :param map_string: The map_string of this AdditionalPropertiesClass. # noqa: E501 :type map_string: dict(str, str) """ self._map_string = map_string
[ "def", "map_string", "(", "self", ",", "map_string", ")", ":", "self", ".", "_map_string", "=", "map_string" ]
[ 115, 4 ]
[ 123, 37 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.map_number
(self)
Gets the map_number of this AdditionalPropertiesClass. # noqa: E501 :return: The map_number of this AdditionalPropertiesClass. # noqa: E501 :rtype: dict(str, float)
Gets the map_number of this AdditionalPropertiesClass. # noqa: E501
def map_number(self): """Gets the map_number of this AdditionalPropertiesClass. # noqa: E501 :return: The map_number of this AdditionalPropertiesClass. # noqa: E501 :rtype: dict(str, float) """ return self._map_number
[ "def", "map_number", "(", "self", ")", ":", "return", "self", ".", "_map_number" ]
[ 126, 4 ]
[ 133, 31 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.map_number
(self, map_number)
Sets the map_number of this AdditionalPropertiesClass. :param map_number: The map_number of this AdditionalPropertiesClass. # noqa: E501 :type map_number: dict(str, float)
Sets the map_number of this AdditionalPropertiesClass.
def map_number(self, map_number): """Sets the map_number of this AdditionalPropertiesClass. :param map_number: The map_number of this AdditionalPropertiesClass. # noqa: E501 :type map_number: dict(str, float) """ self._map_number = map_number
[ "def", "map_number", "(", "self", ",", "map_number", ")", ":", "self", ".", "_map_number", "=", "map_number" ]
[ 136, 4 ]
[ 144, 37 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.map_integer
(self)
Gets the map_integer of this AdditionalPropertiesClass. # noqa: E501 :return: The map_integer of this AdditionalPropertiesClass. # noqa: E501 :rtype: dict(str, int)
Gets the map_integer of this AdditionalPropertiesClass. # noqa: E501
def map_integer(self): """Gets the map_integer of this AdditionalPropertiesClass. # noqa: E501 :return: The map_integer of this AdditionalPropertiesClass. # noqa: E501 :rtype: dict(str, int) """ return self._map_integer
[ "def", "map_integer", "(", "self", ")", ":", "return", "self", ".", "_map_integer" ]
[ 147, 4 ]
[ 154, 32 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.map_integer
(self, map_integer)
Sets the map_integer of this AdditionalPropertiesClass. :param map_integer: The map_integer of this AdditionalPropertiesClass. # noqa: E501 :type map_integer: dict(str, int)
Sets the map_integer of this AdditionalPropertiesClass.
def map_integer(self, map_integer): """Sets the map_integer of this AdditionalPropertiesClass. :param map_integer: The map_integer of this AdditionalPropertiesClass. # noqa: E501 :type map_integer: dict(str, int) """ self._map_integer = map_integer
[ "def", "map_integer", "(", "self", ",", "map_integer", ")", ":", "self", ".", "_map_integer", "=", "map_integer" ]
[ 157, 4 ]
[ 165, 39 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.map_boolean
(self)
Gets the map_boolean of this AdditionalPropertiesClass. # noqa: E501 :return: The map_boolean of this AdditionalPropertiesClass. # noqa: E501 :rtype: dict(str, bool)
Gets the map_boolean of this AdditionalPropertiesClass. # noqa: E501
def map_boolean(self): """Gets the map_boolean of this AdditionalPropertiesClass. # noqa: E501 :return: The map_boolean of this AdditionalPropertiesClass. # noqa: E501 :rtype: dict(str, bool) """ return self._map_boolean
[ "def", "map_boolean", "(", "self", ")", ":", "return", "self", ".", "_map_boolean" ]
[ 168, 4 ]
[ 175, 32 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.map_boolean
(self, map_boolean)
Sets the map_boolean of this AdditionalPropertiesClass. :param map_boolean: The map_boolean of this AdditionalPropertiesClass. # noqa: E501 :type map_boolean: dict(str, bool)
Sets the map_boolean of this AdditionalPropertiesClass.
def map_boolean(self, map_boolean): """Sets the map_boolean of this AdditionalPropertiesClass. :param map_boolean: The map_boolean of this AdditionalPropertiesClass. # noqa: E501 :type map_boolean: dict(str, bool) """ self._map_boolean = map_boolean
[ "def", "map_boolean", "(", "self", ",", "map_boolean", ")", ":", "self", ".", "_map_boolean", "=", "map_boolean" ]
[ 178, 4 ]
[ 186, 39 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.map_array_integer
(self)
Gets the map_array_integer of this AdditionalPropertiesClass. # noqa: E501 :return: The map_array_integer of this AdditionalPropertiesClass. # noqa: E501 :rtype: dict(str, list[int])
Gets the map_array_integer of this AdditionalPropertiesClass. # noqa: E501
def map_array_integer(self): """Gets the map_array_integer of this AdditionalPropertiesClass. # noqa: E501 :return: The map_array_integer of this AdditionalPropertiesClass. # noqa: E501 :rtype: dict(str, list[int]) """ return self._map_array_integer
[ "def", "map_array_integer", "(", "self", ")", ":", "return", "self", ".", "_map_array_integer" ]
[ 189, 4 ]
[ 196, 38 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.map_array_integer
(self, map_array_integer)
Sets the map_array_integer of this AdditionalPropertiesClass. :param map_array_integer: The map_array_integer of this AdditionalPropertiesClass. # noqa: E501 :type map_array_integer: dict(str, list[int])
Sets the map_array_integer of this AdditionalPropertiesClass.
def map_array_integer(self, map_array_integer): """Sets the map_array_integer of this AdditionalPropertiesClass. :param map_array_integer: The map_array_integer of this AdditionalPropertiesClass. # noqa: E501 :type map_array_integer: dict(str, list[int]) """ self._map_array_i...
[ "def", "map_array_integer", "(", "self", ",", "map_array_integer", ")", ":", "self", ".", "_map_array_integer", "=", "map_array_integer" ]
[ 199, 4 ]
[ 207, 51 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.map_array_anytype
(self)
Gets the map_array_anytype of this AdditionalPropertiesClass. # noqa: E501 :return: The map_array_anytype of this AdditionalPropertiesClass. # noqa: E501 :rtype: dict(str, list[object])
Gets the map_array_anytype of this AdditionalPropertiesClass. # noqa: E501
def map_array_anytype(self): """Gets the map_array_anytype of this AdditionalPropertiesClass. # noqa: E501 :return: The map_array_anytype of this AdditionalPropertiesClass. # noqa: E501 :rtype: dict(str, list[object]) """ return self._map_array_anytype
[ "def", "map_array_anytype", "(", "self", ")", ":", "return", "self", ".", "_map_array_anytype" ]
[ 210, 4 ]
[ 217, 38 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.map_array_anytype
(self, map_array_anytype)
Sets the map_array_anytype of this AdditionalPropertiesClass. :param map_array_anytype: The map_array_anytype of this AdditionalPropertiesClass. # noqa: E501 :type map_array_anytype: dict(str, list[object])
Sets the map_array_anytype of this AdditionalPropertiesClass.
def map_array_anytype(self, map_array_anytype): """Sets the map_array_anytype of this AdditionalPropertiesClass. :param map_array_anytype: The map_array_anytype of this AdditionalPropertiesClass. # noqa: E501 :type map_array_anytype: dict(str, list[object]) """ self._map_arra...
[ "def", "map_array_anytype", "(", "self", ",", "map_array_anytype", ")", ":", "self", ".", "_map_array_anytype", "=", "map_array_anytype" ]
[ 220, 4 ]
[ 228, 51 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.map_map_string
(self)
Gets the map_map_string of this AdditionalPropertiesClass. # noqa: E501 :return: The map_map_string of this AdditionalPropertiesClass. # noqa: E501 :rtype: dict(str, dict(str, str))
Gets the map_map_string of this AdditionalPropertiesClass. # noqa: E501
def map_map_string(self): """Gets the map_map_string of this AdditionalPropertiesClass. # noqa: E501 :return: The map_map_string of this AdditionalPropertiesClass. # noqa: E501 :rtype: dict(str, dict(str, str)) """ return self._map_map_string
[ "def", "map_map_string", "(", "self", ")", ":", "return", "self", ".", "_map_map_string" ]
[ 231, 4 ]
[ 238, 35 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.map_map_string
(self, map_map_string)
Sets the map_map_string of this AdditionalPropertiesClass. :param map_map_string: The map_map_string of this AdditionalPropertiesClass. # noqa: E501 :type map_map_string: dict(str, dict(str, str))
Sets the map_map_string of this AdditionalPropertiesClass.
def map_map_string(self, map_map_string): """Sets the map_map_string of this AdditionalPropertiesClass. :param map_map_string: The map_map_string of this AdditionalPropertiesClass. # noqa: E501 :type map_map_string: dict(str, dict(str, str)) """ self._map_map_string = map_map...
[ "def", "map_map_string", "(", "self", ",", "map_map_string", ")", ":", "self", ".", "_map_map_string", "=", "map_map_string" ]
[ 241, 4 ]
[ 249, 45 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.map_map_anytype
(self)
Gets the map_map_anytype of this AdditionalPropertiesClass. # noqa: E501 :return: The map_map_anytype of this AdditionalPropertiesClass. # noqa: E501 :rtype: dict(str, dict(str, object))
Gets the map_map_anytype of this AdditionalPropertiesClass. # noqa: E501
def map_map_anytype(self): """Gets the map_map_anytype of this AdditionalPropertiesClass. # noqa: E501 :return: The map_map_anytype of this AdditionalPropertiesClass. # noqa: E501 :rtype: dict(str, dict(str, object)) """ return self._map_map_anytype
[ "def", "map_map_anytype", "(", "self", ")", ":", "return", "self", ".", "_map_map_anytype" ]
[ 252, 4 ]
[ 259, 36 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.map_map_anytype
(self, map_map_anytype)
Sets the map_map_anytype of this AdditionalPropertiesClass. :param map_map_anytype: The map_map_anytype of this AdditionalPropertiesClass. # noqa: E501 :type map_map_anytype: dict(str, dict(str, object))
Sets the map_map_anytype of this AdditionalPropertiesClass.
def map_map_anytype(self, map_map_anytype): """Sets the map_map_anytype of this AdditionalPropertiesClass. :param map_map_anytype: The map_map_anytype of this AdditionalPropertiesClass. # noqa: E501 :type map_map_anytype: dict(str, dict(str, object)) """ self._map_map_anytype...
[ "def", "map_map_anytype", "(", "self", ",", "map_map_anytype", ")", ":", "self", ".", "_map_map_anytype", "=", "map_map_anytype" ]
[ 262, 4 ]
[ 270, 47 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.anytype_1
(self)
Gets the anytype_1 of this AdditionalPropertiesClass. # noqa: E501 :return: The anytype_1 of this AdditionalPropertiesClass. # noqa: E501 :rtype: object
Gets the anytype_1 of this AdditionalPropertiesClass. # noqa: E501
def anytype_1(self): """Gets the anytype_1 of this AdditionalPropertiesClass. # noqa: E501 :return: The anytype_1 of this AdditionalPropertiesClass. # noqa: E501 :rtype: object """ return self._anytype_1
[ "def", "anytype_1", "(", "self", ")", ":", "return", "self", ".", "_anytype_1" ]
[ 273, 4 ]
[ 280, 30 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.anytype_1
(self, anytype_1)
Sets the anytype_1 of this AdditionalPropertiesClass. :param anytype_1: The anytype_1 of this AdditionalPropertiesClass. # noqa: E501 :type anytype_1: object
Sets the anytype_1 of this AdditionalPropertiesClass.
def anytype_1(self, anytype_1): """Sets the anytype_1 of this AdditionalPropertiesClass. :param anytype_1: The anytype_1 of this AdditionalPropertiesClass. # noqa: E501 :type anytype_1: object """ self._anytype_1 = anytype_1
[ "def", "anytype_1", "(", "self", ",", "anytype_1", ")", ":", "self", ".", "_anytype_1", "=", "anytype_1" ]
[ 283, 4 ]
[ 291, 35 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.anytype_2
(self)
Gets the anytype_2 of this AdditionalPropertiesClass. # noqa: E501 :return: The anytype_2 of this AdditionalPropertiesClass. # noqa: E501 :rtype: object
Gets the anytype_2 of this AdditionalPropertiesClass. # noqa: E501
def anytype_2(self): """Gets the anytype_2 of this AdditionalPropertiesClass. # noqa: E501 :return: The anytype_2 of this AdditionalPropertiesClass. # noqa: E501 :rtype: object """ return self._anytype_2
[ "def", "anytype_2", "(", "self", ")", ":", "return", "self", ".", "_anytype_2" ]
[ 294, 4 ]
[ 301, 30 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.anytype_2
(self, anytype_2)
Sets the anytype_2 of this AdditionalPropertiesClass. :param anytype_2: The anytype_2 of this AdditionalPropertiesClass. # noqa: E501 :type anytype_2: object
Sets the anytype_2 of this AdditionalPropertiesClass.
def anytype_2(self, anytype_2): """Sets the anytype_2 of this AdditionalPropertiesClass. :param anytype_2: The anytype_2 of this AdditionalPropertiesClass. # noqa: E501 :type anytype_2: object """ self._anytype_2 = anytype_2
[ "def", "anytype_2", "(", "self", ",", "anytype_2", ")", ":", "self", ".", "_anytype_2", "=", "anytype_2" ]
[ 304, 4 ]
[ 312, 35 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.anytype_3
(self)
Gets the anytype_3 of this AdditionalPropertiesClass. # noqa: E501 :return: The anytype_3 of this AdditionalPropertiesClass. # noqa: E501 :rtype: object
Gets the anytype_3 of this AdditionalPropertiesClass. # noqa: E501
def anytype_3(self): """Gets the anytype_3 of this AdditionalPropertiesClass. # noqa: E501 :return: The anytype_3 of this AdditionalPropertiesClass. # noqa: E501 :rtype: object """ return self._anytype_3
[ "def", "anytype_3", "(", "self", ")", ":", "return", "self", ".", "_anytype_3" ]
[ 315, 4 ]
[ 322, 30 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.anytype_3
(self, anytype_3)
Sets the anytype_3 of this AdditionalPropertiesClass. :param anytype_3: The anytype_3 of this AdditionalPropertiesClass. # noqa: E501 :type anytype_3: object
Sets the anytype_3 of this AdditionalPropertiesClass.
def anytype_3(self, anytype_3): """Sets the anytype_3 of this AdditionalPropertiesClass. :param anytype_3: The anytype_3 of this AdditionalPropertiesClass. # noqa: E501 :type anytype_3: object """ self._anytype_3 = anytype_3
[ "def", "anytype_3", "(", "self", ",", "anytype_3", ")", ":", "self", ".", "_anytype_3", "=", "anytype_3" ]
[ 325, 4 ]
[ 333, 35 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.to_dict
(self, serialize=False)
Returns the model properties as a dict
Returns the model properties as a dict
def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} def convert(x): if hasattr(x, "to_dict"): args = inspect.getargspec(x.to_dict).args if len(args) == 1: return x.to_dict() ...
[ "def", "to_dict", "(", "self", ",", "serialize", "=", "False", ")", ":", "result", "=", "{", "}", "def", "convert", "(", "x", ")", ":", "if", "hasattr", "(", "x", ",", "\"to_dict\"", ")", ":", "args", "=", "inspect", ".", "getargspec", "(", "x", ...
[ 335, 4 ]
[ 365, 21 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.to_str
(self)
Returns the string representation of the model
Returns the string representation of the model
def to_str(self): """Returns the string representation of the model""" return pprint.pformat(self.to_dict())
[ "def", "to_str", "(", "self", ")", ":", "return", "pprint", ".", "pformat", "(", "self", ".", "to_dict", "(", ")", ")" ]
[ 367, 4 ]
[ 369, 45 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.__repr__
(self)
For `print` and `pprint`
For `print` and `pprint`
def __repr__(self): """For `print` and `pprint`""" return self.to_str()
[ "def", "__repr__", "(", "self", ")", ":", "return", "self", ".", "to_str", "(", ")" ]
[ 371, 4 ]
[ 373, 28 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.__eq__
(self, other)
Returns true if both objects are equal
Returns true if both objects are equal
def __eq__(self, other): """Returns true if both objects are equal""" if not isinstance(other, AdditionalPropertiesClass): return False return self.to_dict() == other.to_dict()
[ "def", "__eq__", "(", "self", ",", "other", ")", ":", "if", "not", "isinstance", "(", "other", ",", "AdditionalPropertiesClass", ")", ":", "return", "False", "return", "self", ".", "to_dict", "(", ")", "==", "other", ".", "to_dict", "(", ")" ]
[ 375, 4 ]
[ 380, 48 ]
python
en
['en', 'en', 'en']
True
AdditionalPropertiesClass.__ne__
(self, other)
Returns true if both objects are not equal
Returns true if both objects are not equal
def __ne__(self, other): """Returns true if both objects are not equal""" if not isinstance(other, AdditionalPropertiesClass): return True return self.to_dict() != other.to_dict()
[ "def", "__ne__", "(", "self", ",", "other", ")", ":", "if", "not", "isinstance", "(", "other", ",", "AdditionalPropertiesClass", ")", ":", "return", "True", "return", "self", ".", "to_dict", "(", ")", "!=", "other", ".", "to_dict", "(", ")" ]
[ 382, 4 ]
[ 387, 48 ]
python
en
['en', 'en', 'en']
True
BSBLanFlowHandler.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 user_input is None: return self._show_setup_form() try: info = await self._get_bsblan_info( host=user_inpu...
[ "async", "def", "async_step_user", "(", "self", ",", "user_input", ":", "dict", "[", "str", ",", "Any", "]", "|", "None", "=", "None", ")", "->", "FlowResult", ":", "if", "user_input", "is", "None", ":", "return", "self", ".", "_show_setup_form", "(", ...
[ 24, 4 ]
[ 56, 9 ]
python
en
['en', 'en', 'en']
True
BSBLanFlowHandler._show_setup_form
(self, errors: dict | None = None)
Show the setup form to the user.
Show the setup form to the user.
def _show_setup_form(self, errors: dict | None = None) -> FlowResult: """Show the setup form to the user.""" return self.async_show_form( step_id="user", data_schema=vol.Schema( { vol.Required(CONF_HOST): str, vol.Optional(C...
[ "def", "_show_setup_form", "(", "self", ",", "errors", ":", "dict", "|", "None", "=", "None", ")", "->", "FlowResult", ":", "return", "self", ".", "async_show_form", "(", "step_id", "=", "\"user\"", ",", "data_schema", "=", "vol", ".", "Schema", "(", "{"...
[ 58, 4 ]
[ 72, 9 ]
python
en
['en', 'en', 'en']
True
BSBLanFlowHandler._get_bsblan_info
( self, host: str, username: str | None, password: str | None, passkey: str | None, port: int, )
Get device information from an BSBLan device.
Get device information from an BSBLan device.
async def _get_bsblan_info( self, host: str, username: str | None, password: str | None, passkey: str | None, port: int, ) -> Info: """Get device information from an BSBLan device.""" session = async_get_clientsession(self.hass) _LOGGER.debug("...
[ "async", "def", "_get_bsblan_info", "(", "self", ",", "host", ":", "str", ",", "username", ":", "str", "|", "None", ",", "password", ":", "str", "|", "None", ",", "passkey", ":", "str", "|", "None", ",", "port", ":", "int", ",", ")", "->", "Info", ...
[ 74, 4 ]
[ 93, 34 ]
python
en
['en', 'en', 'en']
True
zigpy_cover_device
(zigpy_device_mock)
Zigpy cover device.
Zigpy cover device.
def zigpy_cover_device(zigpy_device_mock): """Zigpy cover device.""" endpoints = { 1: { SIG_EP_PROFILE: zigpy.profiles.zha.PROFILE_ID, SIG_EP_TYPE: zigpy.profiles.zha.DeviceType.IAS_ZONE, SIG_EP_INPUT: [closures.WindowCovering.cluster_id], SIG_EP_OUTPUT: ...
[ "def", "zigpy_cover_device", "(", "zigpy_device_mock", ")", ":", "endpoints", "=", "{", "1", ":", "{", "SIG_EP_PROFILE", ":", "zigpy", ".", "profiles", ".", "zha", ".", "PROFILE_ID", ",", "SIG_EP_TYPE", ":", "zigpy", ".", "profiles", ".", "zha", ".", "Devi...
[ 40, 0 ]
[ 51, 39 ]
python
en
['nl', 'en', 'en']
True
zigpy_cover_remote
(zigpy_device_mock)
Zigpy cover remote device.
Zigpy cover remote device.
def zigpy_cover_remote(zigpy_device_mock): """Zigpy cover remote device.""" endpoints = { 1: { SIG_EP_PROFILE: zigpy.profiles.zha.PROFILE_ID, SIG_EP_TYPE: zigpy.profiles.zha.DeviceType.WINDOW_COVERING_CONTROLLER, SIG_EP_INPUT: [], SIG_EP_OUTPUT: [closures...
[ "def", "zigpy_cover_remote", "(", "zigpy_device_mock", ")", ":", "endpoints", "=", "{", "1", ":", "{", "SIG_EP_PROFILE", ":", "zigpy", ".", "profiles", ".", "zha", ".", "PROFILE_ID", ",", "SIG_EP_TYPE", ":", "zigpy", ".", "profiles", ".", "zha", ".", "Devi...
[ 55, 0 ]
[ 66, 39 ]
python
en
['fr', 'en', 'en']
True
zigpy_shade_device
(zigpy_device_mock)
Zigpy shade device.
Zigpy shade device.
def zigpy_shade_device(zigpy_device_mock): """Zigpy shade device.""" endpoints = { 1: { SIG_EP_PROFILE: zigpy.profiles.zha.PROFILE_ID, SIG_EP_TYPE: zigpy.profiles.zha.DeviceType.SHADE, SIG_EP_INPUT: [ closures.Shade.cluster_id, general...
[ "def", "zigpy_shade_device", "(", "zigpy_device_mock", ")", ":", "endpoints", "=", "{", "1", ":", "{", "SIG_EP_PROFILE", ":", "zigpy", ".", "profiles", ".", "zha", ".", "PROFILE_ID", ",", "SIG_EP_TYPE", ":", "zigpy", ".", "profiles", ".", "zha", ".", "Devi...
[ 70, 0 ]
[ 85, 39 ]
python
en
['fr', 'en', 'en']
True
zigpy_keen_vent
(zigpy_device_mock)
Zigpy Keen Vent device.
Zigpy Keen Vent device.
def zigpy_keen_vent(zigpy_device_mock): """Zigpy Keen Vent device.""" endpoints = { 1: { SIG_EP_PROFILE: zigpy.profiles.zha.PROFILE_ID, SIG_EP_TYPE: zigpy.profiles.zha.DeviceType.LEVEL_CONTROLLABLE_OUTPUT, SIG_EP_INPUT: [general.LevelControl.cluster_id, general.OnOff...
[ "def", "zigpy_keen_vent", "(", "zigpy_device_mock", ")", ":", "endpoints", "=", "{", "1", ":", "{", "SIG_EP_PROFILE", ":", "zigpy", ".", "profiles", ".", "zha", ".", "PROFILE_ID", ",", "SIG_EP_TYPE", ":", "zigpy", ".", "profiles", ".", "zha", ".", "DeviceT...
[ 89, 0 ]
[ 102, 5 ]
python
en
['nl', 'en', 'en']
True
test_cover
(m1, hass, zha_device_joined_restored, zigpy_cover_device)
Test zha cover platform.
Test zha cover platform.
async def test_cover(m1, hass, zha_device_joined_restored, zigpy_cover_device): """Test zha cover platform.""" # load up cover domain cluster = zigpy_cover_device.endpoints.get(1).window_covering cluster.PLUGGED_ATTR_READS = {"current_position_lift_percentage": 100} zha_device = await zha_device_jo...
[ "async", "def", "test_cover", "(", "m1", ",", "hass", ",", "zha_device_joined_restored", ",", "zigpy_cover_device", ")", ":", "# load up cover domain", "cluster", "=", "zigpy_cover_device", ".", "endpoints", ".", "get", "(", "1", ")", ".", "window_covering", "clus...
[ 108, 0 ]
[ 195, 57 ]
python
bg-Latn
['br', 'bg-Latn', 'pl']
False
test_shade
(hass, zha_device_joined_restored, zigpy_shade_device)
Test zha cover platform for shade device type.
Test zha cover platform for shade device type.
async def test_shade(hass, zha_device_joined_restored, zigpy_shade_device): """Test zha cover platform for shade device type.""" # load up cover domain zha_device = await zha_device_joined_restored(zigpy_shade_device) cluster_on_off = zigpy_shade_device.endpoints.get(1).on_off cluster_level = zigp...
[ "async", "def", "test_shade", "(", "hass", ",", "zha_device_joined_restored", ",", "zigpy_shade_device", ")", ":", "# load up cover domain", "zha_device", "=", "await", "zha_device_joined_restored", "(", "zigpy_shade_device", ")", "cluster_on_off", "=", "zigpy_shade_device"...
[ 198, 0 ]
[ 322, 72 ]
python
en
['br', 'en', 'en']
True
test_restore_state
(hass, zha_device_restored, zigpy_shade_device)
Ensure states are restored on startup.
Ensure states are restored on startup.
async def test_restore_state(hass, zha_device_restored, zigpy_shade_device): """Ensure states are restored on startup.""" mock_restore_cache( hass, ( State( "cover.fakemanufacturer_fakemodel_e769900a_level_on_off_shade", STATE_OPEN, {A...
[ "async", "def", "test_restore_state", "(", "hass", ",", "zha_device_restored", ",", "zigpy_shade_device", ")", ":", "mock_restore_cache", "(", "hass", ",", "(", "State", "(", "\"cover.fakemanufacturer_fakemodel_e769900a_level_on_off_shade\"", ",", "STATE_OPEN", ",", "{", ...
[ 325, 0 ]
[ 347, 77 ]
python
en
['en', 'en', 'en']
True
test_keen_vent
(hass, zha_device_joined_restored, zigpy_keen_vent)
Test keen vent.
Test keen vent.
async def test_keen_vent(hass, zha_device_joined_restored, zigpy_keen_vent): """Test keen vent.""" # load up cover domain zha_device = await zha_device_joined_restored(zigpy_keen_vent) cluster_on_off = zigpy_keen_vent.endpoints.get(1).on_off cluster_level = zigpy_keen_vent.endpoints.get(1).level ...
[ "async", "def", "test_keen_vent", "(", "hass", ",", "zha_device_joined_restored", ",", "zigpy_keen_vent", ")", ":", "# load up cover domain", "zha_device", "=", "await", "zha_device_joined_restored", "(", "zigpy_keen_vent", ")", "cluster_on_off", "=", "zigpy_keen_vent", "...
[ 350, 0 ]
[ 401, 82 ]
python
lb
['nl', 'lb', 'sw']
False
test_cover_remote
(hass, zha_device_joined_restored, zigpy_cover_remote)
Test zha cover remote.
Test zha cover remote.
async def test_cover_remote(hass, zha_device_joined_restored, zigpy_cover_remote): """Test zha cover remote.""" # load up cover domain await zha_device_joined_restored(zigpy_cover_remote) cluster = zigpy_cover_remote.endpoints[1].out_clusters[ closures.WindowCovering.cluster_id ] zha_e...
[ "async", "def", "test_cover_remote", "(", "hass", ",", "zha_device_joined_restored", ",", "zigpy_cover_remote", ")", ":", "# load up cover domain", "await", "zha_device_joined_restored", "(", "zigpy_cover_remote", ")", "cluster", "=", "zigpy_cover_remote", ".", "endpoints",...
[ 404, 0 ]
[ 429, 59 ]
python
br
['br', 'it', 'en']
False
OneWireBaseEntity.__init__
( self, description: OneWireEntityDescription, device_id: str, device_info: DeviceInfo, device_file: str, name: str, )
Initialize the entity.
Initialize the entity.
def __init__( self, description: OneWireEntityDescription, device_id: str, device_info: DeviceInfo, device_file: str, name: str, ) -> None: """Initialize the entity.""" self.entity_description = description self._attr_unique_id = f"/{device_id}...
[ "def", "__init__", "(", "self", ",", "description", ":", "OneWireEntityDescription", ",", "device_id", ":", "str", ",", "device_info", ":", "DeviceInfo", ",", "device_file", ":", "str", ",", "name", ":", "str", ",", ")", "->", "None", ":", "self", ".", "...
[ 30, 4 ]
[ 45, 44 ]
python
en
['en', 'en', 'en']
True
OneWireBaseEntity.extra_state_attributes
(self)
Return the state attributes of the entity.
Return the state attributes of the entity.
def extra_state_attributes(self) -> dict[str, Any] | None: """Return the state attributes of the entity.""" return { "device_file": self._device_file, "raw_value": self._value_raw, }
[ "def", "extra_state_attributes", "(", "self", ")", "->", "dict", "[", "str", ",", "Any", "]", "|", "None", ":", "return", "{", "\"device_file\"", ":", "self", ".", "_device_file", ",", "\"raw_value\"", ":", "self", ".", "_value_raw", ",", "}" ]
[ 48, 4 ]
[ 53, 9 ]
python
en
['en', 'en', 'en']
True
OneWireProxyEntity.__init__
( self, description: OneWireEntityDescription, device_id: str, device_info: DeviceInfo, device_file: str, name: str, owproxy: protocol._Proxy, )
Initialize the sensor.
Initialize the sensor.
def __init__( self, description: OneWireEntityDescription, device_id: str, device_info: DeviceInfo, device_file: str, name: str, owproxy: protocol._Proxy, ) -> None: """Initialize the sensor.""" super().__init__( description=descrip...
[ "def", "__init__", "(", "self", ",", "description", ":", "OneWireEntityDescription", ",", "device_id", ":", "str", ",", "device_info", ":", "DeviceInfo", ",", "device_file", ":", "str", ",", "name", ":", "str", ",", "owproxy", ":", "protocol", ".", "_Proxy",...
[ 59, 4 ]
[ 76, 31 ]
python
en
['en', 'en', 'en']
True
OneWireProxyEntity._read_value_ownet
(self)
Read a value from the owserver.
Read a value from the owserver.
def _read_value_ownet(self) -> str: """Read a value from the owserver.""" read_bytes: bytes = self._owproxy.read(self._device_file) return read_bytes.decode().lstrip()
[ "def", "_read_value_ownet", "(", "self", ")", "->", "str", ":", "read_bytes", ":", "bytes", "=", "self", ".", "_owproxy", ".", "read", "(", "self", ".", "_device_file", ")", "return", "read_bytes", ".", "decode", "(", ")", ".", "lstrip", "(", ")" ]
[ 78, 4 ]
[ 81, 43 ]
python
en
['en', 'en', 'en']
True
OneWireProxyEntity._write_value_ownet
(self, value: bytes)
Write a value to the owserver.
Write a value to the owserver.
def _write_value_ownet(self, value: bytes) -> None: """Write a value to the owserver.""" self._owproxy.write(self._device_file, value)
[ "def", "_write_value_ownet", "(", "self", ",", "value", ":", "bytes", ")", "->", "None", ":", "self", ".", "_owproxy", ".", "write", "(", "self", ".", "_device_file", ",", "value", ")" ]
[ 83, 4 ]
[ 85, 53 ]
python
en
['en', 'en', 'en']
True
OneWireProxyEntity.update
(self)
Get the latest data from the device.
Get the latest data from the device.
def update(self) -> None: """Get the latest data from the device.""" try: self._value_raw = float(self._read_value_ownet()) except protocol.Error as exc: _LOGGER.error("Owserver failure in read(), got: %s", exc) self._state = None else: if ...
[ "def", "update", "(", "self", ")", "->", "None", ":", "try", ":", "self", ".", "_value_raw", "=", "float", "(", "self", ".", "_read_value_ownet", "(", ")", ")", "except", "protocol", ".", "Error", "as", "exc", ":", "_LOGGER", ".", "error", "(", "\"Ow...
[ 87, 4 ]
[ 100, 55 ]
python
en
['en', 'en', 'en']
True
mock_finish_setup
()
Mock out the finish setup method.
Mock out the finish setup method.
def mock_finish_setup(): """Mock out the finish setup method.""" with patch( "homeassistant.components.mqtt.MQTT.async_connect", return_value=True ) as mock_finish: yield mock_finish
[ "def", "mock_finish_setup", "(", ")", ":", "with", "patch", "(", "\"homeassistant.components.mqtt.MQTT.async_connect\"", ",", "return_value", "=", "True", ")", "as", "mock_finish", ":", "yield", "mock_finish" ]
[ 16, 0 ]
[ 21, 25 ]
python
en
['en', 'zu', 'en']
True
mock_try_connection
()
Mock the try connection method.
Mock the try connection method.
def mock_try_connection(): """Mock the try connection method.""" with patch("homeassistant.components.mqtt.config_flow.try_connection") as mock_try: yield mock_try
[ "def", "mock_try_connection", "(", ")", ":", "with", "patch", "(", "\"homeassistant.components.mqtt.config_flow.try_connection\"", ")", "as", "mock_try", ":", "yield", "mock_try" ]
[ 25, 0 ]
[ 28, 22 ]
python
en
['en', 'en', 'en']
True
test_user_connection_works
(hass, mock_try_connection, mock_finish_setup)
Test we can finish a config flow.
Test we can finish a config flow.
async def test_user_connection_works(hass, mock_try_connection, mock_finish_setup): """Test we can finish a config flow.""" mock_try_connection.return_value = True result = await hass.config_entries.flow.async_init( "mqtt", context={"source": config_entries.SOURCE_USER} ) assert result["typ...
[ "async", "def", "test_user_connection_works", "(", "hass", ",", "mock_try_connection", ",", "mock_finish_setup", ")", ":", "mock_try_connection", ".", "return_value", "=", "True", "result", "=", "await", "hass", ".", "config_entries", ".", "flow", ".", "async_init",...
[ 31, 0 ]
[ 53, 49 ]
python
en
['en', 'en', 'en']
True
test_user_connection_fails
(hass, mock_try_connection, mock_finish_setup)
Test if connection cannot be made.
Test if connection cannot be made.
async def test_user_connection_fails(hass, mock_try_connection, mock_finish_setup): """Test if connection cannot be made.""" mock_try_connection.return_value = False result = await hass.config_entries.flow.async_init( "mqtt", context={"source": config_entries.SOURCE_USER} ) assert result["t...
[ "async", "def", "test_user_connection_fails", "(", "hass", ",", "mock_try_connection", ",", "mock_finish_setup", ")", ":", "mock_try_connection", ".", "return_value", "=", "False", "result", "=", "await", "hass", ".", "config_entries", ".", "flow", ".", "async_init"...
[ 56, 0 ]
[ 75, 49 ]
python
en
['en', 'en', 'en']
True
test_manual_config_set
(hass, mock_try_connection, mock_finish_setup)
Test we ignore entry if manual config available.
Test we ignore entry if manual config available.
async def test_manual_config_set(hass, mock_try_connection, mock_finish_setup): """Test we ignore entry if manual config available.""" assert await async_setup_component(hass, "mqtt", {"mqtt": {"broker": "bla"}}) await hass.async_block_till_done() assert len(mock_finish_setup.mock_calls) == 1 mock_...
[ "async", "def", "test_manual_config_set", "(", "hass", ",", "mock_try_connection", ",", "mock_finish_setup", ")", ":", "assert", "await", "async_setup_component", "(", "hass", ",", "\"mqtt\"", ",", "{", "\"mqtt\"", ":", "{", "\"broker\"", ":", "\"bla\"", "}", "}...
[ 78, 0 ]
[ 89, 36 ]
python
en
['en', 'en', 'en']
True
test_user_single_instance
(hass)
Test we only allow a single config flow.
Test we only allow a single config flow.
async def test_user_single_instance(hass): """Test we only allow a single config flow.""" MockConfigEntry(domain="mqtt").add_to_hass(hass) result = await hass.config_entries.flow.async_init( "mqtt", context={"source": config_entries.SOURCE_USER} ) assert result["type"] == "abort" assert...
[ "async", "def", "test_user_single_instance", "(", "hass", ")", ":", "MockConfigEntry", "(", "domain", "=", "\"mqtt\"", ")", ".", "add_to_hass", "(", "hass", ")", "result", "=", "await", "hass", ".", "config_entries", ".", "flow", ".", "async_init", "(", "\"m...
[ 92, 0 ]
[ 100, 56 ]
python
en
['en', 'en', 'en']
True
test_hassio_already_configured
(hass)
Test we only allow a single config flow.
Test we only allow a single config flow.
async def test_hassio_already_configured(hass): """Test we only allow a single config flow.""" MockConfigEntry(domain="mqtt").add_to_hass(hass) result = await hass.config_entries.flow.async_init( "mqtt", context={"source": config_entries.SOURCE_HASSIO} ) assert result["type"] == "abort" ...
[ "async", "def", "test_hassio_already_configured", "(", "hass", ")", ":", "MockConfigEntry", "(", "domain", "=", "\"mqtt\"", ")", ".", "add_to_hass", "(", "hass", ")", "result", "=", "await", "hass", ".", "config_entries", ".", "flow", ".", "async_init", "(", ...
[ 103, 0 ]
[ 111, 51 ]
python
en
['en', 'en', 'en']
True
test_hassio_ignored
(hass: HomeAssistant)
Test we supervisor discovered instance can be ignored.
Test we supervisor discovered instance can be ignored.
async def test_hassio_ignored(hass: HomeAssistant) -> None: """Test we supervisor discovered instance can be ignored.""" MockConfigEntry( domain=mqtt.DOMAIN, source=config_entries.SOURCE_IGNORE ).add_to_hass(hass) result = await hass.config_entries.flow.async_init( mqtt.DOMAIN, ...
[ "async", "def", "test_hassio_ignored", "(", "hass", ":", "HomeAssistant", ")", "->", "None", ":", "MockConfigEntry", "(", "domain", "=", "mqtt", ".", "DOMAIN", ",", "source", "=", "config_entries", ".", "SOURCE_IGNORE", ")", ".", "add_to_hass", "(", "hass", ...
[ 114, 0 ]
[ 127, 55 ]
python
en
['en', 'en', 'en']
True
test_hassio_confirm
(hass, mock_try_connection, mock_finish_setup)
Test we can finish a config flow.
Test we can finish a config flow.
async def test_hassio_confirm(hass, mock_try_connection, mock_finish_setup): """Test we can finish a config flow.""" mock_try_connection.return_value = True result = await hass.config_entries.flow.async_init( "mqtt", data={ "addon": "Mock Addon", "host": "mock-broker...
[ "async", "def", "test_hassio_confirm", "(", "hass", ",", "mock_try_connection", ",", "mock_finish_setup", ")", ":", "mock_try_connection", ".", "return_value", "=", "True", "result", "=", "await", "hass", ".", "config_entries", ".", "flow", ".", "async_init", "(",...
[ 130, 0 ]
[ 166, 49 ]
python
en
['en', 'en', 'en']
True
test_option_flow
(hass, mqtt_mock, mock_try_connection)
Test config flow options.
Test config flow options.
async def test_option_flow(hass, mqtt_mock, mock_try_connection): """Test config flow options.""" mock_try_connection.return_value = True config_entry = hass.config_entries.async_entries(mqtt.DOMAIN)[0] config_entry.data = { mqtt.CONF_BROKER: "test-broker", mqtt.CONF_PORT: 1234, } ...
[ "async", "def", "test_option_flow", "(", "hass", ",", "mqtt_mock", ",", "mock_try_connection", ")", ":", "mock_try_connection", ".", "return_value", "=", "True", "config_entry", "=", "hass", ".", "config_entries", ".", "async_entries", "(", "mqtt", ".", "DOMAIN", ...
[ 169, 0 ]
[ 238, 50 ]
python
en
['en', 'fr', 'en']
True
test_disable_birth_will
(hass, mqtt_mock, mock_try_connection)
Test disabling birth and will.
Test disabling birth and will.
async def test_disable_birth_will(hass, mqtt_mock, mock_try_connection): """Test disabling birth and will.""" mock_try_connection.return_value = True config_entry = hass.config_entries.async_entries(mqtt.DOMAIN)[0] config_entry.data = { mqtt.CONF_BROKER: "test-broker", mqtt.CONF_PORT: 12...
[ "async", "def", "test_disable_birth_will", "(", "hass", ",", "mqtt_mock", ",", "mock_try_connection", ")", ":", "mock_try_connection", ".", "return_value", "=", "True", "config_entry", "=", "hass", ".", "config_entries", ".", "async_entries", "(", "mqtt", ".", "DO...
[ 241, 0 ]
[ 300, 50 ]
python
en
['en', 'en', 'en']
True
get_default
(schema, key)
Get default value for key in voluptuous schema.
Get default value for key in voluptuous schema.
def get_default(schema, key): """Get default value for key in voluptuous schema.""" for k in schema.keys(): if k == key: if k.default == vol.UNDEFINED: return None return k.default()
[ "def", "get_default", "(", "schema", ",", "key", ")", ":", "for", "k", "in", "schema", ".", "keys", "(", ")", ":", "if", "k", "==", "key", ":", "if", "k", ".", "default", "==", "vol", ".", "UNDEFINED", ":", "return", "None", "return", "k", ".", ...
[ 303, 0 ]
[ 309, 30 ]
python
de
['nl', 'de', 'en']
False
get_suggested
(schema, key)
Get suggested value for key in voluptuous schema.
Get suggested value for key in voluptuous schema.
def get_suggested(schema, key): """Get suggested value for key in voluptuous schema.""" for k in schema.keys(): if k == key: if k.description is None or "suggested_value" not in k.description: return None return k.description["suggested_value"]
[ "def", "get_suggested", "(", "schema", ",", "key", ")", ":", "for", "k", "in", "schema", ".", "keys", "(", ")", ":", "if", "k", "==", "key", ":", "if", "k", ".", "description", "is", "None", "or", "\"suggested_value\"", "not", "in", "k", ".", "desc...
[ 312, 0 ]
[ 318, 51 ]
python
en
['en', 'en', 'en']
True
test_option_flow_default_suggested_values
( hass, mqtt_mock, mock_try_connection )
Test config flow options has default/suggested values.
Test config flow options has default/suggested values.
async def test_option_flow_default_suggested_values( hass, mqtt_mock, mock_try_connection ): """Test config flow options has default/suggested values.""" mock_try_connection.return_value = True config_entry = hass.config_entries.async_entries(mqtt.DOMAIN)[0] config_entry.data = { mqtt.CONF_B...
[ "async", "def", "test_option_flow_default_suggested_values", "(", "hass", ",", "mqtt_mock", ",", "mock_try_connection", ")", ":", "mock_try_connection", ".", "return_value", "=", "True", "config_entry", "=", "hass", ".", "config_entries", ".", "async_entries", "(", "m...
[ 321, 0 ]
[ 464, 69 ]
python
en
['en', 'en', 'en']
True
test_options_user_connection_fails
(hass, mock_try_connection)
Test if connection cannot be made.
Test if connection cannot be made.
async def test_options_user_connection_fails(hass, mock_try_connection): """Test if connection cannot be made.""" config_entry = MockConfigEntry(domain=mqtt.DOMAIN) config_entry.add_to_hass(hass) config_entry.data = { mqtt.CONF_BROKER: "test-broker", mqtt.CONF_PORT: 1234, } mock...
[ "async", "def", "test_options_user_connection_fails", "(", "hass", ",", "mock_try_connection", ")", ":", "config_entry", "=", "MockConfigEntry", "(", "domain", "=", "mqtt", ".", "DOMAIN", ")", "config_entry", ".", "add_to_hass", "(", "hass", ")", "config_entry", "...
[ 467, 0 ]
[ 495, 5 ]
python
en
['en', 'en', 'en']
True
test_options_bad_birth_message_fails
(hass, mock_try_connection)
Test bad birth message.
Test bad birth message.
async def test_options_bad_birth_message_fails(hass, mock_try_connection): """Test bad birth message.""" config_entry = MockConfigEntry(domain=mqtt.DOMAIN) config_entry.add_to_hass(hass) config_entry.data = { mqtt.CONF_BROKER: "test-broker", mqtt.CONF_PORT: 1234, } mock_try_conn...
[ "async", "def", "test_options_bad_birth_message_fails", "(", "hass", ",", "mock_try_connection", ")", ":", "config_entry", "=", "MockConfigEntry", "(", "domain", "=", "mqtt", ".", "DOMAIN", ")", "config_entry", ".", "add_to_hass", "(", "hass", ")", "config_entry", ...
[ 498, 0 ]
[ 531, 5 ]
python
en
['en', 'de', 'en']
True