From 543f9869550a1a2645825248914f3904e0b38d3a Mon Sep 17 00:00:00 2001 From: GeoffAtHome Date: Fri, 6 Sep 2024 14:17:50 +0100 Subject: [PATCH] Improve geniushub test coverage (#124157) * Add tests for local connection * Test cloud setup * Improve tests. * Simplied coverage test to cloud setup. * Mock out library and add snapshots * Mock out library and add snapshots * Update tests/components/geniushub/conftest.py Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> * Attempt to make it nice * Fix --------- Co-authored-by: Joostlek Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> --- tests/components/geniushub/__init__.py | 12 + tests/components/geniushub/conftest.py | 39 +- .../fixtures/devices_cloud_test_data.json | 151 +++ .../fixtures/zones_cloud_test_data.json | 1069 +++++++++++++++++ .../snapshots/test_binary_sensor.ambr | 50 + .../geniushub/snapshots/test_climate.ambr | 569 +++++++++ .../geniushub/snapshots/test_sensor.ambr | 954 +++++++++++++++ .../geniushub/snapshots/test_switch.ambr | 166 +++ .../geniushub/test_binary_sensor.py | 32 + tests/components/geniushub/test_climate.py | 30 + tests/components/geniushub/test_sensor.py | 30 + tests/components/geniushub/test_switch.py | 30 + 12 files changed, 3130 insertions(+), 2 deletions(-) create mode 100644 tests/components/geniushub/fixtures/devices_cloud_test_data.json create mode 100644 tests/components/geniushub/fixtures/zones_cloud_test_data.json create mode 100644 tests/components/geniushub/snapshots/test_binary_sensor.ambr create mode 100644 tests/components/geniushub/snapshots/test_climate.ambr create mode 100644 tests/components/geniushub/snapshots/test_sensor.ambr create mode 100644 tests/components/geniushub/snapshots/test_switch.ambr create mode 100644 tests/components/geniushub/test_binary_sensor.py create mode 100644 tests/components/geniushub/test_climate.py create mode 100644 tests/components/geniushub/test_sensor.py create mode 100644 tests/components/geniushub/test_switch.py diff --git a/tests/components/geniushub/__init__.py b/tests/components/geniushub/__init__.py index 15886486e38..ed06642d339 100644 --- a/tests/components/geniushub/__init__.py +++ b/tests/components/geniushub/__init__.py @@ -1 +1,13 @@ """Tests for the geniushub integration.""" + +from homeassistant.core import HomeAssistant + +from tests.common import MockConfigEntry + + +async def setup_integration(hass: HomeAssistant, config_entry: MockConfigEntry) -> None: + """Fixture for setting up the component.""" + config_entry.add_to_hass(hass) + + await hass.config_entries.async_setup(config_entry.entry_id) + await hass.async_block_till_done() diff --git a/tests/components/geniushub/conftest.py b/tests/components/geniushub/conftest.py index 125f1cfa80c..15938eabc62 100644 --- a/tests/components/geniushub/conftest.py +++ b/tests/components/geniushub/conftest.py @@ -1,14 +1,16 @@ """GeniusHub tests configuration.""" from collections.abc import Generator -from unittest.mock import patch +from typing import Any +from unittest.mock import MagicMock, patch +from geniushubclient import GeniusDevice, GeniusZone import pytest from homeassistant.components.geniushub.const import DOMAIN from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_TOKEN, CONF_USERNAME -from tests.common import MockConfigEntry +from tests.common import MockConfigEntry, load_json_array_fixture from tests.components.smhi.common import AsyncMock @@ -38,6 +40,38 @@ def mock_geniushub_client() -> Generator[AsyncMock]: yield client +@pytest.fixture(scope="session") +def zones() -> list[dict[str, Any]]: + """Return a list of zones.""" + return load_json_array_fixture("zones_cloud_test_data.json", DOMAIN) + + +@pytest.fixture(scope="session") +def devices() -> list[dict[str, Any]]: + """Return a list of devices.""" + return load_json_array_fixture("devices_cloud_test_data.json", DOMAIN) + + +@pytest.fixture +def mock_geniushub_cloud( + zones: list[dict[str, Any]], devices: list[dict[str, Any]] +) -> Generator[MagicMock]: + """Mock a GeniusHub.""" + with patch( + "homeassistant.components.geniushub.GeniusHub", + autospec=True, + ) as mock_client: + client = mock_client.return_value + genius_zones = [GeniusZone(z["id"], z, client) for z in zones] + client.zone_objs = genius_zones + client._zones = genius_zones + genius_devices = [GeniusDevice(d["id"], d, client) for d in devices] + client.device_objs = genius_devices + client._devices = genius_devices + client.api_version = 1 + yield client + + @pytest.fixture def mock_local_config_entry() -> MockConfigEntry: """Mock a local config entry.""" @@ -62,4 +96,5 @@ def mock_cloud_config_entry() -> MockConfigEntry: data={ CONF_TOKEN: "abcdef", }, + entry_id="01J71MQF0EC62D620DGYNG2R8H", ) diff --git a/tests/components/geniushub/fixtures/devices_cloud_test_data.json b/tests/components/geniushub/fixtures/devices_cloud_test_data.json new file mode 100644 index 00000000000..92fd2c33811 --- /dev/null +++ b/tests/components/geniushub/fixtures/devices_cloud_test_data.json @@ -0,0 +1,151 @@ +[ + { + "id": "4", + "type": "Smart Plug", + "assignedZones": [{ "name": "Bedroom Socket" }], + "state": { "outputOnOff": "True" } + }, + { + "id": "6", + "type": "Smart Plug", + "assignedZones": [{ "name": "Kitchen Socket" }], + "state": { "outputOnOff": "True" } + }, + { + "id": "11", + "type": "Radiator Valve", + "assignedZones": [{ "name": "Lounge" }], + "state": { "batteryLevel": 43, "setTemperature": 4 } + }, + { + "id": "16", + "type": "Room Sensor", + "assignedZones": [{ "name": "Guest room" }], + "state": { + "batteryLevel": 100, + "measuredTemperature": 21, + "luminance": 29, + "occupancyTrigger": 255 + } + }, + { + "id": "17", + "type": "Room Sensor", + "assignedZones": [{ "name": "Ensuite" }], + "state": { + "batteryLevel": 100, + "measuredTemperature": 21, + "luminance": 32, + "occupancyTrigger": 0 + } + }, + { + "id": "18", + "type": "Room Sensor", + "assignedZones": [{ "name": "Bedroom" }], + "state": { + "batteryLevel": 36, + "measuredTemperature": 21.5, + "luminance": 1, + "occupancyTrigger": 0 + } + }, + { + "id": "20", + "type": "Room Sensor", + "assignedZones": [{ "name": "Kitchen" }], + "state": { + "batteryLevel": 100, + "measuredTemperature": 21.5, + "luminance": 1, + "occupancyTrigger": 0 + } + }, + { + "id": "21", + "type": "Room Sensor", + "assignedZones": [{ "name": "Hall" }], + "state": { + "batteryLevel": 100, + "measuredTemperature": 21, + "luminance": 33, + "occupancyTrigger": 0 + } + }, + { + "id": "22", + "type": "Single Channel Receiver", + "assignedZones": [{ "name": "East Berlin" }], + "state": { "outputOnOff": "False" } + }, + { + "id": "50", + "type": "Room Sensor", + "assignedZones": [{ "name": "Study" }], + "state": { + "batteryLevel": 100, + "measuredTemperature": 22, + "luminance": 34, + "occupancyTrigger": 0 + } + }, + { + "id": "53", + "type": "Room Sensor", + "assignedZones": [{ "name": "Lounge" }], + "state": { + "batteryLevel": 28, + "measuredTemperature": 0, + "luminance": 0, + "occupancyTrigger": 0 + } + }, + { + "id": "56", + "type": "Radiator Valve", + "assignedZones": [{ "name": "Kitchen" }], + "state": { "batteryLevel": 55, "setTemperature": 4 } + }, + { + "id": "68", + "type": "Radiator Valve", + "assignedZones": [{ "name": "Hall" }], + "state": { "batteryLevel": 92, "setTemperature": 4 } + }, + { + "id": "78", + "type": "Radiator Valve", + "assignedZones": [{ "name": "Bedroom" }], + "state": { "batteryLevel": 42, "setTemperature": 4 } + }, + { + "id": "85", + "type": "Radiator Valve", + "assignedZones": [{ "name": "Study" }], + "state": { "batteryLevel": 61, "setTemperature": 4 } + }, + { + "id": "86", + "type": "Smart Plug", + "assignedZones": [{ "name": "Study Socket" }], + "state": { "outputOnOff": "False" } + }, + { + "id": "88", + "type": "Radiator Valve", + "assignedZones": [{ "name": "Ensuite" }], + "state": { "batteryLevel": 49, "setTemperature": 4 } + }, + { + "id": "89", + "type": "Radiator Valve", + "assignedZones": [{ "name": "Kitchen" }], + "state": { "batteryLevel": 48, "setTemperature": 4 } + }, + { + "id": "90", + "type": "Radiator Valve", + "assignedZones": [{ "name": "Guest room" }], + "state": { "batteryLevel": 92, "setTemperature": 4 } + } +] diff --git a/tests/components/geniushub/fixtures/zones_cloud_test_data.json b/tests/components/geniushub/fixtures/zones_cloud_test_data.json new file mode 100644 index 00000000000..00d3109cf6e --- /dev/null +++ b/tests/components/geniushub/fixtures/zones_cloud_test_data.json @@ -0,0 +1,1069 @@ +[ + { + "id": 0, + "name": "West Berlin", + "output": 0, + "type": "manager", + "mode": "off", + "schedule": { "timer": {}, "footprint": {} } + }, + { + "id": 1, + "name": "Lounge", + "output": 0, + "type": "radiator", + "mode": "off", + "temperature": 20, + "setpoint": 4, + "override": { "duration": 0, "setpoint": 20 }, + "schedule": { + "timer": { + "weekly": { + "sunday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 68400, "start": 29700, "setpoint": 6 }, + { "end": 75600, "start": 68400, "setpoint": 20 }, + { "end": 81000, "start": 75600, "setpoint": 18 } + ] + }, + "monday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 68400, "start": 29700, "setpoint": 6 }, + { "end": 75600, "start": 68400, "setpoint": 20 }, + { "end": 81000, "start": 75600, "setpoint": 18 } + ] + }, + "tuesday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 68400, "start": 29700, "setpoint": 6 }, + { "end": 75600, "start": 68400, "setpoint": 20 }, + { "end": 81000, "start": 75600, "setpoint": 18 } + ] + }, + "wednesday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 68400, "start": 29700, "setpoint": 6 }, + { "end": 75600, "start": 68400, "setpoint": 20 }, + { "end": 81000, "start": 75600, "setpoint": 18 } + ] + }, + "thursday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 68400, "start": 29700, "setpoint": 6 }, + { "end": 75600, "start": 68400, "setpoint": 20 }, + { "end": 81000, "start": 75600, "setpoint": 18 } + ] + }, + "friday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 68400, "start": 29700, "setpoint": 6 }, + { "end": 75600, "start": 68400, "setpoint": 20 }, + { "end": 81000, "start": 75600, "setpoint": 18 } + ] + }, + "saturday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 68400, "start": 29700, "setpoint": 6 }, + { "end": 75600, "start": 68400, "setpoint": 20 }, + { "end": 81000, "start": 75600, "setpoint": 18 } + ] + } + } + }, + "footprint": { + "weekly": { + "sunday": { + "defaultSetpoint": 17, + "heatingPeriods": [ + { "end": 61200, "start": 0, "setpoint": 4 }, + { "end": 86400, "start": 80100, "setpoint": 4 } + ] + }, + "monday": { + "defaultSetpoint": 17, + "heatingPeriods": [ + { "end": 61200, "start": 0, "setpoint": 4 }, + { "end": 86400, "start": 80100, "setpoint": 4 } + ] + }, + "tuesday": { + "defaultSetpoint": 17, + "heatingPeriods": [ + { "end": 61200, "start": 0, "setpoint": 4 }, + { "end": 86400, "start": 80100, "setpoint": 4 } + ] + }, + "wednesday": { + "defaultSetpoint": 17, + "heatingPeriods": [ + { "end": 61200, "start": 0, "setpoint": 4 }, + { "end": 86400, "start": 80100, "setpoint": 4 } + ] + }, + "thursday": { + "defaultSetpoint": 17, + "heatingPeriods": [ + { "end": 61200, "start": 0, "setpoint": 4 }, + { "end": 86400, "start": 80100, "setpoint": 4 } + ] + }, + "friday": { + "defaultSetpoint": 17, + "heatingPeriods": [ + { "end": 61200, "start": 0, "setpoint": 4 }, + { "end": 86400, "start": 80100, "setpoint": 4 } + ] + }, + "saturday": { + "defaultSetpoint": 17, + "heatingPeriods": [ + { "end": 61200, "start": 0, "setpoint": 4 }, + { "end": 86400, "start": 80100, "setpoint": 4 } + ] + } + } + } + } + }, + { + "id": 2, + "name": "Hall", + "output": 0, + "type": "radiator", + "mode": "off", + "temperature": 21, + "setpoint": 4, + "occupied": "False", + "override": { "duration": 0, "setpoint": 20 }, + "schedule": { + "timer": { + "weekly": { + "sunday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 61200, "start": 29700, "setpoint": 6 }, + { "end": 70200, "start": 61200, "setpoint": 18.5 } + ] + }, + "monday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 61200, "start": 29700, "setpoint": 6 }, + { "end": 70200, "start": 61200, "setpoint": 18.5 } + ] + }, + "tuesday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 61200, "start": 29700, "setpoint": 6 }, + { "end": 70200, "start": 61200, "setpoint": 18.5 } + ] + }, + "wednesday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 61200, "start": 29700, "setpoint": 6 }, + { "end": 70200, "start": 61200, "setpoint": 18.5 } + ] + }, + "thursday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 61200, "start": 29700, "setpoint": 6 }, + { "end": 70200, "start": 61200, "setpoint": 18.5 } + ] + }, + "friday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 61200, "start": 29700, "setpoint": 6 }, + { "end": 70200, "start": 61200, "setpoint": 18.5 } + ] + }, + "saturday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 61200, "start": 29700, "setpoint": 6 }, + { "end": 73800, "start": 68400, "setpoint": 18.5 } + ] + } + } + }, + "footprint": { + "weekly": { + "sunday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 37800, "start": 32400, "setpoint": 20 }, + { "end": 75600, "start": 56700, "setpoint": 20 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "monday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 43500, "start": 31800, "setpoint": 20 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "tuesday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 34200, "start": 27300, "setpoint": 20 }, + { "end": 75600, "start": 60900, "setpoint": 20 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "wednesday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 48300, "start": 28800, "setpoint": 20 }, + { "end": 75600, "start": 75300, "setpoint": 20 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "thursday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 42000, "start": 28500, "setpoint": 20 }, + { "end": 70800, "start": 53700, "setpoint": 20 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "friday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 64500, "start": 28500, "setpoint": 20 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "saturday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 63900, "start": 53100, "setpoint": 20 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + } + } + } + } + }, + { + "id": 3, + "name": "Kitchen", + "output": 0, + "type": "radiator", + "mode": "off", + "temperature": 21.5, + "setpoint": 4, + "occupied": "False", + "override": { "duration": 0, "setpoint": 20 }, + "schedule": { + "timer": { + "weekly": { + "sunday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 61200, "start": 29700, "setpoint": 6 }, + { "end": 70200, "start": 61200, "setpoint": 18.5 } + ] + }, + "monday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 61200, "start": 29700, "setpoint": 6 }, + { "end": 70200, "start": 61200, "setpoint": 18.5 } + ] + }, + "tuesday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 61200, "start": 29700, "setpoint": 6 }, + { "end": 70200, "start": 61200, "setpoint": 18.5 } + ] + }, + "wednesday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 61200, "start": 29700, "setpoint": 6 }, + { "end": 70200, "start": 61200, "setpoint": 18.5 } + ] + }, + "thursday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 61200, "start": 29700, "setpoint": 6 }, + { "end": 70200, "start": 61200, "setpoint": 18.5 } + ] + }, + "friday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 61200, "start": 29700, "setpoint": 6 }, + { "end": 70200, "start": 61200, "setpoint": 18.5 } + ] + }, + "saturday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 61200, "start": 29700, "setpoint": 6 }, + { "end": 73800, "start": 68400, "setpoint": 18.5 } + ] + } + } + }, + "footprint": { + "weekly": { + "sunday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 38100, "start": 29100, "setpoint": 20 }, + { "end": 75600, "start": 56700, "setpoint": 20 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "monday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 51600, "start": 32400, "setpoint": 20 }, + { "end": 74400, "start": 60600, "setpoint": 20 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "tuesday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 33300, "start": 27300, "setpoint": 20 }, + { "end": 75600, "start": 58800, "setpoint": 20 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "wednesday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 48600, "start": 28800, "setpoint": 20 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "thursday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 71400, "start": 56400, "setpoint": 20 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "friday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 74400, "start": 40800, "setpoint": 20 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "saturday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 63300, "start": 29700, "setpoint": 20 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + } + } + } + } + }, + { + "id": 5, + "name": "Ensuite", + "output": 0, + "type": "radiator", + "mode": "off", + "temperature": 21, + "setpoint": 4, + "occupied": "False", + "override": { "duration": 0, "setpoint": 28 }, + "schedule": { + "timer": { + "weekly": { + "sunday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 73800, "start": 29700, "setpoint": 6 }, + { "end": 81000, "start": 73800, "setpoint": 16 } + ] + }, + "monday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 73800, "start": 29700, "setpoint": 6 }, + { "end": 81000, "start": 73800, "setpoint": 16 } + ] + }, + "tuesday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 73800, "start": 29700, "setpoint": 6 }, + { "end": 81000, "start": 73800, "setpoint": 16 } + ] + }, + "wednesday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 73800, "start": 29700, "setpoint": 6 }, + { "end": 81000, "start": 73800, "setpoint": 16 } + ] + }, + "thursday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 73800, "start": 29700, "setpoint": 6 }, + { "end": 81000, "start": 73800, "setpoint": 16 } + ] + }, + "friday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 73800, "start": 29700, "setpoint": 6 }, + { "end": 81000, "start": 73800, "setpoint": 16 } + ] + }, + "saturday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 73800, "start": 29700, "setpoint": 6 }, + { "end": 81000, "start": 73800, "setpoint": 16 } + ] + } + } + }, + "footprint": { + "weekly": { + "sunday": { + "defaultSetpoint": 12, + "heatingPeriods": [ + { "end": 28800, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 81000, "setpoint": 16 } + ] + }, + "monday": { + "defaultSetpoint": 12, + "heatingPeriods": [ + { "end": 28800, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 81000, "setpoint": 16 } + ] + }, + "tuesday": { + "defaultSetpoint": 12, + "heatingPeriods": [ + { "end": 28800, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 81000, "setpoint": 16 } + ] + }, + "wednesday": { + "defaultSetpoint": 12, + "heatingPeriods": [ + { "end": 28800, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 81000, "setpoint": 16 } + ] + }, + "thursday": { + "defaultSetpoint": 12, + "heatingPeriods": [ + { "end": 28800, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 81000, "setpoint": 16 } + ] + }, + "friday": { + "defaultSetpoint": 12, + "heatingPeriods": [ + { "end": 28800, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 81000, "setpoint": 16 } + ] + }, + "saturday": { + "defaultSetpoint": 12, + "heatingPeriods": [ + { "end": 28800, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 81000, "setpoint": 16 } + ] + } + } + } + } + }, + { + "id": 7, + "name": "Guest room", + "output": 0, + "type": "radiator", + "mode": "off", + "temperature": 21, + "setpoint": 4, + "occupied": "True", + "override": { "duration": 0, "setpoint": 20 }, + "schedule": { + "timer": { + "weekly": { + "sunday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 73800, "start": 29700, "setpoint": 6 }, + { "end": 75600, "start": 73800, "setpoint": 14 }, + { "end": 81000, "start": 75600, "setpoint": 18.5 } + ] + }, + "monday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 73800, "start": 29700, "setpoint": 6 }, + { "end": 75600, "start": 73800, "setpoint": 14 }, + { "end": 81000, "start": 75600, "setpoint": 18.5 } + ] + }, + "tuesday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 75600, "start": 29700, "setpoint": 6 }, + { "end": 81000, "start": 75600, "setpoint": 18.5 } + ] + }, + "wednesday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 73800, "start": 29700, "setpoint": 6 }, + { "end": 75600, "start": 73800, "setpoint": 14 }, + { "end": 81000, "start": 75600, "setpoint": 18.5 } + ] + }, + "thursday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 73800, "start": 29700, "setpoint": 6 }, + { "end": 75600, "start": 73800, "setpoint": 14 }, + { "end": 81000, "start": 75600, "setpoint": 18.5 } + ] + }, + "friday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 73800, "start": 29700, "setpoint": 6 }, + { "end": 75600, "start": 73800, "setpoint": 14 }, + { "end": 81000, "start": 75600, "setpoint": 18.5 } + ] + }, + "saturday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 73800, "start": 29700, "setpoint": 6 }, + { "end": 75600, "start": 73800, "setpoint": 14 }, + { "end": 81000, "start": 75600, "setpoint": 18.5 } + ] + } + } + }, + "footprint": { + "weekly": { + "sunday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "monday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "tuesday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "wednesday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "thursday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "friday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "saturday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + } + } + } + } + }, + { + "id": 27, + "name": "Bedroom Socket", + "output": 1, + "type": "on / off", + "mode": "timer", + "setpoint": "True", + "override": { "duration": 0, "setpoint": "True" }, + "schedule": { + "timer": { + "weekly": { + "sunday": { + "defaultSetpoint": "False", + "heatingPeriods": [{ "end": 86400, "start": 0, "setpoint": "True" }] + }, + "monday": { + "defaultSetpoint": "False", + "heatingPeriods": [{ "end": 86400, "start": 0, "setpoint": "True" }] + }, + "tuesday": { + "defaultSetpoint": "False", + "heatingPeriods": [{ "end": 86400, "start": 0, "setpoint": "True" }] + }, + "wednesday": { + "defaultSetpoint": "False", + "heatingPeriods": [{ "end": 86400, "start": 0, "setpoint": "True" }] + }, + "thursday": { + "defaultSetpoint": "False", + "heatingPeriods": [{ "end": 86400, "start": 0, "setpoint": "True" }] + }, + "friday": { + "defaultSetpoint": "False", + "heatingPeriods": [{ "end": 86400, "start": 0, "setpoint": "True" }] + }, + "saturday": { + "defaultSetpoint": "False", + "heatingPeriods": [{ "end": 86400, "start": 0, "setpoint": "True" }] + } + } + }, + "footprint": {} + } + }, + { + "id": 28, + "name": "Kitchen Socket", + "output": 1, + "type": "on / off", + "mode": "timer", + "setpoint": "True", + "override": { "duration": 0, "setpoint": "True" }, + "schedule": { + "timer": { + "weekly": { + "sunday": { + "defaultSetpoint": "False", + "heatingPeriods": [ + { "end": 82800, "start": 27000, "setpoint": "True" } + ] + }, + "monday": { + "defaultSetpoint": "False", + "heatingPeriods": [ + { "end": 82800, "start": 27000, "setpoint": "True" } + ] + }, + "tuesday": { + "defaultSetpoint": "False", + "heatingPeriods": [ + { "end": 82800, "start": 27000, "setpoint": "True" } + ] + }, + "wednesday": { + "defaultSetpoint": "False", + "heatingPeriods": [ + { "end": 82800, "start": 27000, "setpoint": "True" } + ] + }, + "thursday": { + "defaultSetpoint": "False", + "heatingPeriods": [ + { "end": 82800, "start": 27000, "setpoint": "True" } + ] + }, + "friday": { + "defaultSetpoint": "False", + "heatingPeriods": [ + { "end": 82800, "start": 27000, "setpoint": "True" } + ] + }, + "saturday": { + "defaultSetpoint": "False", + "heatingPeriods": [ + { "end": 82800, "start": 27000, "setpoint": "True" } + ] + } + } + }, + "footprint": {} + } + }, + { + "id": 29, + "name": "Bedroom", + "output": 0, + "type": "radiator", + "mode": "off", + "temperature": 21.5, + "setpoint": 4, + "override": { "duration": 0, "setpoint": 23.5 }, + "schedule": { + "timer": { + "weekly": { + "sunday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 75600, "start": 29700, "setpoint": 6 }, + { "end": 81000, "start": 75600, "setpoint": 18.5 } + ] + }, + "monday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 75600, "start": 29700, "setpoint": 6 }, + { "end": 81000, "start": 75600, "setpoint": 18.5 } + ] + }, + "tuesday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 75600, "start": 29700, "setpoint": 6 }, + { "end": 81000, "start": 75600, "setpoint": 18.5 } + ] + }, + "wednesday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 73800, "start": 29700, "setpoint": 6 }, + { "end": 81000, "start": 73800, "setpoint": 18.5 } + ] + }, + "thursday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 75600, "start": 29700, "setpoint": 6 }, + { "end": 81000, "start": 75600, "setpoint": 18.5 } + ] + }, + "friday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 75600, "start": 29700, "setpoint": 6 }, + { "end": 81000, "start": 75600, "setpoint": 19.5 } + ] + }, + "saturday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 75600, "start": 29700, "setpoint": 6 }, + { "end": 81000, "start": 75600, "setpoint": 18.5 } + ] + } + } + }, + "footprint": { + "weekly": { + "sunday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "monday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "tuesday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "wednesday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "thursday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "friday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "saturday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + } + } + } + } + }, + { + "id": 30, + "name": "Study", + "output": 0, + "type": "radiator", + "mode": "off", + "temperature": 22, + "setpoint": 4, + "occupied": "False", + "override": { "duration": 0, "setpoint": 28 }, + "schedule": { + "timer": { + "weekly": { + "sunday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 73800, "start": 29700, "setpoint": 6 }, + { "end": 75600, "start": 73800, "setpoint": 14 }, + { "end": 81000, "start": 75600, "setpoint": 18.5 } + ] + }, + "monday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 73800, "start": 29700, "setpoint": 6 }, + { "end": 75600, "start": 73800, "setpoint": 14 }, + { "end": 81000, "start": 75600, "setpoint": 18.5 } + ] + }, + "tuesday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 75600, "start": 29700, "setpoint": 6 }, + { "end": 81000, "start": 75600, "setpoint": 18.5 } + ] + }, + "wednesday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 73800, "start": 29700, "setpoint": 6 }, + { "end": 75600, "start": 73800, "setpoint": 14 }, + { "end": 81000, "start": 75600, "setpoint": 18.5 } + ] + }, + "thursday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 73800, "start": 29700, "setpoint": 6 }, + { "end": 75600, "start": 73800, "setpoint": 14 }, + { "end": 81000, "start": 75600, "setpoint": 18.5 } + ] + }, + "friday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 73800, "start": 29700, "setpoint": 6 }, + { "end": 75600, "start": 73800, "setpoint": 14 }, + { "end": 81000, "start": 75600, "setpoint": 18.5 } + ] + }, + "saturday": { + "defaultSetpoint": 14.5, + "heatingPeriods": [ + { "end": 29700, "start": 27000, "setpoint": 18 }, + { "end": 73800, "start": 29700, "setpoint": 6 }, + { "end": 75600, "start": 73800, "setpoint": 14 }, + { "end": 81000, "start": 75600, "setpoint": 18.5 } + ] + } + } + }, + "footprint": { + "weekly": { + "sunday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "monday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "tuesday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "wednesday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "thursday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "friday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + }, + "saturday": { + "defaultSetpoint": 14, + "heatingPeriods": [ + { "end": 23400, "start": 0, "setpoint": 16 }, + { "end": 86400, "start": 75600, "setpoint": 16 } + ] + } + } + } + } + }, + { + "id": 32, + "name": "Study Socket", + "output": 0, + "type": "on / off", + "mode": "off", + "setpoint": "False", + "override": { "duration": 0, "setpoint": "True" }, + "schedule": { + "timer": { + "weekly": { + "sunday": { + "defaultSetpoint": "False", + "heatingPeriods": [{ "end": 86400, "start": 0, "setpoint": "True" }] + }, + "monday": { + "defaultSetpoint": "False", + "heatingPeriods": [{ "end": 86400, "start": 0, "setpoint": "True" }] + }, + "tuesday": { + "defaultSetpoint": "False", + "heatingPeriods": [{ "end": 86400, "start": 0, "setpoint": "True" }] + }, + "wednesday": { + "defaultSetpoint": "False", + "heatingPeriods": [{ "end": 86400, "start": 0, "setpoint": "True" }] + }, + "thursday": { + "defaultSetpoint": "False", + "heatingPeriods": [{ "end": 86400, "start": 0, "setpoint": "True" }] + }, + "friday": { + "defaultSetpoint": "False", + "heatingPeriods": [{ "end": 86400, "start": 0, "setpoint": "True" }] + }, + "saturday": { + "defaultSetpoint": "False", + "heatingPeriods": [{ "end": 86400, "start": 0, "setpoint": "True" }] + } + } + }, + "footprint": {} + } + } +] diff --git a/tests/components/geniushub/snapshots/test_binary_sensor.ambr b/tests/components/geniushub/snapshots/test_binary_sensor.ambr new file mode 100644 index 00000000000..fcc256b5232 --- /dev/null +++ b/tests/components/geniushub/snapshots/test_binary_sensor.ambr @@ -0,0 +1,50 @@ +# serializer version: 1 +# name: test_cloud_all_sensors[binary_sensor.single_channel_receiver_22-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.single_channel_receiver_22', + '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': 'Single Channel Receiver 22', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_device_22', + 'unit_of_measurement': None, + }) +# --- +# name: test_cloud_all_sensors[binary_sensor.single_channel_receiver_22-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'assigned_zone': 'East Berlin', + 'friendly_name': 'Single Channel Receiver 22', + 'state': dict({ + }), + }), + 'context': , + 'entity_id': 'binary_sensor.single_channel_receiver_22', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- diff --git a/tests/components/geniushub/snapshots/test_climate.ambr b/tests/components/geniushub/snapshots/test_climate.ambr new file mode 100644 index 00000000000..eb372de784e --- /dev/null +++ b/tests/components/geniushub/snapshots/test_climate.ambr @@ -0,0 +1,569 @@ +# serializer version: 1 +# name: test_cloud_all_sensors[climate.bedroom-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'hvac_modes': list([ + , + , + ]), + 'max_temp': 28.0, + 'min_temp': 4.0, + 'preset_modes': list([ + 'boost', + ]), + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'climate', + 'entity_category': None, + 'entity_id': 'climate.bedroom', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:radiator', + 'original_name': 'Bedroom', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': , + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_zone_29', + 'unit_of_measurement': None, + }) +# --- +# name: test_cloud_all_sensors[climate.bedroom-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'current_temperature': 21.5, + 'friendly_name': 'Bedroom', + 'hvac_modes': list([ + , + , + ]), + 'icon': 'mdi:radiator', + 'max_temp': 28.0, + 'min_temp': 4.0, + 'preset_mode': None, + 'preset_modes': list([ + 'boost', + ]), + 'status': dict({ + 'mode': 'off', + 'override': dict({ + 'duration': 0, + 'setpoint': 23.5, + }), + 'temperature': 21.5, + 'type': 'radiator', + }), + 'supported_features': , + 'temperature': 4, + }), + 'context': , + 'entity_id': 'climate.bedroom', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_cloud_all_sensors[climate.ensuite-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'hvac_modes': list([ + , + , + ]), + 'max_temp': 28.0, + 'min_temp': 4.0, + 'preset_modes': list([ + 'activity', + 'boost', + ]), + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'climate', + 'entity_category': None, + 'entity_id': 'climate.ensuite', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:radiator', + 'original_name': 'Ensuite', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': , + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_zone_5', + 'unit_of_measurement': None, + }) +# --- +# name: test_cloud_all_sensors[climate.ensuite-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'current_temperature': 21, + 'friendly_name': 'Ensuite', + 'hvac_modes': list([ + , + , + ]), + 'icon': 'mdi:radiator', + 'max_temp': 28.0, + 'min_temp': 4.0, + 'preset_mode': None, + 'preset_modes': list([ + 'activity', + 'boost', + ]), + 'status': dict({ + 'mode': 'off', + 'occupied': 'False', + 'override': dict({ + 'duration': 0, + 'setpoint': 28, + }), + 'temperature': 21, + 'type': 'radiator', + }), + 'supported_features': , + 'temperature': 4, + }), + 'context': , + 'entity_id': 'climate.ensuite', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_cloud_all_sensors[climate.guest_room-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'hvac_modes': list([ + , + , + ]), + 'max_temp': 28.0, + 'min_temp': 4.0, + 'preset_modes': list([ + 'activity', + 'boost', + ]), + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'climate', + 'entity_category': None, + 'entity_id': 'climate.guest_room', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:radiator', + 'original_name': 'Guest room', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': , + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_zone_7', + 'unit_of_measurement': None, + }) +# --- +# name: test_cloud_all_sensors[climate.guest_room-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'current_temperature': 21, + 'friendly_name': 'Guest room', + 'hvac_modes': list([ + , + , + ]), + 'icon': 'mdi:radiator', + 'max_temp': 28.0, + 'min_temp': 4.0, + 'preset_mode': None, + 'preset_modes': list([ + 'activity', + 'boost', + ]), + 'status': dict({ + 'mode': 'off', + 'occupied': 'True', + 'override': dict({ + 'duration': 0, + 'setpoint': 20, + }), + 'temperature': 21, + 'type': 'radiator', + }), + 'supported_features': , + 'temperature': 4, + }), + 'context': , + 'entity_id': 'climate.guest_room', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_cloud_all_sensors[climate.hall-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'hvac_modes': list([ + , + , + ]), + 'max_temp': 28.0, + 'min_temp': 4.0, + 'preset_modes': list([ + 'activity', + 'boost', + ]), + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'climate', + 'entity_category': None, + 'entity_id': 'climate.hall', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:radiator', + 'original_name': 'Hall', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': , + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_zone_2', + 'unit_of_measurement': None, + }) +# --- +# name: test_cloud_all_sensors[climate.hall-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'current_temperature': 21, + 'friendly_name': 'Hall', + 'hvac_modes': list([ + , + , + ]), + 'icon': 'mdi:radiator', + 'max_temp': 28.0, + 'min_temp': 4.0, + 'preset_mode': None, + 'preset_modes': list([ + 'activity', + 'boost', + ]), + 'status': dict({ + 'mode': 'off', + 'occupied': 'False', + 'override': dict({ + 'duration': 0, + 'setpoint': 20, + }), + 'temperature': 21, + 'type': 'radiator', + }), + 'supported_features': , + 'temperature': 4, + }), + 'context': , + 'entity_id': 'climate.hall', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_cloud_all_sensors[climate.kitchen-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'hvac_modes': list([ + , + , + ]), + 'max_temp': 28.0, + 'min_temp': 4.0, + 'preset_modes': list([ + 'activity', + 'boost', + ]), + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'climate', + 'entity_category': None, + 'entity_id': 'climate.kitchen', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:radiator', + 'original_name': 'Kitchen', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': , + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_zone_3', + 'unit_of_measurement': None, + }) +# --- +# name: test_cloud_all_sensors[climate.kitchen-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'current_temperature': 21.5, + 'friendly_name': 'Kitchen', + 'hvac_modes': list([ + , + , + ]), + 'icon': 'mdi:radiator', + 'max_temp': 28.0, + 'min_temp': 4.0, + 'preset_mode': None, + 'preset_modes': list([ + 'activity', + 'boost', + ]), + 'status': dict({ + 'mode': 'off', + 'occupied': 'False', + 'override': dict({ + 'duration': 0, + 'setpoint': 20, + }), + 'temperature': 21.5, + 'type': 'radiator', + }), + 'supported_features': , + 'temperature': 4, + }), + 'context': , + 'entity_id': 'climate.kitchen', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_cloud_all_sensors[climate.lounge-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'hvac_modes': list([ + , + , + ]), + 'max_temp': 28.0, + 'min_temp': 4.0, + 'preset_modes': list([ + 'boost', + ]), + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'climate', + 'entity_category': None, + 'entity_id': 'climate.lounge', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:radiator', + 'original_name': 'Lounge', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': , + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_zone_1', + 'unit_of_measurement': None, + }) +# --- +# name: test_cloud_all_sensors[climate.lounge-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'current_temperature': 20, + 'friendly_name': 'Lounge', + 'hvac_modes': list([ + , + , + ]), + 'icon': 'mdi:radiator', + 'max_temp': 28.0, + 'min_temp': 4.0, + 'preset_mode': None, + 'preset_modes': list([ + 'boost', + ]), + 'status': dict({ + 'mode': 'off', + 'override': dict({ + 'duration': 0, + 'setpoint': 20, + }), + 'temperature': 20, + 'type': 'radiator', + }), + 'supported_features': , + 'temperature': 4, + }), + 'context': , + 'entity_id': 'climate.lounge', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_cloud_all_sensors[climate.study-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'hvac_modes': list([ + , + , + ]), + 'max_temp': 28.0, + 'min_temp': 4.0, + 'preset_modes': list([ + 'activity', + 'boost', + ]), + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'climate', + 'entity_category': None, + 'entity_id': 'climate.study', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:radiator', + 'original_name': 'Study', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': , + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_zone_30', + 'unit_of_measurement': None, + }) +# --- +# name: test_cloud_all_sensors[climate.study-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'current_temperature': 22, + 'friendly_name': 'Study', + 'hvac_modes': list([ + , + , + ]), + 'icon': 'mdi:radiator', + 'max_temp': 28.0, + 'min_temp': 4.0, + 'preset_mode': None, + 'preset_modes': list([ + 'activity', + 'boost', + ]), + 'status': dict({ + 'mode': 'off', + 'occupied': 'False', + 'override': dict({ + 'duration': 0, + 'setpoint': 28, + }), + 'temperature': 22, + 'type': 'radiator', + }), + 'supported_features': , + 'temperature': 4, + }), + 'context': , + 'entity_id': 'climate.study', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- diff --git a/tests/components/geniushub/snapshots/test_sensor.ambr b/tests/components/geniushub/snapshots/test_sensor.ambr new file mode 100644 index 00000000000..874f24cff95 --- /dev/null +++ b/tests/components/geniushub/snapshots/test_sensor.ambr @@ -0,0 +1,954 @@ +# serializer version: 1 +# name: test_cloud_all_sensors[sensor.geniushub_errors-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.geniushub_errors', + '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': 'GeniusHub Errors', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_Errors', + 'unit_of_measurement': None, + }) +# --- +# name: test_cloud_all_sensors[sensor.geniushub_errors-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'error_list': list([ + ]), + 'friendly_name': 'GeniusHub Errors', + }), + 'context': , + 'entity_id': 'sensor.geniushub_errors', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0', + }) +# --- +# name: test_cloud_all_sensors[sensor.geniushub_information-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.geniushub_information', + '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': 'GeniusHub Information', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_Information', + 'unit_of_measurement': None, + }) +# --- +# name: test_cloud_all_sensors[sensor.geniushub_information-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'GeniusHub Information', + 'information_list': list([ + ]), + }), + 'context': , + 'entity_id': 'sensor.geniushub_information', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0', + }) +# --- +# name: test_cloud_all_sensors[sensor.geniushub_warnings-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.geniushub_warnings', + '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': 'GeniusHub Warnings', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_Warnings', + 'unit_of_measurement': None, + }) +# --- +# name: test_cloud_all_sensors[sensor.geniushub_warnings-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'GeniusHub Warnings', + 'warning_list': list([ + ]), + }), + 'context': , + 'entity_id': 'sensor.geniushub_warnings', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0', + }) +# --- +# name: test_cloud_all_sensors[sensor.radiator_valve_11-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.radiator_valve_11', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': 'mdi:battery-40', + 'original_name': 'Radiator Valve 11', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_device_11', + 'unit_of_measurement': '%', + }) +# --- +# name: test_cloud_all_sensors[sensor.radiator_valve_11-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'assigned_zone': 'Lounge', + 'device_class': 'battery', + 'friendly_name': 'Radiator Valve 11', + 'icon': 'mdi:battery-40', + 'state': dict({ + 'set_temperature': 4, + }), + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.radiator_valve_11', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '43', + }) +# --- +# name: test_cloud_all_sensors[sensor.radiator_valve_56-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.radiator_valve_56', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': 'mdi:battery-50', + 'original_name': 'Radiator Valve 56', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_device_56', + 'unit_of_measurement': '%', + }) +# --- +# name: test_cloud_all_sensors[sensor.radiator_valve_56-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'assigned_zone': 'Kitchen', + 'device_class': 'battery', + 'friendly_name': 'Radiator Valve 56', + 'icon': 'mdi:battery-50', + 'state': dict({ + 'set_temperature': 4, + }), + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.radiator_valve_56', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '55', + }) +# --- +# name: test_cloud_all_sensors[sensor.radiator_valve_68-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.radiator_valve_68', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': 'mdi:battery-90', + 'original_name': 'Radiator Valve 68', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_device_68', + 'unit_of_measurement': '%', + }) +# --- +# name: test_cloud_all_sensors[sensor.radiator_valve_68-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'assigned_zone': 'Hall', + 'device_class': 'battery', + 'friendly_name': 'Radiator Valve 68', + 'icon': 'mdi:battery-90', + 'state': dict({ + 'set_temperature': 4, + }), + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.radiator_valve_68', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '92', + }) +# --- +# name: test_cloud_all_sensors[sensor.radiator_valve_78-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.radiator_valve_78', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': 'mdi:battery-40', + 'original_name': 'Radiator Valve 78', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_device_78', + 'unit_of_measurement': '%', + }) +# --- +# name: test_cloud_all_sensors[sensor.radiator_valve_78-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'assigned_zone': 'Bedroom', + 'device_class': 'battery', + 'friendly_name': 'Radiator Valve 78', + 'icon': 'mdi:battery-40', + 'state': dict({ + 'set_temperature': 4, + }), + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.radiator_valve_78', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '42', + }) +# --- +# name: test_cloud_all_sensors[sensor.radiator_valve_85-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.radiator_valve_85', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': 'mdi:battery-60', + 'original_name': 'Radiator Valve 85', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_device_85', + 'unit_of_measurement': '%', + }) +# --- +# name: test_cloud_all_sensors[sensor.radiator_valve_85-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'assigned_zone': 'Study', + 'device_class': 'battery', + 'friendly_name': 'Radiator Valve 85', + 'icon': 'mdi:battery-60', + 'state': dict({ + 'set_temperature': 4, + }), + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.radiator_valve_85', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '61', + }) +# --- +# name: test_cloud_all_sensors[sensor.radiator_valve_88-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.radiator_valve_88', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': 'mdi:battery-50', + 'original_name': 'Radiator Valve 88', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_device_88', + 'unit_of_measurement': '%', + }) +# --- +# name: test_cloud_all_sensors[sensor.radiator_valve_88-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'assigned_zone': 'Ensuite', + 'device_class': 'battery', + 'friendly_name': 'Radiator Valve 88', + 'icon': 'mdi:battery-50', + 'state': dict({ + 'set_temperature': 4, + }), + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.radiator_valve_88', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '49', + }) +# --- +# name: test_cloud_all_sensors[sensor.radiator_valve_89-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.radiator_valve_89', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': 'mdi:battery-50', + 'original_name': 'Radiator Valve 89', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_device_89', + 'unit_of_measurement': '%', + }) +# --- +# name: test_cloud_all_sensors[sensor.radiator_valve_89-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'assigned_zone': 'Kitchen', + 'device_class': 'battery', + 'friendly_name': 'Radiator Valve 89', + 'icon': 'mdi:battery-50', + 'state': dict({ + 'set_temperature': 4, + }), + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.radiator_valve_89', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '48', + }) +# --- +# name: test_cloud_all_sensors[sensor.radiator_valve_90-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.radiator_valve_90', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': 'mdi:battery-90', + 'original_name': 'Radiator Valve 90', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_device_90', + 'unit_of_measurement': '%', + }) +# --- +# name: test_cloud_all_sensors[sensor.radiator_valve_90-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'assigned_zone': 'Guest room', + 'device_class': 'battery', + 'friendly_name': 'Radiator Valve 90', + 'icon': 'mdi:battery-90', + 'state': dict({ + 'set_temperature': 4, + }), + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.radiator_valve_90', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '92', + }) +# --- +# name: test_cloud_all_sensors[sensor.room_sensor_16-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.room_sensor_16', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': 'mdi:battery', + 'original_name': 'Room Sensor 16', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_device_16', + 'unit_of_measurement': '%', + }) +# --- +# name: test_cloud_all_sensors[sensor.room_sensor_16-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'assigned_zone': 'Guest room', + 'device_class': 'battery', + 'friendly_name': 'Room Sensor 16', + 'icon': 'mdi:battery', + 'state': dict({ + 'luminance': 29, + 'measured_temperature': 21, + 'occupancy_trigger': 255, + }), + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.room_sensor_16', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '100', + }) +# --- +# name: test_cloud_all_sensors[sensor.room_sensor_17-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.room_sensor_17', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': 'mdi:battery', + 'original_name': 'Room Sensor 17', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_device_17', + 'unit_of_measurement': '%', + }) +# --- +# name: test_cloud_all_sensors[sensor.room_sensor_17-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'assigned_zone': 'Ensuite', + 'device_class': 'battery', + 'friendly_name': 'Room Sensor 17', + 'icon': 'mdi:battery', + 'state': dict({ + 'luminance': 32, + 'measured_temperature': 21, + 'occupancy_trigger': 0, + }), + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.room_sensor_17', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '100', + }) +# --- +# name: test_cloud_all_sensors[sensor.room_sensor_18-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.room_sensor_18', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': 'mdi:battery-alert', + 'original_name': 'Room Sensor 18', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_device_18', + 'unit_of_measurement': '%', + }) +# --- +# name: test_cloud_all_sensors[sensor.room_sensor_18-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'assigned_zone': 'Bedroom', + 'device_class': 'battery', + 'friendly_name': 'Room Sensor 18', + 'icon': 'mdi:battery-alert', + 'state': dict({ + 'luminance': 1, + 'measured_temperature': 21.5, + 'occupancy_trigger': 0, + }), + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.room_sensor_18', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '36', + }) +# --- +# name: test_cloud_all_sensors[sensor.room_sensor_20-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.room_sensor_20', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': 'mdi:battery', + 'original_name': 'Room Sensor 20', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_device_20', + 'unit_of_measurement': '%', + }) +# --- +# name: test_cloud_all_sensors[sensor.room_sensor_20-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'assigned_zone': 'Kitchen', + 'device_class': 'battery', + 'friendly_name': 'Room Sensor 20', + 'icon': 'mdi:battery', + 'state': dict({ + 'luminance': 1, + 'measured_temperature': 21.5, + 'occupancy_trigger': 0, + }), + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.room_sensor_20', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '100', + }) +# --- +# name: test_cloud_all_sensors[sensor.room_sensor_21-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.room_sensor_21', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': 'mdi:battery', + 'original_name': 'Room Sensor 21', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_device_21', + 'unit_of_measurement': '%', + }) +# --- +# name: test_cloud_all_sensors[sensor.room_sensor_21-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'assigned_zone': 'Hall', + 'device_class': 'battery', + 'friendly_name': 'Room Sensor 21', + 'icon': 'mdi:battery', + 'state': dict({ + 'luminance': 33, + 'measured_temperature': 21, + 'occupancy_trigger': 0, + }), + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.room_sensor_21', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '100', + }) +# --- +# name: test_cloud_all_sensors[sensor.room_sensor_50-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.room_sensor_50', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': 'mdi:battery', + 'original_name': 'Room Sensor 50', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_device_50', + 'unit_of_measurement': '%', + }) +# --- +# name: test_cloud_all_sensors[sensor.room_sensor_50-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'assigned_zone': 'Study', + 'device_class': 'battery', + 'friendly_name': 'Room Sensor 50', + 'icon': 'mdi:battery', + 'state': dict({ + 'luminance': 34, + 'measured_temperature': 22, + 'occupancy_trigger': 0, + }), + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.room_sensor_50', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '100', + }) +# --- +# name: test_cloud_all_sensors[sensor.room_sensor_53-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.room_sensor_53', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': 'mdi:battery-alert', + 'original_name': 'Room Sensor 53', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_device_53', + 'unit_of_measurement': '%', + }) +# --- +# name: test_cloud_all_sensors[sensor.room_sensor_53-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'assigned_zone': 'Lounge', + 'device_class': 'battery', + 'friendly_name': 'Room Sensor 53', + 'icon': 'mdi:battery-alert', + 'state': dict({ + 'luminance': 0, + 'measured_temperature': 0, + 'occupancy_trigger': 0, + }), + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.room_sensor_53', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '28', + }) +# --- diff --git a/tests/components/geniushub/snapshots/test_switch.ambr b/tests/components/geniushub/snapshots/test_switch.ambr new file mode 100644 index 00000000000..6c3c95af477 --- /dev/null +++ b/tests/components/geniushub/snapshots/test_switch.ambr @@ -0,0 +1,166 @@ +# serializer version: 1 +# name: test_cloud_all_sensors[switch.bedroom_socket-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.bedroom_socket', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Bedroom Socket', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_zone_27', + 'unit_of_measurement': None, + }) +# --- +# name: test_cloud_all_sensors[switch.bedroom_socket-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'outlet', + 'friendly_name': 'Bedroom Socket', + 'status': dict({ + 'mode': 'timer', + 'override': dict({ + 'duration': 0, + 'setpoint': 'True', + }), + 'type': 'on / off', + }), + }), + 'context': , + 'entity_id': 'switch.bedroom_socket', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_cloud_all_sensors[switch.kitchen_socket-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.kitchen_socket', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Kitchen Socket', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_zone_28', + 'unit_of_measurement': None, + }) +# --- +# name: test_cloud_all_sensors[switch.kitchen_socket-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'outlet', + 'friendly_name': 'Kitchen Socket', + 'status': dict({ + 'mode': 'timer', + 'override': dict({ + 'duration': 0, + 'setpoint': 'True', + }), + 'type': 'on / off', + }), + }), + 'context': , + 'entity_id': 'switch.kitchen_socket', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_cloud_all_sensors[switch.study_socket-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.study_socket', + 'has_entity_name': False, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Study Socket', + 'platform': 'geniushub', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '01J71MQF0EC62D620DGYNG2R8H_zone_32', + 'unit_of_measurement': None, + }) +# --- +# name: test_cloud_all_sensors[switch.study_socket-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'outlet', + 'friendly_name': 'Study Socket', + 'status': dict({ + 'mode': 'off', + 'override': dict({ + 'duration': 0, + 'setpoint': 'True', + }), + 'type': 'on / off', + }), + }), + 'context': , + 'entity_id': 'switch.study_socket', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- diff --git a/tests/components/geniushub/test_binary_sensor.py b/tests/components/geniushub/test_binary_sensor.py new file mode 100644 index 00000000000..682929eb696 --- /dev/null +++ b/tests/components/geniushub/test_binary_sensor.py @@ -0,0 +1,32 @@ +"""Tests for the Geniushub binary sensor platform.""" + +from unittest.mock import patch + +import pytest +from syrupy import SnapshotAssertion + +from homeassistant.const import Platform +from homeassistant.core import HomeAssistant +from homeassistant.helpers import entity_registry as er + +from . import setup_integration + +from tests.common import MockConfigEntry, snapshot_platform + + +@pytest.mark.usefixtures("mock_geniushub_cloud") +async def test_cloud_all_sensors( + hass: HomeAssistant, + mock_cloud_config_entry: MockConfigEntry, + entity_registry: er.EntityRegistry, + snapshot: SnapshotAssertion, +) -> None: + """Test the creation of the Genius Hub binary sensors.""" + with patch( + "homeassistant.components.geniushub.PLATFORMS", [Platform.BINARY_SENSOR] + ): + await setup_integration(hass, mock_cloud_config_entry) + + await snapshot_platform( + hass, entity_registry, snapshot, mock_cloud_config_entry.entry_id + ) diff --git a/tests/components/geniushub/test_climate.py b/tests/components/geniushub/test_climate.py new file mode 100644 index 00000000000..d14e57b9552 --- /dev/null +++ b/tests/components/geniushub/test_climate.py @@ -0,0 +1,30 @@ +"""Tests for the Geniushub climate platform.""" + +from unittest.mock import patch + +import pytest +from syrupy import SnapshotAssertion + +from homeassistant.const import Platform +from homeassistant.core import HomeAssistant +from homeassistant.helpers import entity_registry as er + +from . import setup_integration + +from tests.common import MockConfigEntry, snapshot_platform + + +@pytest.mark.usefixtures("mock_geniushub_cloud") +async def test_cloud_all_sensors( + hass: HomeAssistant, + mock_cloud_config_entry: MockConfigEntry, + entity_registry: er.EntityRegistry, + snapshot: SnapshotAssertion, +) -> None: + """Test the creation of the Genius Hub climate entities.""" + with patch("homeassistant.components.geniushub.PLATFORMS", [Platform.CLIMATE]): + await setup_integration(hass, mock_cloud_config_entry) + + await snapshot_platform( + hass, entity_registry, snapshot, mock_cloud_config_entry.entry_id + ) diff --git a/tests/components/geniushub/test_sensor.py b/tests/components/geniushub/test_sensor.py new file mode 100644 index 00000000000..a75329ca7fc --- /dev/null +++ b/tests/components/geniushub/test_sensor.py @@ -0,0 +1,30 @@ +"""Tests for the Geniushub sensor platform.""" + +from unittest.mock import patch + +import pytest +from syrupy import SnapshotAssertion + +from homeassistant.const import Platform +from homeassistant.core import HomeAssistant +from homeassistant.helpers import entity_registry as er + +from . import setup_integration + +from tests.common import MockConfigEntry, snapshot_platform + + +@pytest.mark.usefixtures("mock_geniushub_cloud") +async def test_cloud_all_sensors( + hass: HomeAssistant, + mock_cloud_config_entry: MockConfigEntry, + entity_registry: er.EntityRegistry, + snapshot: SnapshotAssertion, +) -> None: + """Test the creation of the Genius Hub sensors.""" + with patch("homeassistant.components.geniushub.PLATFORMS", [Platform.SENSOR]): + await setup_integration(hass, mock_cloud_config_entry) + + await snapshot_platform( + hass, entity_registry, snapshot, mock_cloud_config_entry.entry_id + ) diff --git a/tests/components/geniushub/test_switch.py b/tests/components/geniushub/test_switch.py new file mode 100644 index 00000000000..0e88562e381 --- /dev/null +++ b/tests/components/geniushub/test_switch.py @@ -0,0 +1,30 @@ +"""Tests for the Geniushub switch platform.""" + +from unittest.mock import patch + +import pytest +from syrupy import SnapshotAssertion + +from homeassistant.const import Platform +from homeassistant.core import HomeAssistant +from homeassistant.helpers import entity_registry as er + +from . import setup_integration + +from tests.common import MockConfigEntry, snapshot_platform + + +@pytest.mark.usefixtures("mock_geniushub_cloud") +async def test_cloud_all_sensors( + hass: HomeAssistant, + mock_cloud_config_entry: MockConfigEntry, + entity_registry: er.EntityRegistry, + snapshot: SnapshotAssertion, +) -> None: + """Test the creation of the Genius Hub switch entities.""" + with patch("homeassistant.components.geniushub.PLATFORMS", [Platform.SWITCH]): + await setup_integration(hass, mock_cloud_config_entry) + + await snapshot_platform( + hass, entity_registry, snapshot, mock_cloud_config_entry.entry_id + )