Add snapshot tests to elmax (#117637)
* Add snapshot tests to elmax * Rename test methods * Re-generate
This commit is contained in:
parent
44049c34f9
commit
bbcbf57117
9 changed files with 762 additions and 1 deletions
|
@ -1,6 +1,19 @@
|
||||||
"""Tests for the Elmax component."""
|
"""Tests for the Elmax component."""
|
||||||
|
|
||||||
from tests.common import load_fixture
|
from homeassistant.components.elmax.const import (
|
||||||
|
CONF_ELMAX_MODE,
|
||||||
|
CONF_ELMAX_MODE_DIRECT,
|
||||||
|
CONF_ELMAX_MODE_DIRECT_HOST,
|
||||||
|
CONF_ELMAX_MODE_DIRECT_PORT,
|
||||||
|
CONF_ELMAX_MODE_DIRECT_SSL,
|
||||||
|
CONF_ELMAX_MODE_DIRECT_SSL_CERT,
|
||||||
|
CONF_ELMAX_PANEL_ID,
|
||||||
|
CONF_ELMAX_PANEL_PIN,
|
||||||
|
DOMAIN,
|
||||||
|
)
|
||||||
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
|
from tests.common import MockConfigEntry, load_fixture
|
||||||
|
|
||||||
MOCK_USER_JWT = (
|
MOCK_USER_JWT = (
|
||||||
"JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
|
"JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
|
||||||
|
@ -22,3 +35,23 @@ MOCK_DIRECT_PORT = 443
|
||||||
MOCK_DIRECT_SSL = True
|
MOCK_DIRECT_SSL = True
|
||||||
MOCK_DIRECT_CERT = load_fixture("direct/cert.pem", "elmax")
|
MOCK_DIRECT_CERT = load_fixture("direct/cert.pem", "elmax")
|
||||||
MOCK_DIRECT_FOLLOW_MDNS = True
|
MOCK_DIRECT_FOLLOW_MDNS = True
|
||||||
|
|
||||||
|
|
||||||
|
async def init_integration(hass: HomeAssistant) -> MockConfigEntry:
|
||||||
|
"""Mock integration setup."""
|
||||||
|
entry = MockConfigEntry(
|
||||||
|
domain=DOMAIN,
|
||||||
|
data={
|
||||||
|
CONF_ELMAX_MODE: CONF_ELMAX_MODE_DIRECT,
|
||||||
|
CONF_ELMAX_MODE_DIRECT_HOST: MOCK_DIRECT_HOST,
|
||||||
|
CONF_ELMAX_MODE_DIRECT_PORT: MOCK_DIRECT_PORT,
|
||||||
|
CONF_ELMAX_MODE_DIRECT_SSL: MOCK_DIRECT_SSL,
|
||||||
|
CONF_ELMAX_PANEL_PIN: MOCK_PANEL_PIN,
|
||||||
|
CONF_ELMAX_PANEL_ID: None,
|
||||||
|
CONF_ELMAX_MODE_DIRECT_SSL_CERT: MOCK_DIRECT_CERT,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
entry.add_to_hass(hass)
|
||||||
|
await hass.config_entries.async_setup(entry.entry_id)
|
||||||
|
await hass.async_block_till_done()
|
||||||
|
return entry
|
||||||
|
|
151
tests/components/elmax/snapshots/test_alarm_control_panel.ambr
Normal file
151
tests/components/elmax/snapshots/test_alarm_control_panel.ambr
Normal file
|
@ -0,0 +1,151 @@
|
||||||
|
# serializer version: 1
|
||||||
|
# name: test_alarm_control_panels[alarm_control_panel.direct_panel_https_1_1_1_1_443_api_v2_area_1-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': None,
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'alarm_control_panel',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'alarm_control_panel.direct_panel_https_1_1_1_1_443_api_v2_area_1',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': None,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'AREA 1',
|
||||||
|
'platform': 'elmax',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': <AlarmControlPanelEntityFeature: 2>,
|
||||||
|
'translation_key': None,
|
||||||
|
'unique_id': '13762559c53cd093171-area-0',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_alarm_control_panels[alarm_control_panel.direct_panel_https_1_1_1_1_443_api_v2_area_1-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'changed_by': None,
|
||||||
|
'code_arm_required': False,
|
||||||
|
'code_format': <CodeFormat.NUMBER: 'number'>,
|
||||||
|
'friendly_name': 'Direct Panel https://1.1.1.1:443/api/v2 AREA 1',
|
||||||
|
'supported_features': <AlarmControlPanelEntityFeature: 2>,
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'alarm_control_panel.direct_panel_https_1_1_1_1_443_api_v2_area_1',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'unknown',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_alarm_control_panels[alarm_control_panel.direct_panel_https_1_1_1_1_443_api_v2_area_2-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': None,
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'alarm_control_panel',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'alarm_control_panel.direct_panel_https_1_1_1_1_443_api_v2_area_2',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': None,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'AREA 2',
|
||||||
|
'platform': 'elmax',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': <AlarmControlPanelEntityFeature: 2>,
|
||||||
|
'translation_key': None,
|
||||||
|
'unique_id': '13762559c53cd093171-area-1',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_alarm_control_panels[alarm_control_panel.direct_panel_https_1_1_1_1_443_api_v2_area_2-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'changed_by': None,
|
||||||
|
'code_arm_required': False,
|
||||||
|
'code_format': <CodeFormat.NUMBER: 'number'>,
|
||||||
|
'friendly_name': 'Direct Panel https://1.1.1.1:443/api/v2 AREA 2',
|
||||||
|
'supported_features': <AlarmControlPanelEntityFeature: 2>,
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'alarm_control_panel.direct_panel_https_1_1_1_1_443_api_v2_area_2',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'unknown',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_alarm_control_panels[alarm_control_panel.direct_panel_https_1_1_1_1_443_api_v2_area_3-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': None,
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'alarm_control_panel',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'alarm_control_panel.direct_panel_https_1_1_1_1_443_api_v2_area_3',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': None,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'AREA 3',
|
||||||
|
'platform': 'elmax',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': <AlarmControlPanelEntityFeature: 2>,
|
||||||
|
'translation_key': None,
|
||||||
|
'unique_id': '13762559c53cd093171-area-2',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_alarm_control_panels[alarm_control_panel.direct_panel_https_1_1_1_1_443_api_v2_area_3-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'changed_by': None,
|
||||||
|
'code_arm_required': False,
|
||||||
|
'code_format': <CodeFormat.NUMBER: 'number'>,
|
||||||
|
'friendly_name': 'Direct Panel https://1.1.1.1:443/api/v2 AREA 3',
|
||||||
|
'supported_features': <AlarmControlPanelEntityFeature: 2>,
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'alarm_control_panel.direct_panel_https_1_1_1_1_443_api_v2_area_3',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'unknown',
|
||||||
|
})
|
||||||
|
# ---
|
377
tests/components/elmax/snapshots/test_binary_sensor.ambr
Normal file
377
tests/components/elmax/snapshots/test_binary_sensor.ambr
Normal file
|
@ -0,0 +1,377 @@
|
||||||
|
# serializer version: 1
|
||||||
|
# name: test_binary_sensors[binary_sensor.zona_01-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': None,
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'binary_sensor',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'binary_sensor.zona_01',
|
||||||
|
'has_entity_name': False,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': <BinarySensorDeviceClass.DOOR: 'door'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'ZONA 01',
|
||||||
|
'platform': 'elmax',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': None,
|
||||||
|
'unique_id': '13762559c53cd093171-zona-0',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_binary_sensors[binary_sensor.zona_01-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'door',
|
||||||
|
'friendly_name': 'ZONA 01',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'binary_sensor.zona_01',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'on',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_binary_sensors[binary_sensor.zona_02e-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': None,
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'binary_sensor',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'binary_sensor.zona_02e',
|
||||||
|
'has_entity_name': False,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': <BinarySensorDeviceClass.DOOR: 'door'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'ZONA 02e',
|
||||||
|
'platform': 'elmax',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': None,
|
||||||
|
'unique_id': '13762559c53cd093171-zona-1',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_binary_sensors[binary_sensor.zona_02e-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'door',
|
||||||
|
'friendly_name': 'ZONA 02e',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'binary_sensor.zona_02e',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'on',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_binary_sensors[binary_sensor.zona_03a-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': None,
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'binary_sensor',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'binary_sensor.zona_03a',
|
||||||
|
'has_entity_name': False,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': <BinarySensorDeviceClass.DOOR: 'door'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'ZONA 03a',
|
||||||
|
'platform': 'elmax',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': None,
|
||||||
|
'unique_id': '13762559c53cd093171-zona-2',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_binary_sensors[binary_sensor.zona_03a-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'door',
|
||||||
|
'friendly_name': 'ZONA 03a',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'binary_sensor.zona_03a',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'on',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_binary_sensors[binary_sensor.zona_04-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': None,
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'binary_sensor',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'binary_sensor.zona_04',
|
||||||
|
'has_entity_name': False,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': <BinarySensorDeviceClass.DOOR: 'door'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'ZONA 04',
|
||||||
|
'platform': 'elmax',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': None,
|
||||||
|
'unique_id': '13762559c53cd093171-zona-3',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_binary_sensors[binary_sensor.zona_04-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'door',
|
||||||
|
'friendly_name': 'ZONA 04',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'binary_sensor.zona_04',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'on',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_binary_sensors[binary_sensor.zona_05-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': None,
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'binary_sensor',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'binary_sensor.zona_05',
|
||||||
|
'has_entity_name': False,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': <BinarySensorDeviceClass.DOOR: 'door'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'ZONA 05',
|
||||||
|
'platform': 'elmax',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': None,
|
||||||
|
'unique_id': '13762559c53cd093171-zona-4',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_binary_sensors[binary_sensor.zona_05-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'door',
|
||||||
|
'friendly_name': 'ZONA 05',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'binary_sensor.zona_05',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'on',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_binary_sensors[binary_sensor.zona_06-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': None,
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'binary_sensor',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'binary_sensor.zona_06',
|
||||||
|
'has_entity_name': False,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': <BinarySensorDeviceClass.DOOR: 'door'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'ZONA 06',
|
||||||
|
'platform': 'elmax',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': None,
|
||||||
|
'unique_id': '13762559c53cd093171-zona-5',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_binary_sensors[binary_sensor.zona_06-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'door',
|
||||||
|
'friendly_name': 'ZONA 06',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'binary_sensor.zona_06',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'on',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_binary_sensors[binary_sensor.zona_07-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': None,
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'binary_sensor',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'binary_sensor.zona_07',
|
||||||
|
'has_entity_name': False,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': <BinarySensorDeviceClass.DOOR: 'door'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'ZONA 07',
|
||||||
|
'platform': 'elmax',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': None,
|
||||||
|
'unique_id': '13762559c53cd093171-zona-6',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_binary_sensors[binary_sensor.zona_07-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'door',
|
||||||
|
'friendly_name': 'ZONA 07',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'binary_sensor.zona_07',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'on',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_binary_sensors[binary_sensor.zona_08-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': None,
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'binary_sensor',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'binary_sensor.zona_08',
|
||||||
|
'has_entity_name': False,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': <BinarySensorDeviceClass.DOOR: 'door'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'ZONA 08',
|
||||||
|
'platform': 'elmax',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': None,
|
||||||
|
'unique_id': '13762559c53cd093171-zona-7',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_binary_sensors[binary_sensor.zona_08-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'door',
|
||||||
|
'friendly_name': 'ZONA 08',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'binary_sensor.zona_08',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'on',
|
||||||
|
})
|
||||||
|
# ---
|
49
tests/components/elmax/snapshots/test_cover.ambr
Normal file
49
tests/components/elmax/snapshots/test_cover.ambr
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
# serializer version: 1
|
||||||
|
# name: test_covers[cover.espan_dom_01-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': None,
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'cover',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'cover.espan_dom_01',
|
||||||
|
'has_entity_name': False,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': None,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'ESPAN.DOM.01',
|
||||||
|
'platform': 'elmax',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': <CoverEntityFeature: 11>,
|
||||||
|
'translation_key': None,
|
||||||
|
'unique_id': '13762559c53cd093171-tapparella-0',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_covers[cover.espan_dom_01-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'current_position': 0,
|
||||||
|
'friendly_name': 'ESPAN.DOM.01',
|
||||||
|
'supported_features': <CoverEntityFeature: 11>,
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'cover.espan_dom_01',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'closed',
|
||||||
|
})
|
||||||
|
# ---
|
47
tests/components/elmax/snapshots/test_switch.ambr
Normal file
47
tests/components/elmax/snapshots/test_switch.ambr
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
# serializer version: 1
|
||||||
|
# name: test_switches[switch.uscita_02-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': None,
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'switch',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'switch.uscita_02',
|
||||||
|
'has_entity_name': False,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': None,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'USCITA 02',
|
||||||
|
'platform': 'elmax',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': None,
|
||||||
|
'unique_id': '13762559c53cd093171-uscita-1',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_switches[switch.uscita_02-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'friendly_name': 'USCITA 02',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'switch.uscita_02',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'on',
|
||||||
|
})
|
||||||
|
# ---
|
27
tests/components/elmax/test_alarm_control_panel.py
Normal file
27
tests/components/elmax/test_alarm_control_panel.py
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
"""Tests for the Elmax alarm control panels."""
|
||||||
|
|
||||||
|
from unittest.mock import patch
|
||||||
|
|
||||||
|
from syrupy import SnapshotAssertion
|
||||||
|
|
||||||
|
from homeassistant.const import Platform
|
||||||
|
from homeassistant.core import HomeAssistant
|
||||||
|
from homeassistant.helpers import entity_registry as er
|
||||||
|
|
||||||
|
from . import init_integration
|
||||||
|
|
||||||
|
from tests.common import snapshot_platform
|
||||||
|
|
||||||
|
|
||||||
|
async def test_alarm_control_panels(
|
||||||
|
hass: HomeAssistant,
|
||||||
|
entity_registry: er.EntityRegistry,
|
||||||
|
snapshot: SnapshotAssertion,
|
||||||
|
) -> None:
|
||||||
|
"""Test alarm control panels."""
|
||||||
|
with patch(
|
||||||
|
"homeassistant.components.elmax.ELMAX_PLATFORMS", [Platform.ALARM_CONTROL_PANEL]
|
||||||
|
):
|
||||||
|
entry = await init_integration(hass)
|
||||||
|
|
||||||
|
await snapshot_platform(hass, entity_registry, snapshot, entry.entry_id)
|
27
tests/components/elmax/test_binary_sensor.py
Normal file
27
tests/components/elmax/test_binary_sensor.py
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
"""Tests for the Elmax binary sensors."""
|
||||||
|
|
||||||
|
from unittest.mock import patch
|
||||||
|
|
||||||
|
from syrupy import SnapshotAssertion
|
||||||
|
|
||||||
|
from homeassistant.const import Platform
|
||||||
|
from homeassistant.core import HomeAssistant
|
||||||
|
from homeassistant.helpers import entity_registry as er
|
||||||
|
|
||||||
|
from . import init_integration
|
||||||
|
|
||||||
|
from tests.common import snapshot_platform
|
||||||
|
|
||||||
|
|
||||||
|
async def test_binary_sensors(
|
||||||
|
hass: HomeAssistant,
|
||||||
|
entity_registry: er.EntityRegistry,
|
||||||
|
snapshot: SnapshotAssertion,
|
||||||
|
) -> None:
|
||||||
|
"""Test binary sensors."""
|
||||||
|
with patch(
|
||||||
|
"homeassistant.components.elmax.ELMAX_PLATFORMS", [Platform.BINARY_SENSOR]
|
||||||
|
):
|
||||||
|
entry = await init_integration(hass)
|
||||||
|
|
||||||
|
await snapshot_platform(hass, entity_registry, snapshot, entry.entry_id)
|
25
tests/components/elmax/test_cover.py
Normal file
25
tests/components/elmax/test_cover.py
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
"""Tests for the Elmax covers."""
|
||||||
|
|
||||||
|
from unittest.mock import patch
|
||||||
|
|
||||||
|
from syrupy import SnapshotAssertion
|
||||||
|
|
||||||
|
from homeassistant.const import Platform
|
||||||
|
from homeassistant.core import HomeAssistant
|
||||||
|
from homeassistant.helpers import entity_registry as er
|
||||||
|
|
||||||
|
from . import init_integration
|
||||||
|
|
||||||
|
from tests.common import snapshot_platform
|
||||||
|
|
||||||
|
|
||||||
|
async def test_covers(
|
||||||
|
hass: HomeAssistant,
|
||||||
|
entity_registry: er.EntityRegistry,
|
||||||
|
snapshot: SnapshotAssertion,
|
||||||
|
) -> None:
|
||||||
|
"""Test covers."""
|
||||||
|
with patch("homeassistant.components.elmax.ELMAX_PLATFORMS", [Platform.COVER]):
|
||||||
|
entry = await init_integration(hass)
|
||||||
|
|
||||||
|
await snapshot_platform(hass, entity_registry, snapshot, entry.entry_id)
|
25
tests/components/elmax/test_switch.py
Normal file
25
tests/components/elmax/test_switch.py
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
"""Tests for the Elmax switches."""
|
||||||
|
|
||||||
|
from unittest.mock import patch
|
||||||
|
|
||||||
|
from syrupy import SnapshotAssertion
|
||||||
|
|
||||||
|
from homeassistant.const import Platform
|
||||||
|
from homeassistant.core import HomeAssistant
|
||||||
|
from homeassistant.helpers import entity_registry as er
|
||||||
|
|
||||||
|
from . import init_integration
|
||||||
|
|
||||||
|
from tests.common import snapshot_platform
|
||||||
|
|
||||||
|
|
||||||
|
async def test_switches(
|
||||||
|
hass: HomeAssistant,
|
||||||
|
entity_registry: er.EntityRegistry,
|
||||||
|
snapshot: SnapshotAssertion,
|
||||||
|
) -> None:
|
||||||
|
"""Test switches."""
|
||||||
|
with patch("homeassistant.components.elmax.ELMAX_PLATFORMS", [Platform.SWITCH]):
|
||||||
|
entry = await init_integration(hass)
|
||||||
|
|
||||||
|
await snapshot_platform(hass, entity_registry, snapshot, entry.entry_id)
|
Loading…
Add table
Reference in a new issue