diff --git a/tests/components/elmax/__init__.py b/tests/components/elmax/__init__.py index 1434c831df3..e1a6728f1f5 100644 --- a/tests/components/elmax/__init__.py +++ b/tests/components/elmax/__init__.py @@ -1,6 +1,19 @@ """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 = ( "JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9" @@ -22,3 +35,23 @@ MOCK_DIRECT_PORT = 443 MOCK_DIRECT_SSL = True MOCK_DIRECT_CERT = load_fixture("direct/cert.pem", "elmax") 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 diff --git a/tests/components/elmax/snapshots/test_alarm_control_panel.ambr b/tests/components/elmax/snapshots/test_alarm_control_panel.ambr new file mode 100644 index 00000000000..f09ba6752c5 --- /dev/null +++ b/tests/components/elmax/snapshots/test_alarm_control_panel.ambr @@ -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': , + 'device_class': None, + 'device_id': , + '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': , + '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': , + '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': , + 'friendly_name': 'Direct Panel https://1.1.1.1:443/api/v2 AREA 1', + 'supported_features': , + }), + 'context': , + 'entity_id': 'alarm_control_panel.direct_panel_https_1_1_1_1_443_api_v2_area_1', + 'last_changed': , + 'last_reported': , + 'last_updated': , + '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': , + 'device_class': None, + 'device_id': , + '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': , + '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': , + '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': , + 'friendly_name': 'Direct Panel https://1.1.1.1:443/api/v2 AREA 2', + 'supported_features': , + }), + 'context': , + 'entity_id': 'alarm_control_panel.direct_panel_https_1_1_1_1_443_api_v2_area_2', + 'last_changed': , + 'last_reported': , + 'last_updated': , + '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': , + 'device_class': None, + 'device_id': , + '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': , + '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': , + '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': , + 'friendly_name': 'Direct Panel https://1.1.1.1:443/api/v2 AREA 3', + 'supported_features': , + }), + 'context': , + 'entity_id': 'alarm_control_panel.direct_panel_https_1_1_1_1_443_api_v2_area_3', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- diff --git a/tests/components/elmax/snapshots/test_binary_sensor.ambr b/tests/components/elmax/snapshots/test_binary_sensor.ambr new file mode 100644 index 00000000000..3c3f63b44ca --- /dev/null +++ b/tests/components/elmax/snapshots/test_binary_sensor.ambr @@ -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': , + 'device_class': None, + 'device_id': , + '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': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + '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': , + 'entity_id': 'binary_sensor.zona_01', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_binary_sensors[binary_sensor.zona_02e-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + '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': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + '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': , + 'entity_id': 'binary_sensor.zona_02e', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_binary_sensors[binary_sensor.zona_03a-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + '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': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + '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': , + 'entity_id': 'binary_sensor.zona_03a', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_binary_sensors[binary_sensor.zona_04-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + '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': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + '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': , + 'entity_id': 'binary_sensor.zona_04', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_binary_sensors[binary_sensor.zona_05-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + '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': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + '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': , + 'entity_id': 'binary_sensor.zona_05', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_binary_sensors[binary_sensor.zona_06-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + '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': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + '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': , + 'entity_id': 'binary_sensor.zona_06', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_binary_sensors[binary_sensor.zona_07-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + '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': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + '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': , + 'entity_id': 'binary_sensor.zona_07', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_binary_sensors[binary_sensor.zona_08-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + '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': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + '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': , + 'entity_id': 'binary_sensor.zona_08', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- diff --git a/tests/components/elmax/snapshots/test_cover.ambr b/tests/components/elmax/snapshots/test_cover.ambr new file mode 100644 index 00000000000..0dbea416934 --- /dev/null +++ b/tests/components/elmax/snapshots/test_cover.ambr @@ -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': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'cover', + 'entity_category': None, + 'entity_id': 'cover.espan_dom_01', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + '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': , + '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': , + }), + 'context': , + 'entity_id': 'cover.espan_dom_01', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'closed', + }) +# --- diff --git a/tests/components/elmax/snapshots/test_switch.ambr b/tests/components/elmax/snapshots/test_switch.ambr new file mode 100644 index 00000000000..0ae1942e7e0 --- /dev/null +++ b/tests/components/elmax/snapshots/test_switch.ambr @@ -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': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': None, + 'entity_id': 'switch.uscita_02', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + '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': , + 'entity_id': 'switch.uscita_02', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- diff --git a/tests/components/elmax/test_alarm_control_panel.py b/tests/components/elmax/test_alarm_control_panel.py new file mode 100644 index 00000000000..6e4f09710fc --- /dev/null +++ b/tests/components/elmax/test_alarm_control_panel.py @@ -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) diff --git a/tests/components/elmax/test_binary_sensor.py b/tests/components/elmax/test_binary_sensor.py new file mode 100644 index 00000000000..f6cead79ee7 --- /dev/null +++ b/tests/components/elmax/test_binary_sensor.py @@ -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) diff --git a/tests/components/elmax/test_cover.py b/tests/components/elmax/test_cover.py new file mode 100644 index 00000000000..9fa72432072 --- /dev/null +++ b/tests/components/elmax/test_cover.py @@ -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) diff --git a/tests/components/elmax/test_switch.py b/tests/components/elmax/test_switch.py new file mode 100644 index 00000000000..ba6efee2184 --- /dev/null +++ b/tests/components/elmax/test_switch.py @@ -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)