diff --git a/.devcontainer.json b/.devcontainer.json index 3a2ef7b..b681928 100644 --- a/.devcontainer.json +++ b/.devcontainer.json @@ -30,6 +30,7 @@ "editor.tabSize": 4, "python.pythonPath": "/usr/bin/python3", "python.analysis.autoSearchPaths": false, + "python.testing.pytestEnabled": true, "[python]": { "editor.defaultFormatter": "charliermarsh.ruff", "editor.formatOnSave": true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 42411ac..3b51bb7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.2 + rev: v0.8.4 hooks: - id: ruff args: diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 3712add..1b07ae5 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,35 +1,80 @@ { - "version": "2.0.0", - "tasks": [ - { - "label": "Run Home Assistant on port 9126", - "type": "shell", - "command": "scripts/develop", - "problemMatcher": [] + "version": "2.0.0", + "tasks": [ + { + "label": "Run Home Assistant on port 9126", + "type": "shell", + "command": "scripts/develop", + "problemMatcher": [] + }, + { + "label": "Upgrade Home Assistant to latest (beta)", + "type": "shell", + "command": "scripts/upgrade", + "problemMatcher": [] + }, + { + "label": "Load Home Assistant from github - dev branch", + "type": "shell", + "command": "scripts/dev-branch", + "problemMatcher": [] + }, + { + "label": "Load specific version of Home Assistant", + "type": "shell", + "command": "scripts/specific-version", + "problemMatcher": [] + }, + { + "label": "Lint with ruff", + "type": "shell", + "command": "scripts/lint", + "problemMatcher": [] + }, + { + "label": "Pre-commit", + "type": "shell", + "command": "pre-commit run --show-diff-on-failure", + "group": { + "kind": "test", + "isDefault": true }, - { - "label": "Upgrade Home Assistant to latest (beta)", - "type": "shell", - "command": "scripts/upgrade", - "problemMatcher": [] + "presentation": { + "reveal": "always", + "panel": "new" }, - { - "label": "Load Home Assistant from github - dev branch", - "type": "shell", - "command": "scripts/dev-branch", - "problemMatcher": [] + "problemMatcher": [] + }, + { + "label": "Update syrupy snapshots", + "detail": "Update syrupy snapshots for a given integration.", + "type": "shell", + "command": "${command:python.interpreterPath} -m pytest ./tests/ --snapshot-update", + "dependsOn": [ + "Compile English translations" + ], + "group": { + "kind": "test", + "isDefault": true }, - { - "label": "Load specific version of Home Assistant", - "type": "shell", - "command": "scripts/specific-version", - "problemMatcher": [] + "presentation": { + "reveal": "always", + "panel": "new" }, - { - "label": "Lint with ruff", - "type": "shell", - "command": "scripts/lint", - "problemMatcher": [] - } - ] - } + "problemMatcher": [] + }, + { + "label": "Lint with ruff", + "type": "shell", + "command": "scripts/lint", + "problemMatcher": [] + } + ], + "inputs": [ + { + "id": "integrationName", + "type": "promptString", + "description": "For which integration should the task run?" + } + ] +} diff --git a/custom_components/weatherlink/__init__.py b/custom_components/weatherlink/__init__.py index 4f693fc..4115431 100644 --- a/custom_components/weatherlink/__init__.py +++ b/custom_components/weatherlink/__init__.py @@ -543,8 +543,7 @@ async def async_fetch(): api = entry.runtime_data.api try: async with asyncio.timeout(10): - res = await api.request("GET") - json_data = await res.json() + json_data = await api.get_data() entry.runtime_data.current = json_data return _preprocess(json_data) except ClientResponseError as exc: diff --git a/custom_components/weatherlink/config_flow.py b/custom_components/weatherlink/config_flow.py index 40df89c..1fe4f38 100644 --- a/custom_components/weatherlink/config_flow.py +++ b/custom_components/weatherlink/config_flow.py @@ -220,7 +220,6 @@ async def async_step_user_3( SelectOptionDict(value=str(stn[CONF_STATION_ID]), label=stn["station_name"]) for stn in (station_list_raw["stations"]) ] - if user_input is None: return self.async_show_form( step_id="user_3", diff --git a/pyproject.toml b/pyproject.toml index 57af33c..19ab11e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -438,3 +438,11 @@ fixture-parentheses = false [tools.ruff.lint.mccabe] max-complexity = 25 + +[tool.pytest.ini_options] +asyncio_mode = "auto" + +[tool.coverage.run] +omit = [ + "*/tests/*" + ] diff --git a/requirements.txt b/requirements.txt index 0f6ba99..1269626 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ ruff==0.8.4 pre-commit==4.0.1 bumpver==2024.1130 urllib3>=1.26.5,<2 +pytest-homeassistant-custom-component diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..056f0ee --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,13 @@ +"""Stub - must be here.""" + +from pytest_homeassistant_custom_component.common import MockConfigEntry + +from homeassistant.core import HomeAssistant + + +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() # ? Needed ? diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..b48033e --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,141 @@ +"""pytest fixtures.""" + +from collections.abc import Generator +from unittest.mock import patch + +import pytest +from pytest_homeassistant_custom_component.common import load_fixture +from pytest_homeassistant_custom_component.syrupy import HomeAssistantSnapshotExtension +from syrupy import SnapshotAssertion + +from homeassistant.core import HomeAssistant +from homeassistant.util.json import json_loads + +# pylint: disable=redefined-outer-name + + +@pytest.fixture(autouse=True) +def auto_enable_custom_integrations(enable_custom_integrations): + """Enable custom integrations defined in the test dir.""" + return + + +@pytest.fixture +def data_file_name() -> str: + """Filename for data fixture.""" + return "strp81.json" + + +@pytest.fixture(name="load_default_station") +def load_default_station_fixture(data_file_name: str) -> dict: + """Load data for default station.""" + return json_loads(load_fixture(data_file_name)) + # data = json_loads(load_fixture(data_file_name)) + # result = data["GetSingleStationResult"] + # res = {} + # for sample in data["GetSingleStationResult"]["Samples"]: + # res[sample["Name"]] = sample + # result["Samples"] = res + # return result + + +@pytest.fixture(name="load_all_stations") +def load_all_stations_fixture() -> dict: + """Load data for all stations.""" + return json_loads(load_fixture("all_stations.json")) + + +@pytest.fixture(name="load_default_data") +def load_default_data_fixture() -> dict: + """Load data for a station.""" + return json_loads(load_fixture("strp81_current.json")) + + +@pytest.fixture(name="load_sensors") +def load_sensors_fixture() -> dict: + """Load data for all stations.""" + return json_loads(load_fixture("sensors.json")) + + +# data = json_loads(load_fixture("all_stations.json")) +# result = data["GetStationsResult"]["Stations"] +# return [Station(station_data) for station_data in result] + + +@pytest.fixture(name="bypass_get_data") +def bypass_get_data_fixture( + hass: HomeAssistant, + load_default_data: dict, +): + """Skip calls to get data from API.""" + with patch( + "custom_components.weatherlink.pyweatherlink.WLHubV2.get_data", + return_value=load_default_data, + ): + yield + + +@pytest.fixture(name="bypass_get_station") +def bypass_get_station_fixture( + hass: HomeAssistant, + load_default_station: dict, +): + """Skip calls to get data from API.""" + with patch( + "custom_components.weatherlink.pyweatherlink.WLHubV2.get_station", + return_value=load_default_station, + ): + yield + + +@pytest.fixture(name="bypass_get_all_sensors") +def bypass_get_all_sensors_fixture( + hass: HomeAssistant, + load_sensors: dict, +): + """Skip calls to get data from API.""" + with patch( + "custom_components.weatherlink.pyweatherlink.WLHubV2.get_all_sensors", + return_value=load_sensors, + ): + yield + + +@pytest.fixture(name="bypass_get_all_stations") +def bypass_get_all_stations_fixture( + hass: HomeAssistant, + load_all_stations: dict, +): + """Skip calls to get data from API.""" + with patch( + "custom_components.weatherlink.pyweatherlink.WLHubV2.get_all_stations", + return_value=load_all_stations, + ): + yield + + +@pytest.fixture +def entity_registry_enabled_by_default() -> Generator[None]: + """Test fixture that ensures all entities are enabled in the registry.""" + with patch( + "homeassistant.helpers.entity.Entity.entity_registry_enabled_default", + return_value=True, + ): + yield + + +@pytest.fixture +def snapshot(snapshot: SnapshotAssertion) -> SnapshotAssertion: + """Return snapshot assertion fixture with the Home Assistant extension.""" + return snapshot.use_extension(HomeAssistantSnapshotExtension) + + +@pytest.fixture +def mock_api(): + """Mock api.""" + with ( + patch( + "custom_components.weatherlink.pyweatherlink.WLHubV2.get_data" + ) as mock_api, + ): + yield mock_api diff --git a/tests/const.py b/tests/const.py new file mode 100644 index 0000000..d8ddfc7 --- /dev/null +++ b/tests/const.py @@ -0,0 +1,9 @@ +"""Constants for weatherlink tests.""" + +ENTRY_ID = "test" +MOCK_CONFIG_V2 = { + "api_version": "api_v2", + "api_key_v2": "apikey2", + "api_secret": "apisecret", + "station_id": "167531", +} diff --git a/tests/fixtures/all_stations.json b/tests/fixtures/all_stations.json new file mode 100644 index 0000000..7e5026b --- /dev/null +++ b/tests/fixtures/all_stations.json @@ -0,0 +1,265 @@ +{ + "stations": [ + { + "station_id": 3362, + "station_id_uuid": "b1b3b7b4-fc23-4169-bf32-4c54f232a225", + "station_name": "Säby, Tjörn", + "gateway_id": 14696303, + "gateway_id_hex": "001D0AE03F6F", + "product_number": "06558", + "username": "elji", + "user_email": "lennart.j@elji.se", + "company_name": "", + "active": true, + "private": false, + "recording_interval": 10, + "firmware_version": "6.0.0", + "registered_date": 1517988730, + "time_zone": "Europe/Stockholm", + "city": "Kållekärr", + "region": "Västra Götalands län", + "country": "Sweden", + "latitude": 58.01418, + "longitude": 11.58347, + "elevation": 36.56343, + "gateway_type": "WeatherLink Network Annual Subscription", + "relationship_type": "Shared", + "subscription_type": "Basic" + }, + { + "station_id": 9926, + "station_id_uuid": "165cf907-edba-47b3-91f6-058e56d57a16", + "station_name": "Saltsjö-Duvnäs", + "gateway_id": 10522, + "gateway_id_hex": "001D0A00291A", + "product_number": "6555", + "username": "astrandb", + "user_email": "ake@strandberg.eu", + "company_name": "", + "active": true, + "private": false, + "recording_interval": 30, + "firmware_version": "1.1.5", + "registered_date": 1288518505, + "time_zone": "Europe/Stockholm", + "city": "Saltsjö-Duvnäs", + "region": "", + "country": "Sweden", + "latitude": 59.3055, + "longitude": 18.2159, + "elevation": 0.0, + "gateway_type": "WeatherLinkIP", + "relationship_type": "Owned", + "subscription_type": "Basic" + }, + { + "station_id": 9930, + "station_id_uuid": "4d4142f2-41ba-44f6-a1ff-36f4e3fad43f", + "station_name": "Singö", + "gateway_id": 10445, + "gateway_id_hex": "001D0A0028CD", + "product_number": "6555", + "username": "astrandb", + "user_email": "ake@strandberg.eu", + "company_name": "", + "active": true, + "private": false, + "recording_interval": 30, + "firmware_version": "1.1.5", + "registered_date": 1286916920, + "time_zone": "Europe/Stockholm", + "city": "", + "region": "Stockholms län", + "country": "Sweden", + "latitude": 60.1899, + "longitude": 18.7688, + "elevation": 0.0, + "gateway_type": "WeatherLinkIP", + "relationship_type": "Owned", + "subscription_type": "Basic" + }, + { + "station_id": 9951, + "station_id_uuid": "77763191-1cf8-409b-9e21-59667af79b12", + "station_name": "Fryksås S", + "gateway_id": 10039, + "gateway_id_hex": "001D0A002737", + "product_number": "6555", + "username": "astrandb", + "user_email": "ake@strandberg.eu", + "company_name": "", + "active": true, + "private": false, + "recording_interval": 5, + "firmware_version": "1.1.5", + "registered_date": 1303412309, + "time_zone": "Europe/Stockholm", + "city": "Fryksås", + "region": "Dalarnas län", + "country": "Sweden", + "latitude": 61.19411, + "longitude": 14.52955, + "elevation": 0.0, + "gateway_type": "WeatherLinkIP", + "relationship_type": "Owned", + "subscription_type": "Pro" + }, + { + "station_id": 11093, + "station_id_uuid": "144f9188-37f9-40ee-817e-19234eb54b9b", + "station_name": "Fryksås", + "gateway_id": 10474, + "gateway_id_hex": "001D0A0028EA", + "product_number": "6555", + "username": "petman", + "user_email": "peter@mandel.se", + "company_name": "", + "active": true, + "private": false, + "recording_interval": 30, + "firmware_version": "1.1.5", + "registered_date": 1291805298, + "time_zone": "Europe/Stockholm", + "city": "Fryksås", + "region": "Dalarna", + "country": "Sweden", + "latitude": 61.194283, + "longitude": 14.528561, + "elevation": 0.0, + "gateway_type": "WeatherLinkIP", + "relationship_type": "Shared", + "subscription_type": "Basic" + }, + { + "station_id": 75649, + "station_id_uuid": "44df599c-f4b8-4905-a564-5e57a2b018f0", + "station_name": "Weather on Tjörn", + "gateway_id": 7406856, + "gateway_id_hex": "001D0A710508", + "product_number": "6100EU", + "username": "elji", + "user_email": "lennart.j@elji.se", + "company_name": "", + "active": true, + "private": false, + "recording_interval": 15, + "firmware_version": null, + "registered_date": 1565858014, + "time_zone": "Europe/Stockholm", + "city": "Kållekärr", + "region": "Västra Götalands län", + "country": "Sweden", + "latitude": 58.01417, + "longitude": 11.58346, + "elevation": 36.34928, + "gateway_type": "WeatherLink Live", + "relationship_type": "Shared", + "subscription_type": "Pro" + }, + { + "station_id": 86310, + "station_id_uuid": "59d1bf91-0a05-4587-baee-c98534dfbbbd", + "station_name": "Lille Lyngholmen LIVE", + "gateway_id": 7408476, + "gateway_id_hex": "001D0A710B5C", + "product_number": "6100EU", + "username": "lillelyngholmen", + "user_email": "gunnar@malmgard.no", + "company_name": "", + "active": true, + "private": false, + "recording_interval": 5, + "firmware_version": null, + "registered_date": 1583506804, + "time_zone": "Europe/Oslo", + "city": "", + "region": "Agder", + "country": "Norway", + "latitude": 58.24263, + "longitude": 8.45059, + "elevation": 6.67509, + "gateway_type": "WeatherLink Live", + "relationship_type": "Shared", + "subscription_type": "Pro" + }, + { + "station_id": 167376, + "station_id_uuid": "e49a32ea-dd9c-4bdb-8354-00141a381845", + "station_name": "Askön", + "gateway_id": 7443460, + "gateway_id_hex": "001D0A719404", + "product_number": "6100EU", + "username": "petman", + "user_email": "peter@mandel.se", + "company_name": "", + "active": true, + "private": false, + "recording_interval": 5, + "firmware_version": null, + "registered_date": 1693647909, + "time_zone": "Europe/Stockholm", + "city": "Blidö", + "region": "Stockholm County", + "country": "Sweden", + "latitude": 59.60993, + "longitude": 18.770649, + "elevation": 16.353, + "gateway_type": "WeatherLink Live", + "relationship_type": "Shared", + "subscription_type": "Pro" + }, + { + "station_id": 167531, + "station_id_uuid": "03e7585a-4f29-4e7c-b6cb-d9e17313b07c", + "station_name": "Strp81", + "gateway_id": 12586491, + "gateway_id_hex": "001d0ac00dfb", + "product_number": "6313", + "username": "astrandb", + "user_email": "ake@strandberg.eu", + "company_name": "", + "active": true, + "private": false, + "recording_interval": 5, + "firmware_version": "1.4.59", + "registered_date": 1693934167, + "time_zone": "Europe/Stockholm", + "city": "Saltsjö-duvnäs", + "region": "Stockholms län", + "country": "Sweden", + "latitude": 59.30568, + "longitude": 18.21594, + "elevation": 37.216557, + "gateway_type": "WeatherLink Console", + "relationship_type": "Owned", + "subscription_type": "Pro" + }, + { + "station_id": 183139, + "station_id_uuid": "c04a572b-583e-4e45-a222-7444e0ae7697", + "station_name": "Saltsjö-Duvnäs AQ", + "gateway_id": 0, + "gateway_id_hex": "", + "product_number": null, + "username": "astrandb", + "user_email": "ake@strandberg.eu", + "company_name": "", + "active": true, + "private": false, + "recording_interval": 0, + "firmware_version": null, + "registered_date": 1712660326, + "time_zone": "Europe/Stockholm", + "city": "Saltsjö-duvnäs", + "region": "Stockholms län", + "country": "Sweden", + "latitude": 59.305717, + "longitude": 18.215973, + "elevation": 0.0, + "gateway_type": "AirLink", + "relationship_type": "Owned", + "subscription_type": "Basic" + } + ], + "generated_at": 1735385563 +} diff --git a/tests/fixtures/sensors.json b/tests/fixtures/sensors.json new file mode 100644 index 0000000..c90813d --- /dev/null +++ b/tests/fixtures/sensors.json @@ -0,0 +1,1061 @@ +{ + "sensors": [ + { + "lsid": 13997, + "sensor_type": 3, + "category": "Barometer", + "manufacturer": "Davis Instruments", + "product_name": "Barometer", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1517988730, + "modified_date": 1517988730, + "station_id": 3362, + "station_id_uuid": "b1b3b7b4-fc23-4169-bf32-4c54f232a225", + "station_name": "Säby, Tjörn", + "parent_device_type": "Gateway", + "parent_device_name": "Säby, Tjörn", + "parent_device_id": 14696303, + "parent_device_id_hex": "001D0AE03F6F", + "port_number": -1, + "latitude": 58.01418, + "longitude": 11.58347, + "elevation": 36.56343, + "tx_id": null + }, + { + "lsid": 13998, + "sensor_type": 4, + "category": "Solar Radiation", + "manufacturer": "Davis Instruments", + "product_name": "Solar Radiation", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1517988730, + "modified_date": 1517988730, + "station_id": 3362, + "station_id_uuid": "b1b3b7b4-fc23-4169-bf32-4c54f232a225", + "station_name": "Säby, Tjörn", + "parent_device_type": "Gateway", + "parent_device_name": "Säby, Tjörn", + "parent_device_id": 14696303, + "parent_device_id_hex": "001D0AE03F6F", + "port_number": -1, + "latitude": 58.01418, + "longitude": 11.58347, + "elevation": 36.56343, + "tx_id": null + }, + { + "lsid": 13999, + "sensor_type": 5, + "category": "Ultra Violet", + "manufacturer": "Davis Instruments", + "product_name": "Ultra Violet", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1517988730, + "modified_date": 1517988730, + "station_id": 3362, + "station_id_uuid": "b1b3b7b4-fc23-4169-bf32-4c54f232a225", + "station_name": "Säby, Tjörn", + "parent_device_type": "Gateway", + "parent_device_name": "Säby, Tjörn", + "parent_device_id": 14696303, + "parent_device_id_hex": "001D0AE03F6F", + "port_number": -1, + "latitude": 58.01418, + "longitude": 11.58347, + "elevation": 36.56343, + "tx_id": null + }, + { + "lsid": 14091, + "sensor_type": 9, + "category": "Soil Temperature", + "manufacturer": "Davis Instruments", + "product_name": "Soil Temp 1", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1518025210, + "modified_date": 1518025210, + "station_id": 3362, + "station_id_uuid": "b1b3b7b4-fc23-4169-bf32-4c54f232a225", + "station_name": "Säby, Tjörn", + "parent_device_type": "Gateway", + "parent_device_name": "Säby, Tjörn", + "parent_device_id": 14696303, + "parent_device_id_hex": "001D0AE03F6F", + "port_number": -1, + "latitude": 58.01418, + "longitude": 11.58347, + "elevation": 36.56343, + "tx_id": null + }, + { + "lsid": 14092, + "sensor_type": 10, + "category": "Soil Temperature", + "manufacturer": "Davis Instruments", + "product_name": "Soil Temp 2", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1518025210, + "modified_date": 1518025210, + "station_id": 3362, + "station_id_uuid": "b1b3b7b4-fc23-4169-bf32-4c54f232a225", + "station_name": "Säby, Tjörn", + "parent_device_type": "Gateway", + "parent_device_name": "Säby, Tjörn", + "parent_device_id": 14696303, + "parent_device_id_hex": "001D0AE03F6F", + "port_number": -1, + "latitude": 58.01418, + "longitude": 11.58347, + "elevation": 36.56343, + "tx_id": null + }, + { + "lsid": 14093, + "sensor_type": 11, + "category": "Soil Temperature", + "manufacturer": "Davis Instruments", + "product_name": "Soil Temp 3", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1518025210, + "modified_date": 1518025210, + "station_id": 3362, + "station_id_uuid": "b1b3b7b4-fc23-4169-bf32-4c54f232a225", + "station_name": "Säby, Tjörn", + "parent_device_type": "Gateway", + "parent_device_name": "Säby, Tjörn", + "parent_device_id": 14696303, + "parent_device_id_hex": "001D0AE03F6F", + "port_number": -1, + "latitude": 58.01418, + "longitude": 11.58347, + "elevation": 36.56343, + "tx_id": null + }, + { + "lsid": 14094, + "sensor_type": 13, + "category": "Leaf Temperature", + "manufacturer": "Davis Instruments", + "product_name": "Leaf Temp 1", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1518025210, + "modified_date": 1518025210, + "station_id": 3362, + "station_id_uuid": "b1b3b7b4-fc23-4169-bf32-4c54f232a225", + "station_name": "Säby, Tjörn", + "parent_device_type": "Gateway", + "parent_device_name": "Säby, Tjörn", + "parent_device_id": 14696303, + "parent_device_id_hex": "001D0AE03F6F", + "port_number": -1, + "latitude": 58.01418, + "longitude": 11.58347, + "elevation": 36.56343, + "tx_id": null + }, + { + "lsid": 14095, + "sensor_type": 14, + "category": "Leaf Temperature", + "manufacturer": "Davis Instruments", + "product_name": "Leaf Temp 2", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1518025210, + "modified_date": 1518025210, + "station_id": 3362, + "station_id_uuid": "b1b3b7b4-fc23-4169-bf32-4c54f232a225", + "station_name": "Säby, Tjörn", + "parent_device_type": "Gateway", + "parent_device_name": "Säby, Tjörn", + "parent_device_id": 14696303, + "parent_device_id_hex": "001D0AE03F6F", + "port_number": -1, + "latitude": 58.01418, + "longitude": 11.58347, + "elevation": 36.56343, + "tx_id": null + }, + { + "lsid": 14097, + "sensor_type": 17, + "category": "Soil Moisture", + "manufacturer": "Davis Instruments", + "product_name": "Soil Moisture 1", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1518025210, + "modified_date": 1518025210, + "station_id": 3362, + "station_id_uuid": "b1b3b7b4-fc23-4169-bf32-4c54f232a225", + "station_name": "Säby, Tjörn", + "parent_device_type": "Gateway", + "parent_device_name": "Säby, Tjörn", + "parent_device_id": 14696303, + "parent_device_id_hex": "001D0AE03F6F", + "port_number": -1, + "latitude": 58.01418, + "longitude": 11.58347, + "elevation": 36.56343, + "tx_id": null + }, + { + "lsid": 14098, + "sensor_type": 21, + "category": "Leaf Wetness", + "manufacturer": "Davis Instruments", + "product_name": "Leaf Wetness 1", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1518025210, + "modified_date": 1518025210, + "station_id": 3362, + "station_id_uuid": "b1b3b7b4-fc23-4169-bf32-4c54f232a225", + "station_name": "Säby, Tjörn", + "parent_device_type": "Gateway", + "parent_device_name": "Säby, Tjörn", + "parent_device_id": 14696303, + "parent_device_id_hex": "001D0AE03F6F", + "port_number": -1, + "latitude": 58.01418, + "longitude": 11.58347, + "elevation": 36.56343, + "tx_id": null + }, + { + "lsid": 560697, + "sensor_type": 22, + "category": "Leaf Wetness", + "manufacturer": "Davis Instruments", + "product_name": "Leaf Wetness 2", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1667813348, + "modified_date": 1667813348, + "station_id": 3362, + "station_id_uuid": "b1b3b7b4-fc23-4169-bf32-4c54f232a225", + "station_name": "Säby, Tjörn", + "parent_device_type": "Gateway", + "parent_device_name": "Säby, Tjörn", + "parent_device_id": 14696303, + "parent_device_id_hex": "001D0AE03F6F", + "port_number": -1, + "latitude": 58.01418, + "longitude": 11.58347, + "elevation": 36.56343, + "tx_id": null + }, + { + "lsid": 13996, + "sensor_type": 34, + "category": "ISS", + "manufacturer": "Davis Instruments", + "product_name": "Vantage Pro Plus", + "product_number": "", + "rain_collector_type": 3, + "active": true, + "created_date": 1517988730, + "modified_date": 1517988730, + "station_id": 3362, + "station_id_uuid": "b1b3b7b4-fc23-4169-bf32-4c54f232a225", + "station_name": "Säby, Tjörn", + "parent_device_type": "Gateway", + "parent_device_name": "Säby, Tjörn", + "parent_device_id": 14696303, + "parent_device_id_hex": "001D0AE03F6F", + "port_number": 9, + "latitude": 58.01418, + "longitude": 11.58347, + "elevation": 36.56343, + "tx_id": null + }, + { + "lsid": 34949, + "sensor_type": 3, + "category": "Barometer", + "manufacturer": "Davis Instruments", + "product_name": "Barometer", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1528926613, + "modified_date": 1528926613, + "station_id": 9926, + "station_id_uuid": "165cf907-edba-47b3-91f6-058e56d57a16", + "station_name": "Saltsjö-Duvnäs", + "parent_device_type": "Gateway", + "parent_device_name": "Saltsjö-Duvnäs", + "parent_device_id": 10522, + "parent_device_id_hex": "001D0A00291A", + "port_number": -1, + "latitude": 59.3055, + "longitude": 18.2159, + "elevation": 0.0, + "tx_id": null + }, + { + "lsid": 34948, + "sensor_type": 37, + "category": "ISS", + "manufacturer": "Davis Instruments", + "product_name": "Vantage Vue, Wireless", + "product_number": "6357", + "rain_collector_type": 0, + "active": true, + "created_date": 1528926613, + "modified_date": 1528926613, + "station_id": 9926, + "station_id_uuid": "165cf907-edba-47b3-91f6-058e56d57a16", + "station_name": "Saltsjö-Duvnäs", + "parent_device_type": "Gateway", + "parent_device_name": "Saltsjö-Duvnäs", + "parent_device_id": 10522, + "parent_device_id_hex": "001D0A00291A", + "port_number": 9, + "latitude": 59.3055, + "longitude": 18.2159, + "elevation": 0.0, + "tx_id": null + }, + { + "lsid": 34957, + "sensor_type": 3, + "category": "Barometer", + "manufacturer": "Davis Instruments", + "product_name": "Barometer", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1528928418, + "modified_date": 1528928418, + "station_id": 9930, + "station_id_uuid": "4d4142f2-41ba-44f6-a1ff-36f4e3fad43f", + "station_name": "Singö", + "parent_device_type": "Gateway", + "parent_device_name": "Singö", + "parent_device_id": 10445, + "parent_device_id_hex": "001D0A0028CD", + "port_number": -1, + "latitude": 60.1899, + "longitude": 18.7688, + "elevation": 0.0, + "tx_id": null + }, + { + "lsid": 34956, + "sensor_type": 37, + "category": "ISS", + "manufacturer": "Davis Instruments", + "product_name": "Vantage Vue, Wireless", + "product_number": "6357", + "rain_collector_type": 0, + "active": true, + "created_date": 1528928418, + "modified_date": 1528928418, + "station_id": 9930, + "station_id_uuid": "4d4142f2-41ba-44f6-a1ff-36f4e3fad43f", + "station_name": "Singö", + "parent_device_type": "Gateway", + "parent_device_name": "Singö", + "parent_device_id": 10445, + "parent_device_id_hex": "001D0A0028CD", + "port_number": 9, + "latitude": 60.1899, + "longitude": 18.7688, + "elevation": 0.0, + "tx_id": null + }, + { + "lsid": 35024, + "sensor_type": 3, + "category": "Barometer", + "manufacturer": "Davis Instruments", + "product_name": "Barometer", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1528967032, + "modified_date": 1528967032, + "station_id": 9951, + "station_id_uuid": "77763191-1cf8-409b-9e21-59667af79b12", + "station_name": "Fryksås S", + "parent_device_type": "Gateway", + "parent_device_name": "Fryksås S", + "parent_device_id": 10039, + "parent_device_id_hex": "001D0A002737", + "port_number": -1, + "latitude": 61.19411, + "longitude": 14.52955, + "elevation": 0.0, + "tx_id": null + }, + { + "lsid": 35023, + "sensor_type": 37, + "category": "ISS", + "manufacturer": "Davis Instruments", + "product_name": "Vantage Vue, Wireless", + "product_number": "6357", + "rain_collector_type": 0, + "active": true, + "created_date": 1528967032, + "modified_date": 1528967032, + "station_id": 9951, + "station_id_uuid": "77763191-1cf8-409b-9e21-59667af79b12", + "station_name": "Fryksås S", + "parent_device_type": "Gateway", + "parent_device_name": "Fryksås S", + "parent_device_id": 10039, + "parent_device_id_hex": "001D0A002737", + "port_number": 9, + "latitude": 61.19411, + "longitude": 14.52955, + "elevation": 0.0, + "tx_id": null + }, + { + "lsid": 38290, + "sensor_type": 3, + "category": "Barometer", + "manufacturer": "Davis Instruments", + "product_name": "Barometer", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1529393240, + "modified_date": 1529393240, + "station_id": 11093, + "station_id_uuid": "144f9188-37f9-40ee-817e-19234eb54b9b", + "station_name": "Fryksås", + "parent_device_type": "Gateway", + "parent_device_name": "Fryksås", + "parent_device_id": 10474, + "parent_device_id_hex": "001D0A0028EA", + "port_number": -1, + "latitude": 61.194283, + "longitude": 14.528561, + "elevation": 0.0, + "tx_id": null + }, + { + "lsid": 38289, + "sensor_type": 37, + "category": "ISS", + "manufacturer": "Davis Instruments", + "product_name": "Vantage Vue, Wireless", + "product_number": "6357", + "rain_collector_type": 0, + "active": true, + "created_date": 1529393240, + "modified_date": 1529393240, + "station_id": 11093, + "station_id_uuid": "144f9188-37f9-40ee-817e-19234eb54b9b", + "station_name": "Fryksås", + "parent_device_type": "Gateway", + "parent_device_name": "Fryksås", + "parent_device_id": 10474, + "parent_device_id_hex": "001D0A0028EA", + "port_number": 9, + "latitude": 61.194283, + "longitude": 14.528561, + "elevation": 0.0, + "tx_id": null + }, + { + "lsid": 251003, + "sensor_type": 45, + "category": "ISS", + "manufacturer": "Davis Instruments", + "product_name": "Vantage Pro2 Plus, includes UV & Solar Radiation Sensors", + "product_number": "6162", + "rain_collector_type": 2, + "active": true, + "created_date": 1565863610, + "modified_date": 1713449120, + "station_id": 75649, + "station_id_uuid": "44df599c-f4b8-4905-a564-5e57a2b018f0", + "station_name": "Weather on Tjörn", + "parent_device_type": "Gateway", + "parent_device_name": "Weather on Tjörn", + "parent_device_id": 7406856, + "parent_device_id_hex": "001D0A710508", + "port_number": 7, + "latitude": 58.01417, + "longitude": 11.58346, + "elevation": 36.34928, + "tx_id": 7 + }, + { + "lsid": 251004, + "sensor_type": 55, + "category": "Other", + "manufacturer": "Davis Instruments", + "product_name": "Sensor Suite", + "product_number": "", + "rain_collector_type": 3, + "active": true, + "created_date": 1565863610, + "modified_date": 1713449120, + "station_id": 75649, + "station_id_uuid": "44df599c-f4b8-4905-a564-5e57a2b018f0", + "station_name": "Weather on Tjörn", + "parent_device_type": "Gateway", + "parent_device_name": "Weather on Tjörn", + "parent_device_id": 7406856, + "parent_device_id_hex": "001D0A710508", + "port_number": 8, + "latitude": 58.01417, + "longitude": 11.58346, + "elevation": 36.34928, + "tx_id": 8 + }, + { + "lsid": 719837, + "sensor_type": 55, + "category": "Other", + "manufacturer": "Davis Instruments", + "product_name": "Sensor Suite", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1713448812, + "modified_date": 1713449120, + "station_id": 75649, + "station_id_uuid": "44df599c-f4b8-4905-a564-5e57a2b018f0", + "station_name": "Weather on Tjörn", + "parent_device_type": "Gateway", + "parent_device_name": "Weather on Tjörn", + "parent_device_id": 7406856, + "parent_device_id_hex": "001D0A710508", + "port_number": 3, + "latitude": 58.01417, + "longitude": 11.58346, + "elevation": 36.34928, + "tx_id": 3 + }, + { + "lsid": 719842, + "sensor_type": 55, + "category": "Other", + "manufacturer": "Davis Instruments", + "product_name": "Sensor Suite", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1713449120, + "modified_date": 1713449120, + "station_id": 75649, + "station_id_uuid": "44df599c-f4b8-4905-a564-5e57a2b018f0", + "station_name": "Weather on Tjörn", + "parent_device_type": "Gateway", + "parent_device_name": "Weather on Tjörn", + "parent_device_id": 7406856, + "parent_device_id_hex": "001D0A710508", + "port_number": 4, + "latitude": 58.01417, + "longitude": 11.58346, + "elevation": 36.34928, + "tx_id": 4 + }, + { + "lsid": 719843, + "sensor_type": 55, + "category": "Other", + "manufacturer": "Davis Instruments", + "product_name": "Sensor Suite", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1713449120, + "modified_date": 1713449120, + "station_id": 75649, + "station_id_uuid": "44df599c-f4b8-4905-a564-5e57a2b018f0", + "station_name": "Weather on Tjörn", + "parent_device_type": "Gateway", + "parent_device_name": "Weather on Tjörn", + "parent_device_id": 7406856, + "parent_device_id_hex": "001D0A710508", + "port_number": 5, + "latitude": 58.01417, + "longitude": 11.58346, + "elevation": 36.34928, + "tx_id": 5 + }, + { + "lsid": 251000, + "sensor_type": 56, + "category": "Leaf/Soil", + "manufacturer": "Davis Instruments", + "product_name": "Leaf/Soil", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1565863610, + "modified_date": 1713449120, + "station_id": 75649, + "station_id_uuid": "44df599c-f4b8-4905-a564-5e57a2b018f0", + "station_name": "Weather on Tjörn", + "parent_device_type": "Gateway", + "parent_device_name": "Weather on Tjörn", + "parent_device_id": 7406856, + "parent_device_id_hex": "001D0A710508", + "port_number": 2, + "latitude": 58.01417, + "longitude": 11.58346, + "elevation": 36.34928, + "tx_id": 2 + }, + { + "lsid": 250992, + "sensor_type": 242, + "category": "Barometer", + "manufacturer": "Davis Instruments", + "product_name": "Barometer", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1565858014, + "modified_date": 1565858014, + "station_id": 75649, + "station_id_uuid": "44df599c-f4b8-4905-a564-5e57a2b018f0", + "station_name": "Weather on Tjörn", + "parent_device_type": "Gateway", + "parent_device_name": "Weather on Tjörn", + "parent_device_id": 7406856, + "parent_device_id_hex": "001D0A710508", + "port_number": 9, + "latitude": 58.01417, + "longitude": 11.58346, + "elevation": 36.34928, + "tx_id": null + }, + { + "lsid": 250993, + "sensor_type": 243, + "category": "Inside Temp/Hum", + "manufacturer": "Davis Instruments", + "product_name": "Inside Temp/Hum", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1565858014, + "modified_date": 1565858014, + "station_id": 75649, + "station_id_uuid": "44df599c-f4b8-4905-a564-5e57a2b018f0", + "station_name": "Weather on Tjörn", + "parent_device_type": "Gateway", + "parent_device_name": "Weather on Tjörn", + "parent_device_id": 7406856, + "parent_device_id_hex": "001D0A710508", + "port_number": -1, + "latitude": 58.01417, + "longitude": 11.58346, + "elevation": 36.34928, + "tx_id": null + }, + { + "lsid": 250991, + "sensor_type": 504, + "category": "HEALTH", + "manufacturer": "Davis Instruments", + "product_name": "WeatherLink LIVE Health", + "product_number": null, + "rain_collector_type": 0, + "active": true, + "created_date": 1565858014, + "modified_date": 1565858014, + "station_id": 75649, + "station_id_uuid": "44df599c-f4b8-4905-a564-5e57a2b018f0", + "station_name": "Weather on Tjörn", + "parent_device_type": "Gateway", + "parent_device_name": "Weather on Tjörn", + "parent_device_id": 7406856, + "parent_device_id_hex": "001D0A710508", + "port_number": 0, + "latitude": 58.01417, + "longitude": 11.58346, + "elevation": 36.34928, + "tx_id": null + }, + { + "lsid": 296205, + "sensor_type": 48, + "category": "ISS", + "manufacturer": "Davis Instruments", + "product_name": "Vantage Pro2, Wireless", + "product_number": "6322", + "rain_collector_type": 2, + "active": true, + "created_date": 1583507822, + "modified_date": 1721033495, + "station_id": 86310, + "station_id_uuid": "59d1bf91-0a05-4587-baee-c98534dfbbbd", + "station_name": "Lille Lyngholmen LIVE", + "parent_device_type": "Gateway", + "parent_device_name": "Lille Lyngholmen LIVE", + "parent_device_id": 7408476, + "parent_device_id_hex": "001D0A710B5C", + "port_number": 3, + "latitude": 58.24263, + "longitude": 8.45059, + "elevation": 6.67509, + "tx_id": 3 + }, + { + "lsid": 296234, + "sensor_type": 55, + "category": "Other", + "manufacturer": "Davis Instruments", + "product_name": "Sensor Suite", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1583512593, + "modified_date": 1721033495, + "station_id": 86310, + "station_id_uuid": "59d1bf91-0a05-4587-baee-c98534dfbbbd", + "station_name": "Lille Lyngholmen LIVE", + "parent_device_type": "Gateway", + "parent_device_name": "Lille Lyngholmen LIVE", + "parent_device_id": 7408476, + "parent_device_id_hex": "001D0A710B5C", + "port_number": 2, + "latitude": 58.24263, + "longitude": 8.45059, + "elevation": 6.67509, + "tx_id": 2 + }, + { + "lsid": 296197, + "sensor_type": 242, + "category": "Barometer", + "manufacturer": "Davis Instruments", + "product_name": "Barometer", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1583506804, + "modified_date": 1583506804, + "station_id": 86310, + "station_id_uuid": "59d1bf91-0a05-4587-baee-c98534dfbbbd", + "station_name": "Lille Lyngholmen LIVE", + "parent_device_type": "Gateway", + "parent_device_name": "Lille Lyngholmen LIVE", + "parent_device_id": 7408476, + "parent_device_id_hex": "001D0A710B5C", + "port_number": 9, + "latitude": 58.24263, + "longitude": 8.45059, + "elevation": 6.67509, + "tx_id": null + }, + { + "lsid": 296198, + "sensor_type": 243, + "category": "Inside Temp/Hum", + "manufacturer": "Davis Instruments", + "product_name": "Inside Temp/Hum", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1583506804, + "modified_date": 1583506804, + "station_id": 86310, + "station_id_uuid": "59d1bf91-0a05-4587-baee-c98534dfbbbd", + "station_name": "Lille Lyngholmen LIVE", + "parent_device_type": "Gateway", + "parent_device_name": "Lille Lyngholmen LIVE", + "parent_device_id": 7408476, + "parent_device_id_hex": "001D0A710B5C", + "port_number": -1, + "latitude": 58.24263, + "longitude": 8.45059, + "elevation": 6.67509, + "tx_id": null + }, + { + "lsid": 296196, + "sensor_type": 504, + "category": "HEALTH", + "manufacturer": "Davis Instruments", + "product_name": "WeatherLink LIVE Health", + "product_number": null, + "rain_collector_type": 0, + "active": true, + "created_date": 1583506804, + "modified_date": 1583506804, + "station_id": 86310, + "station_id_uuid": "59d1bf91-0a05-4587-baee-c98534dfbbbd", + "station_name": "Lille Lyngholmen LIVE", + "parent_device_type": "Gateway", + "parent_device_name": "Lille Lyngholmen LIVE", + "parent_device_id": 7408476, + "parent_device_id_hex": "001D0A710B5C", + "port_number": 0, + "latitude": 58.24263, + "longitude": 8.45059, + "elevation": 6.67509, + "tx_id": null + }, + { + "lsid": 649756, + "sensor_type": 37, + "category": "ISS", + "manufacturer": "Davis Instruments", + "product_name": "Vantage Vue, Wireless", + "product_number": "6357", + "rain_collector_type": 2, + "active": true, + "created_date": 1693648265, + "modified_date": 1694277699, + "station_id": 167376, + "station_id_uuid": "e49a32ea-dd9c-4bdb-8354-00141a381845", + "station_name": "Askön", + "parent_device_type": "Gateway", + "parent_device_name": "Askön", + "parent_device_id": 7443460, + "parent_device_id_hex": "001D0A719404", + "port_number": 1, + "latitude": 59.60993, + "longitude": 18.770649, + "elevation": 16.353, + "tx_id": 1 + }, + { + "lsid": 649754, + "sensor_type": 242, + "category": "Barometer", + "manufacturer": "Davis Instruments", + "product_name": "Barometer", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1693647909, + "modified_date": 1693647909, + "station_id": 167376, + "station_id_uuid": "e49a32ea-dd9c-4bdb-8354-00141a381845", + "station_name": "Askön", + "parent_device_type": "Gateway", + "parent_device_name": "Askön", + "parent_device_id": 7443460, + "parent_device_id_hex": "001D0A719404", + "port_number": 9, + "latitude": 59.60993, + "longitude": 18.770649, + "elevation": 16.353, + "tx_id": null + }, + { + "lsid": 649755, + "sensor_type": 243, + "category": "Inside Temp/Hum", + "manufacturer": "Davis Instruments", + "product_name": "Inside Temp/Hum", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1693647909, + "modified_date": 1693647909, + "station_id": 167376, + "station_id_uuid": "e49a32ea-dd9c-4bdb-8354-00141a381845", + "station_name": "Askön", + "parent_device_type": "Gateway", + "parent_device_name": "Askön", + "parent_device_id": 7443460, + "parent_device_id_hex": "001D0A719404", + "port_number": -1, + "latitude": 59.60993, + "longitude": 18.770649, + "elevation": 16.353, + "tx_id": null + }, + { + "lsid": 649753, + "sensor_type": 504, + "category": "HEALTH", + "manufacturer": "Davis Instruments", + "product_name": "WeatherLink LIVE Health", + "product_number": null, + "rain_collector_type": 0, + "active": true, + "created_date": 1693647909, + "modified_date": 1693647909, + "station_id": 167376, + "station_id_uuid": "e49a32ea-dd9c-4bdb-8354-00141a381845", + "station_name": "Askön", + "parent_device_type": "Gateway", + "parent_device_name": "Askön", + "parent_device_id": 7443460, + "parent_device_id_hex": "001D0A719404", + "port_number": 0, + "latitude": 59.60993, + "longitude": 18.770649, + "elevation": 16.353, + "tx_id": null + }, + { + "lsid": 650442, + "sensor_type": 37, + "category": "ISS", + "manufacturer": "Davis Instruments", + "product_name": "Vantage Vue, Wireless", + "product_number": "6357", + "rain_collector_type": 2, + "active": true, + "created_date": 1693934070, + "modified_date": 1693934070, + "station_id": 167531, + "station_id_uuid": "03e7585a-4f29-4e7c-b6cb-d9e17313b07c", + "station_name": "Strp81", + "parent_device_type": "Gateway", + "parent_device_name": "Strp81", + "parent_device_id": 12586491, + "parent_device_id_hex": "001d0ac00dfb", + "port_number": 1, + "latitude": 59.30568, + "longitude": 18.21594, + "elevation": 37.216557, + "tx_id": 1 + }, + { + "lsid": 650440, + "sensor_type": 242, + "category": "Barometer", + "manufacturer": "Davis Instruments", + "product_name": "Barometer", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1693934167, + "modified_date": 1693934167, + "station_id": 167531, + "station_id_uuid": "03e7585a-4f29-4e7c-b6cb-d9e17313b07c", + "station_name": "Strp81", + "parent_device_type": "Gateway", + "parent_device_name": "Strp81", + "parent_device_id": 12586491, + "parent_device_id_hex": "001d0ac00dfb", + "port_number": 9, + "latitude": 59.30568, + "longitude": 18.21594, + "elevation": 37.216557, + "tx_id": null + }, + { + "lsid": 650441, + "sensor_type": 365, + "category": "Inside Temp/Hum", + "manufacturer": "Davis Instruments", + "product_name": "Inside Temp/Hum", + "product_number": "", + "rain_collector_type": 0, + "active": true, + "created_date": 1693934167, + "modified_date": 1693934167, + "station_id": 167531, + "station_id_uuid": "03e7585a-4f29-4e7c-b6cb-d9e17313b07c", + "station_name": "Strp81", + "parent_device_type": "Gateway", + "parent_device_name": "Strp81", + "parent_device_id": 12586491, + "parent_device_id_hex": "001d0ac00dfb", + "port_number": -1, + "latitude": 59.30568, + "longitude": 18.21594, + "elevation": 37.216557, + "tx_id": null + }, + { + "lsid": 650439, + "sensor_type": 509, + "category": "HEALTH", + "manufacturer": "Davis Instruments", + "product_name": "Console Health", + "product_number": null, + "rain_collector_type": 0, + "active": true, + "created_date": 1693934167, + "modified_date": 1693934167, + "station_id": 167531, + "station_id_uuid": "03e7585a-4f29-4e7c-b6cb-d9e17313b07c", + "station_name": "Strp81", + "parent_device_type": "Gateway", + "parent_device_name": "Strp81", + "parent_device_id": 12586491, + "parent_device_id_hex": "001d0ac00dfb", + "port_number": 0, + "latitude": 59.30568, + "longitude": 18.21594, + "elevation": 37.216557, + "tx_id": null + }, + { + "lsid": 716449, + "sensor_type": 323, + "category": "Air Quality", + "manufacturer": "Davis Instruments", + "product_name": "AirLink", + "product_number": "7210", + "rain_collector_type": 0, + "active": true, + "created_date": 1712660326, + "modified_date": 1712660326, + "station_id": 183139, + "station_id_uuid": "c04a572b-583e-4e45-a222-7444e0ae7697", + "station_name": "Saltsjö-Duvnäs AQ", + "parent_device_type": "Node", + "parent_device_name": "Saltsjö-Duvnäs AQ", + "parent_device_id": 1056344, + "parent_device_id_hex": "001D0A101E58", + "port_number": -10, + "latitude": 59.305717, + "longitude": 18.215973, + "elevation": 3.0, + "tx_id": null + }, + { + "lsid": 716448, + "sensor_type": 506, + "category": "HEALTH", + "manufacturer": "Davis Instruments", + "product_name": "AQS Health", + "product_number": null, + "rain_collector_type": 0, + "active": true, + "created_date": 1712660326, + "modified_date": 1712660326, + "station_id": 183139, + "station_id_uuid": "c04a572b-583e-4e45-a222-7444e0ae7697", + "station_name": "Saltsjö-Duvnäs AQ", + "parent_device_type": "Node", + "parent_device_name": "Saltsjö-Duvnäs AQ", + "parent_device_id": 1056344, + "parent_device_id_hex": "001D0A101E58", + "port_number": 0, + "latitude": 59.305717, + "longitude": 18.215973, + "elevation": 3.0, + "tx_id": null + } + ], + "generated_at": 1735399999 +} diff --git a/tests/fixtures/strp81.json b/tests/fixtures/strp81.json new file mode 100644 index 0000000..cd80cc3 --- /dev/null +++ b/tests/fixtures/strp81.json @@ -0,0 +1,31 @@ +{ + "stations": [ + { + "station_id": 167531, + "station_id_uuid": "03e7585a-4f29-4e7c-b6cb-d9e17313b07c", + "station_name": "Strp81", + "gateway_id": 12586491, + "gateway_id_hex": "001d0ac00dfb", + "product_number": "6313", + "username": "astrandb", + "user_email": "ake@strandberg.eu", + "company_name": "", + "active": true, + "private": false, + "recording_interval": 5, + "firmware_version": "1.4.59", + "registered_date": 1693934167, + "time_zone": "Europe/Stockholm", + "city": "Saltsjö-duvnäs", + "region": "Stockholms län", + "country": "Sweden", + "latitude": 59.30568, + "longitude": 18.21594, + "elevation": 37.216557, + "gateway_type": "WeatherLink Console", + "relationship_type": "Owned", + "subscription_type": "Pro" + } + ], + "generated_at": 1735386408 +} diff --git a/tests/fixtures/strp81_current.json b/tests/fixtures/strp81_current.json new file mode 100644 index 0000000..7cf8ebf --- /dev/null +++ b/tests/fixtures/strp81_current.json @@ -0,0 +1,186 @@ +{ + "station_id_uuid": "03e7585a-4f29-4e7c-b6cb-d9e17313b07c", + "sensors": [ + { + "lsid": 650441, + "data": [ + { + "temp_in": 70.5, + "tz_offset": 3600, + "wet_bulb_in": 55.4, + "heat_index_in": 67.8, + "dew_point_in": 42.3, + "wbgt_in": null, + "ts": 1735386900, + "hum_in": 36.1 + } + ], + "sensor_type": 365, + "data_structure_type": 21 + }, + { + "lsid": 650440, + "data": [ + { + "bar_absolute": 30.174, + "tz_offset": 3600, + "bar_sea_level": 30.181, + "bar_offset": 0, + "bar_trend": -0.047, + "ts": 1735386900 + } + ], + "sensor_type": 242, + "data_structure_type": 19 + }, + { + "lsid": 650442, + "data": [ + { + "rx_state": 0, + "wind_speed_hi_last_2_min": 2.75, + "hum": 2.8, + "freq_index": 0, + "last_packet_received_timestamp": 1735386899, + "rainfall_day_clicks": 1, + "packets_missed_day": 47, + "wind_dir_at_hi_speed_last_10_min": 233, + "wind_chill": 39.7, + "et_month": 0, + "packets_received_streak_hi_day": 1439, + "rain_rate_hi_last_15_min_clicks": 0, + "thw_index": 37.5, + "packets_received_streak": 232, + "freq_error_current": -1, + "wind_dir_scalar_avg_last_10_min": 157, + "solar_energy_day": 0, + "spars_rpm": null, + "wind_run_day": 3.9000000953674316, + "rain_size": 2, + "uv_index": null, + "tz_offset": 3600, + "rain_storm_current_in": 0.13385826, + "rainfall_day_mm": 0.2, + "wind_speed_last": 1.19, + "resyncs_day": 0, + "rainfall_last_60_min_clicks": 0, + "wet_bulb": 27.3, + "rain_storm_current_mm": 3.4, + "rainfall_day_in": 0.007874016, + "hdd_day": 13.014, + "wind_speed_avg_last_10_min": 2.1, + "wind_dir_at_hi_speed_last_2_min": 125, + "supercap_volt": 0.905, + "solar_panel_volt": 0.422, + "wind_dir_last": 263, + "rainfall_month_clicks": 220, + "rain_storm_last_clicks": 36, + "tx_id": 1, + "rain_storm_last_start_at": 1734780955, + "packets_received_day": 18099, + "rainfall_last_15_min_in": 0, + "rain_rate_hi_clicks": 0, + "rainfall_last_15_min_mm": 0, + "dew_point": -36.2, + "rain_rate_hi_in": 0, + "rain_rate_hi_mm": 0, + "rainfall_year_clicks": 2719, + "rain_storm_last_end_at": 1734923847, + "wind_dir_scalar_avg_last_2_min": 135, + "reception_day": 100, + "wbgt": null, + "heat_index": 37.8, + "rainfall_last_24_hr_in": 0.13385826, + "rainfall_last_60_min_mm": 0, + "rain_storm_current_clicks": 17, + "trans_battery_flag": 0, + "rainfall_last_60_min_in": 0, + "rainfall_last_24_hr_mm": 3.4, + "crc_errors_day": 9, + "rainfall_year_in": 21.409449, + "rssi_last": -59, + "wind_speed_hi_last_10_min": 9.06, + "rainfall_last_15_min_clicks": 0, + "cdd_day": 0, + "rainfall_year_mm": 543.8, + "freq_error_total": -421, + "wind_dir_scalar_avg_last_1_min": 139, + "uv_dose_day": 0, + "temp": 40.1, + "trans_battery_volt": 2.822, + "et_day": 0, + "rainfall_month_in": 1.7322835, + "wind_speed_avg_last_2_min": 1.12, + "rain_storm_current_start_at": 1735331847, + "spars_volt": null, + "solar_rad": null, + "rain_storm_last_mm": 7.2, + "wind_speed_avg_last_1_min": 1.45, + "thsw_index": null, + "rain_rate_last_mm": 0, + "rain_rate_last_clicks": 0, + "rainfall_last_24_hr_clicks": 17, + "rain_storm_last_in": 0.28346458, + "et_year": 0, + "packets_missed_streak_hi_day": 1, + "rain_rate_last_in": 0, + "rain_rate_hi_last_15_min_mm": 0, + "rain_rate_hi_last_15_min_in": 0, + "rainfall_month_mm": 44, + "ts": 1735386900, + "packets_missed_streak": 0 + } + ], + "sensor_type": 37, + "data_structure_type": 23 + }, + { + "lsid": 650439, + "data": [ + { + "battery_voltage": 4304, + "wifi_rssi": -55, + "console_radio_version": "10.3.12.106", + "console_api_level": 28, + "gnss_sip_tx_id": 0, + "ip_v4_gateway": "192.168.0.1", + "bgn": null, + "queue_kilobytes": 4, + "free_mem": 738971, + "system_free_space": 740962, + "tz_offset": 3600, + "charger_plugged": 1, + "battery_percent": 100, + "local_api_queries": null, + "health_version": 1, + "ip_address_type": null, + "link_uptime": 1243645, + "rx_kilobytes": 2057544, + "ip_v4_netmask": "255.255.255.0", + "console_sw_version": "1.4.59", + "connection_uptime": 701989, + "os_uptime": 3316245, + "battery_condition": 2, + "internal_free_space": 2193829, + "battery_current": 0, + "battery_status": 5, + "database_kilobytes": 108359, + "battery_cycle_count": 1, + "console_os_version": "1.3.9", + "ip_v4_address": "192.168.0.65", + "bootloader_version": 2, + "clock_source": 2, + "app_uptime": 1243653, + "dns_type_used": null, + "battery_temp": 28, + "tx_kilobytes": 136282, + "ts": 1735386300 + } + ], + "sensor_type": 509, + "data_structure_type": 27 + } + ], + "generated_at": 1735387067, + "station_id": 167531 +} diff --git a/tests/snapshots/test_binary_sensor.ambr b/tests/snapshots/test_binary_sensor.ambr new file mode 100644 index 0000000..b310836 --- /dev/null +++ b/tests/snapshots/test_binary_sensor.ambr @@ -0,0 +1,96 @@ +# serializer version: 1 +# name: test_sensor[binary_sensor.strp81_connectivity-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': , + 'entity_id': 'binary_sensor.strp81_connectivity', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Connectivity', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'timestamp', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-Timestamp', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensor[binary_sensor.strp81_connectivity-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'connectivity', + 'friendly_name': 'Strp81 Connectivity', + 'last_update': datetime.datetime(2024, 12, 28, 11, 55, tzinfo=datetime.timezone.utc), + }), + 'context': , + 'entity_id': 'binary_sensor.strp81_connectivity', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_sensor[binary_sensor.strp81_transmitter_battery-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': , + 'entity_id': 'binary_sensor.strp81_transmitter_battery', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Transmitter battery', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'trans_battery', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-TransmitterBattery', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensor[binary_sensor.strp81_transmitter_battery-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'battery', + 'friendly_name': 'Strp81 Transmitter battery', + }), + 'context': , + 'entity_id': 'binary_sensor.strp81_transmitter_battery', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- diff --git a/tests/snapshots/test_diagnostics.ambr b/tests/snapshots/test_diagnostics.ambr new file mode 100644 index 0000000..c038085 --- /dev/null +++ b/tests/snapshots/test_diagnostics.ambr @@ -0,0 +1,1428 @@ +# serializer version: 1 +# name: test_diagnostics + dict({ + 'all_sensor_data': dict({ + 'generated_at': 1735399999, + 'sensors': list([ + dict({ + 'active': True, + 'category': 'Barometer', + 'created_date': 1517988730, + 'elevation': 36.56343, + 'latitude': 58.01418, + 'longitude': 11.58347, + 'lsid': 13997, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1517988730, + 'parent_device_id': 14696303, + 'parent_device_id_hex': '001D0AE03F6F', + 'parent_device_name': 'Säby, Tjörn', + 'parent_device_type': 'Gateway', + 'port_number': -1, + 'product_name': 'Barometer', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 3, + 'station_id': 3362, + 'station_id_uuid': 'b1b3b7b4-fc23-4169-bf32-4c54f232a225', + 'station_name': 'Säby, Tjörn', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'Solar Radiation', + 'created_date': 1517988730, + 'elevation': 36.56343, + 'latitude': 58.01418, + 'longitude': 11.58347, + 'lsid': 13998, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1517988730, + 'parent_device_id': 14696303, + 'parent_device_id_hex': '001D0AE03F6F', + 'parent_device_name': 'Säby, Tjörn', + 'parent_device_type': 'Gateway', + 'port_number': -1, + 'product_name': 'Solar Radiation', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 4, + 'station_id': 3362, + 'station_id_uuid': 'b1b3b7b4-fc23-4169-bf32-4c54f232a225', + 'station_name': 'Säby, Tjörn', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'Ultra Violet', + 'created_date': 1517988730, + 'elevation': 36.56343, + 'latitude': 58.01418, + 'longitude': 11.58347, + 'lsid': 13999, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1517988730, + 'parent_device_id': 14696303, + 'parent_device_id_hex': '001D0AE03F6F', + 'parent_device_name': 'Säby, Tjörn', + 'parent_device_type': 'Gateway', + 'port_number': -1, + 'product_name': 'Ultra Violet', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 5, + 'station_id': 3362, + 'station_id_uuid': 'b1b3b7b4-fc23-4169-bf32-4c54f232a225', + 'station_name': 'Säby, Tjörn', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'Soil Temperature', + 'created_date': 1518025210, + 'elevation': 36.56343, + 'latitude': 58.01418, + 'longitude': 11.58347, + 'lsid': 14091, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1518025210, + 'parent_device_id': 14696303, + 'parent_device_id_hex': '001D0AE03F6F', + 'parent_device_name': 'Säby, Tjörn', + 'parent_device_type': 'Gateway', + 'port_number': -1, + 'product_name': 'Soil Temp 1', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 9, + 'station_id': 3362, + 'station_id_uuid': 'b1b3b7b4-fc23-4169-bf32-4c54f232a225', + 'station_name': 'Säby, Tjörn', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'Soil Temperature', + 'created_date': 1518025210, + 'elevation': 36.56343, + 'latitude': 58.01418, + 'longitude': 11.58347, + 'lsid': 14092, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1518025210, + 'parent_device_id': 14696303, + 'parent_device_id_hex': '001D0AE03F6F', + 'parent_device_name': 'Säby, Tjörn', + 'parent_device_type': 'Gateway', + 'port_number': -1, + 'product_name': 'Soil Temp 2', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 10, + 'station_id': 3362, + 'station_id_uuid': 'b1b3b7b4-fc23-4169-bf32-4c54f232a225', + 'station_name': 'Säby, Tjörn', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'Soil Temperature', + 'created_date': 1518025210, + 'elevation': 36.56343, + 'latitude': 58.01418, + 'longitude': 11.58347, + 'lsid': 14093, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1518025210, + 'parent_device_id': 14696303, + 'parent_device_id_hex': '001D0AE03F6F', + 'parent_device_name': 'Säby, Tjörn', + 'parent_device_type': 'Gateway', + 'port_number': -1, + 'product_name': 'Soil Temp 3', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 11, + 'station_id': 3362, + 'station_id_uuid': 'b1b3b7b4-fc23-4169-bf32-4c54f232a225', + 'station_name': 'Säby, Tjörn', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'Leaf Temperature', + 'created_date': 1518025210, + 'elevation': 36.56343, + 'latitude': 58.01418, + 'longitude': 11.58347, + 'lsid': 14094, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1518025210, + 'parent_device_id': 14696303, + 'parent_device_id_hex': '001D0AE03F6F', + 'parent_device_name': 'Säby, Tjörn', + 'parent_device_type': 'Gateway', + 'port_number': -1, + 'product_name': 'Leaf Temp 1', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 13, + 'station_id': 3362, + 'station_id_uuid': 'b1b3b7b4-fc23-4169-bf32-4c54f232a225', + 'station_name': 'Säby, Tjörn', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'Leaf Temperature', + 'created_date': 1518025210, + 'elevation': 36.56343, + 'latitude': 58.01418, + 'longitude': 11.58347, + 'lsid': 14095, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1518025210, + 'parent_device_id': 14696303, + 'parent_device_id_hex': '001D0AE03F6F', + 'parent_device_name': 'Säby, Tjörn', + 'parent_device_type': 'Gateway', + 'port_number': -1, + 'product_name': 'Leaf Temp 2', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 14, + 'station_id': 3362, + 'station_id_uuid': 'b1b3b7b4-fc23-4169-bf32-4c54f232a225', + 'station_name': 'Säby, Tjörn', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'Soil Moisture', + 'created_date': 1518025210, + 'elevation': 36.56343, + 'latitude': 58.01418, + 'longitude': 11.58347, + 'lsid': 14097, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1518025210, + 'parent_device_id': 14696303, + 'parent_device_id_hex': '001D0AE03F6F', + 'parent_device_name': 'Säby, Tjörn', + 'parent_device_type': 'Gateway', + 'port_number': -1, + 'product_name': 'Soil Moisture 1', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 17, + 'station_id': 3362, + 'station_id_uuid': 'b1b3b7b4-fc23-4169-bf32-4c54f232a225', + 'station_name': 'Säby, Tjörn', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'Leaf Wetness', + 'created_date': 1518025210, + 'elevation': 36.56343, + 'latitude': 58.01418, + 'longitude': 11.58347, + 'lsid': 14098, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1518025210, + 'parent_device_id': 14696303, + 'parent_device_id_hex': '001D0AE03F6F', + 'parent_device_name': 'Säby, Tjörn', + 'parent_device_type': 'Gateway', + 'port_number': -1, + 'product_name': 'Leaf Wetness 1', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 21, + 'station_id': 3362, + 'station_id_uuid': 'b1b3b7b4-fc23-4169-bf32-4c54f232a225', + 'station_name': 'Säby, Tjörn', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'Leaf Wetness', + 'created_date': 1667813348, + 'elevation': 36.56343, + 'latitude': 58.01418, + 'longitude': 11.58347, + 'lsid': 560697, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1667813348, + 'parent_device_id': 14696303, + 'parent_device_id_hex': '001D0AE03F6F', + 'parent_device_name': 'Säby, Tjörn', + 'parent_device_type': 'Gateway', + 'port_number': -1, + 'product_name': 'Leaf Wetness 2', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 22, + 'station_id': 3362, + 'station_id_uuid': 'b1b3b7b4-fc23-4169-bf32-4c54f232a225', + 'station_name': 'Säby, Tjörn', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'ISS', + 'created_date': 1517988730, + 'elevation': 36.56343, + 'latitude': 58.01418, + 'longitude': 11.58347, + 'lsid': 13996, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1517988730, + 'parent_device_id': 14696303, + 'parent_device_id_hex': '001D0AE03F6F', + 'parent_device_name': 'Säby, Tjörn', + 'parent_device_type': 'Gateway', + 'port_number': 9, + 'product_name': 'Vantage Pro Plus', + 'product_number': '', + 'rain_collector_type': 3, + 'sensor_type': 34, + 'station_id': 3362, + 'station_id_uuid': 'b1b3b7b4-fc23-4169-bf32-4c54f232a225', + 'station_name': 'Säby, Tjörn', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'Barometer', + 'created_date': 1528926613, + 'elevation': 0.0, + 'latitude': 59.3055, + 'longitude': 18.2159, + 'lsid': 34949, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1528926613, + 'parent_device_id': 10522, + 'parent_device_id_hex': '001D0A00291A', + 'parent_device_name': 'Saltsjö-Duvnäs', + 'parent_device_type': 'Gateway', + 'port_number': -1, + 'product_name': 'Barometer', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 3, + 'station_id': 9926, + 'station_id_uuid': '165cf907-edba-47b3-91f6-058e56d57a16', + 'station_name': 'Saltsjö-Duvnäs', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'ISS', + 'created_date': 1528926613, + 'elevation': 0.0, + 'latitude': 59.3055, + 'longitude': 18.2159, + 'lsid': 34948, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1528926613, + 'parent_device_id': 10522, + 'parent_device_id_hex': '001D0A00291A', + 'parent_device_name': 'Saltsjö-Duvnäs', + 'parent_device_type': 'Gateway', + 'port_number': 9, + 'product_name': 'Vantage Vue, Wireless', + 'product_number': '6357', + 'rain_collector_type': 0, + 'sensor_type': 37, + 'station_id': 9926, + 'station_id_uuid': '165cf907-edba-47b3-91f6-058e56d57a16', + 'station_name': 'Saltsjö-Duvnäs', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'Barometer', + 'created_date': 1528928418, + 'elevation': 0.0, + 'latitude': 60.1899, + 'longitude': 18.7688, + 'lsid': 34957, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1528928418, + 'parent_device_id': 10445, + 'parent_device_id_hex': '001D0A0028CD', + 'parent_device_name': 'Singö', + 'parent_device_type': 'Gateway', + 'port_number': -1, + 'product_name': 'Barometer', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 3, + 'station_id': 9930, + 'station_id_uuid': '4d4142f2-41ba-44f6-a1ff-36f4e3fad43f', + 'station_name': 'Singö', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'ISS', + 'created_date': 1528928418, + 'elevation': 0.0, + 'latitude': 60.1899, + 'longitude': 18.7688, + 'lsid': 34956, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1528928418, + 'parent_device_id': 10445, + 'parent_device_id_hex': '001D0A0028CD', + 'parent_device_name': 'Singö', + 'parent_device_type': 'Gateway', + 'port_number': 9, + 'product_name': 'Vantage Vue, Wireless', + 'product_number': '6357', + 'rain_collector_type': 0, + 'sensor_type': 37, + 'station_id': 9930, + 'station_id_uuid': '4d4142f2-41ba-44f6-a1ff-36f4e3fad43f', + 'station_name': 'Singö', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'Barometer', + 'created_date': 1528967032, + 'elevation': 0.0, + 'latitude': 61.19411, + 'longitude': 14.52955, + 'lsid': 35024, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1528967032, + 'parent_device_id': 10039, + 'parent_device_id_hex': '001D0A002737', + 'parent_device_name': 'Fryksås S', + 'parent_device_type': 'Gateway', + 'port_number': -1, + 'product_name': 'Barometer', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 3, + 'station_id': 9951, + 'station_id_uuid': '77763191-1cf8-409b-9e21-59667af79b12', + 'station_name': 'Fryksås S', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'ISS', + 'created_date': 1528967032, + 'elevation': 0.0, + 'latitude': 61.19411, + 'longitude': 14.52955, + 'lsid': 35023, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1528967032, + 'parent_device_id': 10039, + 'parent_device_id_hex': '001D0A002737', + 'parent_device_name': 'Fryksås S', + 'parent_device_type': 'Gateway', + 'port_number': 9, + 'product_name': 'Vantage Vue, Wireless', + 'product_number': '6357', + 'rain_collector_type': 0, + 'sensor_type': 37, + 'station_id': 9951, + 'station_id_uuid': '77763191-1cf8-409b-9e21-59667af79b12', + 'station_name': 'Fryksås S', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'Barometer', + 'created_date': 1529393240, + 'elevation': 0.0, + 'latitude': 61.194283, + 'longitude': 14.528561, + 'lsid': 38290, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1529393240, + 'parent_device_id': 10474, + 'parent_device_id_hex': '001D0A0028EA', + 'parent_device_name': 'Fryksås', + 'parent_device_type': 'Gateway', + 'port_number': -1, + 'product_name': 'Barometer', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 3, + 'station_id': 11093, + 'station_id_uuid': '144f9188-37f9-40ee-817e-19234eb54b9b', + 'station_name': 'Fryksås', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'ISS', + 'created_date': 1529393240, + 'elevation': 0.0, + 'latitude': 61.194283, + 'longitude': 14.528561, + 'lsid': 38289, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1529393240, + 'parent_device_id': 10474, + 'parent_device_id_hex': '001D0A0028EA', + 'parent_device_name': 'Fryksås', + 'parent_device_type': 'Gateway', + 'port_number': 9, + 'product_name': 'Vantage Vue, Wireless', + 'product_number': '6357', + 'rain_collector_type': 0, + 'sensor_type': 37, + 'station_id': 11093, + 'station_id_uuid': '144f9188-37f9-40ee-817e-19234eb54b9b', + 'station_name': 'Fryksås', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'ISS', + 'created_date': 1565863610, + 'elevation': 36.34928, + 'latitude': 58.01417, + 'longitude': 11.58346, + 'lsid': 251003, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1713449120, + 'parent_device_id': 7406856, + 'parent_device_id_hex': '001D0A710508', + 'parent_device_name': 'Weather on Tjörn', + 'parent_device_type': 'Gateway', + 'port_number': 7, + 'product_name': 'Vantage Pro2 Plus, includes UV & Solar Radiation Sensors', + 'product_number': '6162', + 'rain_collector_type': 2, + 'sensor_type': 45, + 'station_id': 75649, + 'station_id_uuid': '44df599c-f4b8-4905-a564-5e57a2b018f0', + 'station_name': 'Weather on Tjörn', + 'tx_id': 7, + }), + dict({ + 'active': True, + 'category': 'Other', + 'created_date': 1565863610, + 'elevation': 36.34928, + 'latitude': 58.01417, + 'longitude': 11.58346, + 'lsid': 251004, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1713449120, + 'parent_device_id': 7406856, + 'parent_device_id_hex': '001D0A710508', + 'parent_device_name': 'Weather on Tjörn', + 'parent_device_type': 'Gateway', + 'port_number': 8, + 'product_name': 'Sensor Suite', + 'product_number': '', + 'rain_collector_type': 3, + 'sensor_type': 55, + 'station_id': 75649, + 'station_id_uuid': '44df599c-f4b8-4905-a564-5e57a2b018f0', + 'station_name': 'Weather on Tjörn', + 'tx_id': 8, + }), + dict({ + 'active': True, + 'category': 'Other', + 'created_date': 1713448812, + 'elevation': 36.34928, + 'latitude': 58.01417, + 'longitude': 11.58346, + 'lsid': 719837, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1713449120, + 'parent_device_id': 7406856, + 'parent_device_id_hex': '001D0A710508', + 'parent_device_name': 'Weather on Tjörn', + 'parent_device_type': 'Gateway', + 'port_number': 3, + 'product_name': 'Sensor Suite', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 55, + 'station_id': 75649, + 'station_id_uuid': '44df599c-f4b8-4905-a564-5e57a2b018f0', + 'station_name': 'Weather on Tjörn', + 'tx_id': 3, + }), + dict({ + 'active': True, + 'category': 'Other', + 'created_date': 1713449120, + 'elevation': 36.34928, + 'latitude': 58.01417, + 'longitude': 11.58346, + 'lsid': 719842, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1713449120, + 'parent_device_id': 7406856, + 'parent_device_id_hex': '001D0A710508', + 'parent_device_name': 'Weather on Tjörn', + 'parent_device_type': 'Gateway', + 'port_number': 4, + 'product_name': 'Sensor Suite', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 55, + 'station_id': 75649, + 'station_id_uuid': '44df599c-f4b8-4905-a564-5e57a2b018f0', + 'station_name': 'Weather on Tjörn', + 'tx_id': 4, + }), + dict({ + 'active': True, + 'category': 'Other', + 'created_date': 1713449120, + 'elevation': 36.34928, + 'latitude': 58.01417, + 'longitude': 11.58346, + 'lsid': 719843, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1713449120, + 'parent_device_id': 7406856, + 'parent_device_id_hex': '001D0A710508', + 'parent_device_name': 'Weather on Tjörn', + 'parent_device_type': 'Gateway', + 'port_number': 5, + 'product_name': 'Sensor Suite', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 55, + 'station_id': 75649, + 'station_id_uuid': '44df599c-f4b8-4905-a564-5e57a2b018f0', + 'station_name': 'Weather on Tjörn', + 'tx_id': 5, + }), + dict({ + 'active': True, + 'category': 'Leaf/Soil', + 'created_date': 1565863610, + 'elevation': 36.34928, + 'latitude': 58.01417, + 'longitude': 11.58346, + 'lsid': 251000, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1713449120, + 'parent_device_id': 7406856, + 'parent_device_id_hex': '001D0A710508', + 'parent_device_name': 'Weather on Tjörn', + 'parent_device_type': 'Gateway', + 'port_number': 2, + 'product_name': 'Leaf/Soil', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 56, + 'station_id': 75649, + 'station_id_uuid': '44df599c-f4b8-4905-a564-5e57a2b018f0', + 'station_name': 'Weather on Tjörn', + 'tx_id': 2, + }), + dict({ + 'active': True, + 'category': 'Barometer', + 'created_date': 1565858014, + 'elevation': 36.34928, + 'latitude': 58.01417, + 'longitude': 11.58346, + 'lsid': 250992, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1565858014, + 'parent_device_id': 7406856, + 'parent_device_id_hex': '001D0A710508', + 'parent_device_name': 'Weather on Tjörn', + 'parent_device_type': 'Gateway', + 'port_number': 9, + 'product_name': 'Barometer', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 242, + 'station_id': 75649, + 'station_id_uuid': '44df599c-f4b8-4905-a564-5e57a2b018f0', + 'station_name': 'Weather on Tjörn', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'Inside Temp/Hum', + 'created_date': 1565858014, + 'elevation': 36.34928, + 'latitude': 58.01417, + 'longitude': 11.58346, + 'lsid': 250993, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1565858014, + 'parent_device_id': 7406856, + 'parent_device_id_hex': '001D0A710508', + 'parent_device_name': 'Weather on Tjörn', + 'parent_device_type': 'Gateway', + 'port_number': -1, + 'product_name': 'Inside Temp/Hum', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 243, + 'station_id': 75649, + 'station_id_uuid': '44df599c-f4b8-4905-a564-5e57a2b018f0', + 'station_name': 'Weather on Tjörn', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'HEALTH', + 'created_date': 1565858014, + 'elevation': 36.34928, + 'latitude': 58.01417, + 'longitude': 11.58346, + 'lsid': 250991, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1565858014, + 'parent_device_id': 7406856, + 'parent_device_id_hex': '001D0A710508', + 'parent_device_name': 'Weather on Tjörn', + 'parent_device_type': 'Gateway', + 'port_number': 0, + 'product_name': 'WeatherLink LIVE Health', + 'product_number': None, + 'rain_collector_type': 0, + 'sensor_type': 504, + 'station_id': 75649, + 'station_id_uuid': '44df599c-f4b8-4905-a564-5e57a2b018f0', + 'station_name': 'Weather on Tjörn', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'ISS', + 'created_date': 1583507822, + 'elevation': 6.67509, + 'latitude': 58.24263, + 'longitude': 8.45059, + 'lsid': 296205, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1721033495, + 'parent_device_id': 7408476, + 'parent_device_id_hex': '001D0A710B5C', + 'parent_device_name': 'Lille Lyngholmen LIVE', + 'parent_device_type': 'Gateway', + 'port_number': 3, + 'product_name': 'Vantage Pro2, Wireless', + 'product_number': '6322', + 'rain_collector_type': 2, + 'sensor_type': 48, + 'station_id': 86310, + 'station_id_uuid': '59d1bf91-0a05-4587-baee-c98534dfbbbd', + 'station_name': 'Lille Lyngholmen LIVE', + 'tx_id': 3, + }), + dict({ + 'active': True, + 'category': 'Other', + 'created_date': 1583512593, + 'elevation': 6.67509, + 'latitude': 58.24263, + 'longitude': 8.45059, + 'lsid': 296234, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1721033495, + 'parent_device_id': 7408476, + 'parent_device_id_hex': '001D0A710B5C', + 'parent_device_name': 'Lille Lyngholmen LIVE', + 'parent_device_type': 'Gateway', + 'port_number': 2, + 'product_name': 'Sensor Suite', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 55, + 'station_id': 86310, + 'station_id_uuid': '59d1bf91-0a05-4587-baee-c98534dfbbbd', + 'station_name': 'Lille Lyngholmen LIVE', + 'tx_id': 2, + }), + dict({ + 'active': True, + 'category': 'Barometer', + 'created_date': 1583506804, + 'elevation': 6.67509, + 'latitude': 58.24263, + 'longitude': 8.45059, + 'lsid': 296197, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1583506804, + 'parent_device_id': 7408476, + 'parent_device_id_hex': '001D0A710B5C', + 'parent_device_name': 'Lille Lyngholmen LIVE', + 'parent_device_type': 'Gateway', + 'port_number': 9, + 'product_name': 'Barometer', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 242, + 'station_id': 86310, + 'station_id_uuid': '59d1bf91-0a05-4587-baee-c98534dfbbbd', + 'station_name': 'Lille Lyngholmen LIVE', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'Inside Temp/Hum', + 'created_date': 1583506804, + 'elevation': 6.67509, + 'latitude': 58.24263, + 'longitude': 8.45059, + 'lsid': 296198, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1583506804, + 'parent_device_id': 7408476, + 'parent_device_id_hex': '001D0A710B5C', + 'parent_device_name': 'Lille Lyngholmen LIVE', + 'parent_device_type': 'Gateway', + 'port_number': -1, + 'product_name': 'Inside Temp/Hum', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 243, + 'station_id': 86310, + 'station_id_uuid': '59d1bf91-0a05-4587-baee-c98534dfbbbd', + 'station_name': 'Lille Lyngholmen LIVE', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'HEALTH', + 'created_date': 1583506804, + 'elevation': 6.67509, + 'latitude': 58.24263, + 'longitude': 8.45059, + 'lsid': 296196, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1583506804, + 'parent_device_id': 7408476, + 'parent_device_id_hex': '001D0A710B5C', + 'parent_device_name': 'Lille Lyngholmen LIVE', + 'parent_device_type': 'Gateway', + 'port_number': 0, + 'product_name': 'WeatherLink LIVE Health', + 'product_number': None, + 'rain_collector_type': 0, + 'sensor_type': 504, + 'station_id': 86310, + 'station_id_uuid': '59d1bf91-0a05-4587-baee-c98534dfbbbd', + 'station_name': 'Lille Lyngholmen LIVE', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'ISS', + 'created_date': 1693648265, + 'elevation': 16.353, + 'latitude': 59.60993, + 'longitude': 18.770649, + 'lsid': 649756, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1694277699, + 'parent_device_id': 7443460, + 'parent_device_id_hex': '001D0A719404', + 'parent_device_name': 'Askön', + 'parent_device_type': 'Gateway', + 'port_number': 1, + 'product_name': 'Vantage Vue, Wireless', + 'product_number': '6357', + 'rain_collector_type': 2, + 'sensor_type': 37, + 'station_id': 167376, + 'station_id_uuid': 'e49a32ea-dd9c-4bdb-8354-00141a381845', + 'station_name': 'Askön', + 'tx_id': 1, + }), + dict({ + 'active': True, + 'category': 'Barometer', + 'created_date': 1693647909, + 'elevation': 16.353, + 'latitude': 59.60993, + 'longitude': 18.770649, + 'lsid': 649754, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1693647909, + 'parent_device_id': 7443460, + 'parent_device_id_hex': '001D0A719404', + 'parent_device_name': 'Askön', + 'parent_device_type': 'Gateway', + 'port_number': 9, + 'product_name': 'Barometer', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 242, + 'station_id': 167376, + 'station_id_uuid': 'e49a32ea-dd9c-4bdb-8354-00141a381845', + 'station_name': 'Askön', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'Inside Temp/Hum', + 'created_date': 1693647909, + 'elevation': 16.353, + 'latitude': 59.60993, + 'longitude': 18.770649, + 'lsid': 649755, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1693647909, + 'parent_device_id': 7443460, + 'parent_device_id_hex': '001D0A719404', + 'parent_device_name': 'Askön', + 'parent_device_type': 'Gateway', + 'port_number': -1, + 'product_name': 'Inside Temp/Hum', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 243, + 'station_id': 167376, + 'station_id_uuid': 'e49a32ea-dd9c-4bdb-8354-00141a381845', + 'station_name': 'Askön', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'HEALTH', + 'created_date': 1693647909, + 'elevation': 16.353, + 'latitude': 59.60993, + 'longitude': 18.770649, + 'lsid': 649753, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1693647909, + 'parent_device_id': 7443460, + 'parent_device_id_hex': '001D0A719404', + 'parent_device_name': 'Askön', + 'parent_device_type': 'Gateway', + 'port_number': 0, + 'product_name': 'WeatherLink LIVE Health', + 'product_number': None, + 'rain_collector_type': 0, + 'sensor_type': 504, + 'station_id': 167376, + 'station_id_uuid': 'e49a32ea-dd9c-4bdb-8354-00141a381845', + 'station_name': 'Askön', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'ISS', + 'created_date': 1693934070, + 'elevation': 37.216557, + 'latitude': 59.30568, + 'longitude': 18.21594, + 'lsid': 650442, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1693934070, + 'parent_device_id': 12586491, + 'parent_device_id_hex': '001d0ac00dfb', + 'parent_device_name': 'Strp81', + 'parent_device_type': 'Gateway', + 'port_number': 1, + 'product_name': 'Vantage Vue, Wireless', + 'product_number': '6357', + 'rain_collector_type': 2, + 'sensor_type': 37, + 'station_id': 167531, + 'station_id_uuid': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c', + 'station_name': 'Strp81', + 'tx_id': 1, + }), + dict({ + 'active': True, + 'category': 'Barometer', + 'created_date': 1693934167, + 'elevation': 37.216557, + 'latitude': 59.30568, + 'longitude': 18.21594, + 'lsid': 650440, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1693934167, + 'parent_device_id': 12586491, + 'parent_device_id_hex': '001d0ac00dfb', + 'parent_device_name': 'Strp81', + 'parent_device_type': 'Gateway', + 'port_number': 9, + 'product_name': 'Barometer', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 242, + 'station_id': 167531, + 'station_id_uuid': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c', + 'station_name': 'Strp81', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'Inside Temp/Hum', + 'created_date': 1693934167, + 'elevation': 37.216557, + 'latitude': 59.30568, + 'longitude': 18.21594, + 'lsid': 650441, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1693934167, + 'parent_device_id': 12586491, + 'parent_device_id_hex': '001d0ac00dfb', + 'parent_device_name': 'Strp81', + 'parent_device_type': 'Gateway', + 'port_number': -1, + 'product_name': 'Inside Temp/Hum', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 365, + 'station_id': 167531, + 'station_id_uuid': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c', + 'station_name': 'Strp81', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'HEALTH', + 'created_date': 1693934167, + 'elevation': 37.216557, + 'latitude': 59.30568, + 'longitude': 18.21594, + 'lsid': 650439, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1693934167, + 'parent_device_id': 12586491, + 'parent_device_id_hex': '001d0ac00dfb', + 'parent_device_name': 'Strp81', + 'parent_device_type': 'Gateway', + 'port_number': 0, + 'product_name': 'Console Health', + 'product_number': None, + 'rain_collector_type': 0, + 'sensor_type': 509, + 'station_id': 167531, + 'station_id_uuid': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c', + 'station_name': 'Strp81', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'Air Quality', + 'created_date': 1712660326, + 'elevation': 3.0, + 'latitude': 59.305717, + 'longitude': 18.215973, + 'lsid': 716449, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1712660326, + 'parent_device_id': 1056344, + 'parent_device_id_hex': '001D0A101E58', + 'parent_device_name': 'Saltsjö-Duvnäs AQ', + 'parent_device_type': 'Node', + 'port_number': -10, + 'product_name': 'AirLink', + 'product_number': '7210', + 'rain_collector_type': 0, + 'sensor_type': 323, + 'station_id': 183139, + 'station_id_uuid': 'c04a572b-583e-4e45-a222-7444e0ae7697', + 'station_name': 'Saltsjö-Duvnäs AQ', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'HEALTH', + 'created_date': 1712660326, + 'elevation': 3.0, + 'latitude': 59.305717, + 'longitude': 18.215973, + 'lsid': 716448, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1712660326, + 'parent_device_id': 1056344, + 'parent_device_id_hex': '001D0A101E58', + 'parent_device_name': 'Saltsjö-Duvnäs AQ', + 'parent_device_type': 'Node', + 'port_number': 0, + 'product_name': 'AQS Health', + 'product_number': None, + 'rain_collector_type': 0, + 'sensor_type': 506, + 'station_id': 183139, + 'station_id_uuid': 'c04a572b-583e-4e45-a222-7444e0ae7697', + 'station_name': 'Saltsjö-Duvnäs AQ', + 'tx_id': None, + }), + ]), + }), + 'current_data': dict({ + 'generated_at': 1735387067, + 'sensors': list([ + dict({ + 'data': list([ + dict({ + 'dew_point_in': 42.3, + 'heat_index_in': 67.8, + 'hum_in': 36.1, + 'temp_in': 70.5, + 'ts': 1735386900, + 'tz_offset': 3600, + 'wbgt_in': None, + 'wet_bulb_in': 55.4, + }), + ]), + 'data_structure_type': 21, + 'lsid': 650441, + 'sensor_type': 365, + }), + dict({ + 'data': list([ + dict({ + 'bar_absolute': 30.174, + 'bar_offset': 0, + 'bar_sea_level': 30.181, + 'bar_trend': -0.047, + 'ts': 1735386900, + 'tz_offset': 3600, + }), + ]), + 'data_structure_type': 19, + 'lsid': 650440, + 'sensor_type': 242, + }), + dict({ + 'data': list([ + dict({ + 'cdd_day': 0, + 'crc_errors_day': 9, + 'dew_point': -36.2, + 'et_day': 0, + 'et_month': 0, + 'et_year': 0, + 'freq_error_current': -1, + 'freq_error_total': -421, + 'freq_index': 0, + 'hdd_day': 13.014, + 'heat_index': 37.8, + 'hum': 2.8, + 'last_packet_received_timestamp': 1735386899, + 'packets_missed_day': 47, + 'packets_missed_streak': 0, + 'packets_missed_streak_hi_day': 1, + 'packets_received_day': 18099, + 'packets_received_streak': 232, + 'packets_received_streak_hi_day': 1439, + 'rain_rate_hi_clicks': 0, + 'rain_rate_hi_in': 0, + 'rain_rate_hi_last_15_min_clicks': 0, + 'rain_rate_hi_last_15_min_in': 0, + 'rain_rate_hi_last_15_min_mm': 0, + 'rain_rate_hi_mm': 0, + 'rain_rate_last_clicks': 0, + 'rain_rate_last_in': 0, + 'rain_rate_last_mm': 0, + 'rain_size': 2, + 'rain_storm_current_clicks': 17, + 'rain_storm_current_in': 0.13385826, + 'rain_storm_current_mm': 3.4, + 'rain_storm_current_start_at': 1735331847, + 'rain_storm_last_clicks': 36, + 'rain_storm_last_end_at': 1734923847, + 'rain_storm_last_in': 0.28346458, + 'rain_storm_last_mm': 7.2, + 'rain_storm_last_start_at': 1734780955, + 'rainfall_day_clicks': 1, + 'rainfall_day_in': 0.007874016, + 'rainfall_day_mm': 0.2, + 'rainfall_last_15_min_clicks': 0, + 'rainfall_last_15_min_in': 0, + 'rainfall_last_15_min_mm': 0, + 'rainfall_last_24_hr_clicks': 17, + 'rainfall_last_24_hr_in': 0.13385826, + 'rainfall_last_24_hr_mm': 3.4, + 'rainfall_last_60_min_clicks': 0, + 'rainfall_last_60_min_in': 0, + 'rainfall_last_60_min_mm': 0, + 'rainfall_month_clicks': 220, + 'rainfall_month_in': 1.7322835, + 'rainfall_month_mm': 44, + 'rainfall_year_clicks': 2719, + 'rainfall_year_in': 21.409449, + 'rainfall_year_mm': 543.8, + 'reception_day': 100, + 'resyncs_day': 0, + 'rssi_last': -59, + 'rx_state': 0, + 'solar_energy_day': 0, + 'solar_panel_volt': 0.422, + 'solar_rad': None, + 'spars_rpm': None, + 'spars_volt': None, + 'supercap_volt': 0.905, + 'temp': 40.1, + 'thsw_index': None, + 'thw_index': 37.5, + 'trans_battery_flag': 0, + 'trans_battery_volt': 2.822, + 'ts': 1735386900, + 'tx_id': 1, + 'tz_offset': 3600, + 'uv_dose_day': 0, + 'uv_index': None, + 'wbgt': None, + 'wet_bulb': 27.3, + 'wind_chill': 39.7, + 'wind_dir_at_hi_speed_last_10_min': 233, + 'wind_dir_at_hi_speed_last_2_min': 125, + 'wind_dir_last': 263, + 'wind_dir_scalar_avg_last_10_min': 157, + 'wind_dir_scalar_avg_last_1_min': 139, + 'wind_dir_scalar_avg_last_2_min': 135, + 'wind_run_day': 3.9000000953674316, + 'wind_speed_avg_last_10_min': 2.1, + 'wind_speed_avg_last_1_min': 1.45, + 'wind_speed_avg_last_2_min': 1.12, + 'wind_speed_hi_last_10_min': 9.06, + 'wind_speed_hi_last_2_min': 2.75, + 'wind_speed_last': 1.19, + }), + ]), + 'data_structure_type': 23, + 'lsid': 650442, + 'sensor_type': 37, + }), + dict({ + 'data': list([ + dict({ + 'app_uptime': 1243653, + 'battery_condition': 2, + 'battery_current': 0, + 'battery_cycle_count': 1, + 'battery_percent': 100, + 'battery_status': 5, + 'battery_temp': 28, + 'battery_voltage': 4304, + 'bgn': None, + 'bootloader_version': 2, + 'charger_plugged': 1, + 'clock_source': 2, + 'connection_uptime': 701989, + 'console_api_level': 28, + 'console_os_version': '1.3.9', + 'console_radio_version': '10.3.12.106', + 'console_sw_version': '1.4.59', + 'database_kilobytes': 108359, + 'dns_type_used': None, + 'free_mem': 738971, + 'gnss_sip_tx_id': 0, + 'health_version': 1, + 'internal_free_space': 2193829, + 'ip_address_type': None, + 'ip_v4_address': '192.168.0.65', + 'ip_v4_gateway': '192.168.0.1', + 'ip_v4_netmask': '255.255.255.0', + 'link_uptime': 1243645, + 'local_api_queries': None, + 'os_uptime': 3316245, + 'queue_kilobytes': 4, + 'rx_kilobytes': 2057544, + 'system_free_space': 740962, + 'ts': 1735386300, + 'tx_kilobytes': 136282, + 'tz_offset': 3600, + 'wifi_rssi': -55, + }), + ]), + 'data_structure_type': 27, + 'lsid': 650439, + 'sensor_type': 509, + }), + ]), + 'station_id': 167531, + 'station_id_uuid': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c', + }), + 'data': dict({ + '1': dict({ + 'bar_sea_level': 30.181, + 'bar_trend': -0.047, + 'data_structure': 23, + 'dewpoint': -36.2, + 'et_day': 0, + 'et_month': 0, + 'et_year': 0, + 'heat_index': 37.8, + 'hum_in': 36.1, + 'hum_out': 2.8, + 'rain_day': 0.007874016, + 'rain_month': 1.7322835, + 'rain_rate': 0, + 'rain_storm': 0.13385826, + 'rain_storm_last': 0.28346458, + 'rain_storm_last_end': 1734923847, + 'rain_storm_last_start': 1734780955, + 'rain_storm_start': 1735331847, + 'rain_year': 21.409449, + 'sensor_type': 37, + 'solar_panel_volt': 0.422, + 'solar_radiation': None, + 'supercap_volt': 0.905, + 'temp_in': 70.5, + 'temp_out': 40.1, + 'thsw_index': None, + 'thw_index': 37.5, + 'timestamp': 1735386900, + 'trans_battery_flag': 0, + 'trans_battery_volt': 2.822, + 'uv_index': None, + 'wet_bulb': 27.3, + 'wind_chill': 39.7, + 'wind_dir': 263, + 'wind_gust_mph': 9.06, + 'wind_mph': 1.19, + }), + 'station_id_uuid': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c', + }), + 'info': dict({ + 'api_key_v2': '**REDACTED**', + 'api_secret': '**REDACTED**', + 'api_version': 'api_v2', + 'station_id': '167531', + }), + 'sensor_metadata': list([ + dict({ + 'active': True, + 'category': 'ISS', + 'created_date': 1693934070, + 'elevation': 37.216557, + 'latitude': 59.30568, + 'longitude': 18.21594, + 'lsid': 650442, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1693934070, + 'parent_device_id': 12586491, + 'parent_device_id_hex': '001d0ac00dfb', + 'parent_device_name': 'Strp81', + 'parent_device_type': 'Gateway', + 'port_number': 1, + 'product_name': 'Vantage Vue, Wireless', + 'product_number': '6357', + 'rain_collector_type': 2, + 'sensor_type': 37, + 'station_id': 167531, + 'station_id_uuid': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c', + 'station_name': 'Strp81', + 'tx_id': 1, + }), + dict({ + 'active': True, + 'category': 'Barometer', + 'created_date': 1693934167, + 'elevation': 37.216557, + 'latitude': 59.30568, + 'longitude': 18.21594, + 'lsid': 650440, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1693934167, + 'parent_device_id': 12586491, + 'parent_device_id_hex': '001d0ac00dfb', + 'parent_device_name': 'Strp81', + 'parent_device_type': 'Gateway', + 'port_number': 9, + 'product_name': 'Barometer', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 242, + 'station_id': 167531, + 'station_id_uuid': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c', + 'station_name': 'Strp81', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'Inside Temp/Hum', + 'created_date': 1693934167, + 'elevation': 37.216557, + 'latitude': 59.30568, + 'longitude': 18.21594, + 'lsid': 650441, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1693934167, + 'parent_device_id': 12586491, + 'parent_device_id_hex': '001d0ac00dfb', + 'parent_device_name': 'Strp81', + 'parent_device_type': 'Gateway', + 'port_number': -1, + 'product_name': 'Inside Temp/Hum', + 'product_number': '', + 'rain_collector_type': 0, + 'sensor_type': 365, + 'station_id': 167531, + 'station_id_uuid': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c', + 'station_name': 'Strp81', + 'tx_id': None, + }), + dict({ + 'active': True, + 'category': 'HEALTH', + 'created_date': 1693934167, + 'elevation': 37.216557, + 'latitude': 59.30568, + 'longitude': 18.21594, + 'lsid': 650439, + 'manufacturer': 'Davis Instruments', + 'modified_date': 1693934167, + 'parent_device_id': 12586491, + 'parent_device_id_hex': '001d0ac00dfb', + 'parent_device_name': 'Strp81', + 'parent_device_type': 'Gateway', + 'port_number': 0, + 'product_name': 'Console Health', + 'product_number': None, + 'rain_collector_type': 0, + 'sensor_type': 509, + 'station_id': 167531, + 'station_id_uuid': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c', + 'station_name': 'Strp81', + 'tx_id': None, + }), + ]), + 'station_data': dict({ + 'generated_at': 1735386408, + 'stations': list([ + dict({ + 'active': True, + 'city': 'Saltsjö-duvnäs', + 'company_name': '', + 'country': 'Sweden', + 'elevation': 37.216557, + 'firmware_version': '1.4.59', + 'gateway_id': 12586491, + 'gateway_id_hex': '001d0ac00dfb', + 'gateway_type': 'WeatherLink Console', + 'latitude': 59.30568, + 'longitude': 18.21594, + 'private': False, + 'product_number': '6313', + 'recording_interval': 5, + 'region': 'Stockholms län', + 'registered_date': 1693934167, + 'relationship_type': 'Owned', + 'station_id': 167531, + 'station_id_uuid': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c', + 'station_name': 'Strp81', + 'subscription_type': 'Pro', + 'time_zone': 'Europe/Stockholm', + 'user_email': '**REDACTED**', + 'username': '**REDACTED**', + }), + ]), + }), + }) +# --- diff --git a/tests/snapshots/test_sensor.ambr b/tests/snapshots/test_sensor.ambr new file mode 100644 index 0000000..7b0ce48 --- /dev/null +++ b/tests/snapshots/test_sensor.ambr @@ -0,0 +1,1522 @@ +# serializer version: 1 +# name: test_sensor[sensor.strp81_dewpoint-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.strp81_dewpoint', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Dewpoint', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'dewpoint', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-Dewpoint', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[sensor.strp81_dewpoint-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'temperature', + 'friendly_name': 'Strp81 Dewpoint', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.strp81_dewpoint', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_evapotranspiration_day-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.strp81_evapotranspiration_day', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), + 'sensor.private': dict({ + 'suggested_unit_of_measurement': , + }), + }), + 'original_device_class': , + 'original_icon': 'mdi:waves-arrow-up', + 'original_name': 'Evapotranspiration day', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'et_day', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-ETDay', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[sensor.strp81_evapotranspiration_day-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'precipitation', + 'friendly_name': 'Strp81 Evapotranspiration day', + 'icon': 'mdi:waves-arrow-up', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.strp81_evapotranspiration_day', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_evapotranspiration_month-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.strp81_evapotranspiration_month', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), + 'sensor.private': dict({ + 'suggested_unit_of_measurement': , + }), + }), + 'original_device_class': , + 'original_icon': 'mdi:waves-arrow-up', + 'original_name': 'Evapotranspiration month', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'et_month', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-ETMonth', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[sensor.strp81_evapotranspiration_month-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'precipitation', + 'friendly_name': 'Strp81 Evapotranspiration month', + 'icon': 'mdi:waves-arrow-up', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.strp81_evapotranspiration_month', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_evapotranspiration_year-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.strp81_evapotranspiration_year', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), + 'sensor.private': dict({ + 'suggested_unit_of_measurement': , + }), + }), + 'original_device_class': , + 'original_icon': 'mdi:waves-arrow-up', + 'original_name': 'Evapotranspiration year', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'et_year', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-ETYear', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[sensor.strp81_evapotranspiration_year-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'precipitation', + 'friendly_name': 'Strp81 Evapotranspiration year', + 'icon': 'mdi:waves-arrow-up', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.strp81_evapotranspiration_year', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_heat_index-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.strp81_heat_index', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Heat index', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'heat_index', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-HeatIndex', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[sensor.strp81_heat_index-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'temperature', + 'friendly_name': 'Strp81 Heat index', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.strp81_heat_index', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_inside_humidity-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.strp81_inside_humidity', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 0, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Inside humidity', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'inside_humidity', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-InsideHumidity', + 'unit_of_measurement': '%', + }) +# --- +# name: test_sensor[sensor.strp81_inside_humidity-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'humidity', + 'friendly_name': 'Strp81 Inside humidity', + 'state_class': , + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.strp81_inside_humidity', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_inside_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.strp81_inside_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Inside temperature', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'inside_temperature', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-InsideTemp', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[sensor.strp81_inside_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'temperature', + 'friendly_name': 'Strp81 Inside temperature', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.strp81_inside_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_last_rain_storm-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.strp81_last_rain_storm', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), + 'sensor.private': dict({ + 'suggested_unit_of_measurement': , + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Last rain storm', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'rain_storm_last', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-RainStormLast', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[sensor.strp81_last_rain_storm-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'precipitation', + 'friendly_name': 'Strp81 Last rain storm', + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.strp81_last_rain_storm', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_last_updated-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.strp81_last_updated', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Last updated', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'last_update', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-LastUpdate', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensor[sensor.strp81_last_updated-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'timestamp', + 'friendly_name': 'Strp81 Last updated', + }), + 'context': , + 'entity_id': 'sensor.strp81_last_updated', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_outside_humidity-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.strp81_outside_humidity', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 0, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Outside humidity', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'outside_humidity', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-OutsideHumidity', + 'unit_of_measurement': '%', + }) +# --- +# name: test_sensor[sensor.strp81_outside_humidity-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'humidity', + 'friendly_name': 'Strp81 Outside humidity', + 'state_class': , + 'unit_of_measurement': '%', + }), + 'context': , + 'entity_id': 'sensor.strp81_outside_humidity', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_outside_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.strp81_outside_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Outside temperature', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'outside_temperature', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-OutsideTemp', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[sensor.strp81_outside_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'temperature', + 'friendly_name': 'Strp81 Outside temperature', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.strp81_outside_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_pressure-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.strp81_pressure', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 0, + }), + 'sensor.private': dict({ + 'suggested_unit_of_measurement': , + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Pressure', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'pressure', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-Pressure', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[sensor.strp81_pressure-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'pressure', + 'friendly_name': 'Strp81 Pressure', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.strp81_pressure', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_pressure_trend-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.strp81_pressure_trend', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:trending-up', + 'original_name': 'Pressure trend', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'bar_trend', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-BarTrend', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensor[sensor.strp81_pressure_trend-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Strp81 Pressure trend', + 'icon': 'mdi:trending-up', + }), + 'context': , + 'entity_id': 'sensor.strp81_pressure_trend', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_rain_intensity-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.strp81_rain_intensity', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), + 'sensor.private': dict({ + 'suggested_unit_of_measurement': , + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Rain intensity', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'rain_rate', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-RainRate', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[sensor.strp81_rain_intensity-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'precipitation_intensity', + 'friendly_name': 'Strp81 Rain intensity', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.strp81_rain_intensity', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_rain_storm-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.strp81_rain_storm', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), + 'sensor.private': dict({ + 'suggested_unit_of_measurement': , + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Rain storm', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'rain_storm', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-RainStorm', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[sensor.strp81_rain_storm-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'precipitation', + 'friendly_name': 'Strp81 Rain storm', + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.strp81_rain_storm', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_rain_this_month-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.strp81_rain_this_month', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 0, + }), + 'sensor.private': dict({ + 'suggested_unit_of_measurement': , + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Rain this month', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'rain_this_month', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-RainInMonth', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[sensor.strp81_rain_this_month-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'precipitation', + 'friendly_name': 'Strp81 Rain this month', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.strp81_rain_this_month', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_rain_this_year-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.strp81_rain_this_year', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 0, + }), + 'sensor.private': dict({ + 'suggested_unit_of_measurement': , + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Rain this year', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'rain_this_year', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-RainInYear', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[sensor.strp81_rain_this_year-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'precipitation', + 'friendly_name': 'Strp81 Rain this year', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.strp81_rain_this_year', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_rain_today-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.strp81_rain_today', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), + 'sensor.private': dict({ + 'suggested_unit_of_measurement': , + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Rain today', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'rain_today', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-RainToday', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[sensor.strp81_rain_today-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'precipitation', + 'friendly_name': 'Strp81 Rain today', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.strp81_rain_today', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_solar_panel-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.strp81_solar_panel', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 3, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Solar panel', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'solar_panel_volt', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-SolarPanelVolt', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[sensor.strp81_solar_panel-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'voltage', + 'friendly_name': 'Strp81 Solar panel', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.strp81_solar_panel', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_supercapacitor-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.strp81_supercapacitor', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 3, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Supercapacitor', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'supercap_volt', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-SupercapVolt', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[sensor.strp81_supercapacitor-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'voltage', + 'friendly_name': 'Strp81 Supercapacitor', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.strp81_supercapacitor', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_thw_index-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.strp81_thw_index', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'THW index', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'thw_index', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-ThwIndex', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[sensor.strp81_thw_index-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'temperature', + 'friendly_name': 'Strp81 THW index', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.strp81_thw_index', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_transmitter_battery-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.strp81_transmitter_battery', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 3, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Transmitter battery', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'trans_battery_volt', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-TransBatteryVolt', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[sensor.strp81_transmitter_battery-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'voltage', + 'friendly_name': 'Strp81 Transmitter battery', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.strp81_transmitter_battery', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_wet_bulb-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.strp81_wet_bulb', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Wet bulb', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'wet_bulb', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-WetBulb', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[sensor.strp81_wet_bulb-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'temperature', + 'friendly_name': 'Strp81 Wet bulb', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.strp81_wet_bulb', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_wind-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.strp81_wind', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), + 'sensor.private': dict({ + 'suggested_unit_of_measurement': , + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Wind', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'wind', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-Wind', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[sensor.strp81_wind-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'wind_speed', + 'friendly_name': 'Strp81 Wind', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.strp81_wind', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_wind_chill-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.strp81_wind_chill', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Wind chill', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'wind_chill', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-WindChill', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[sensor.strp81_wind_chill-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'temperature', + 'friendly_name': 'Strp81 Wind chill', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.strp81_wind_chill', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_wind_direction-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.strp81_wind_direction', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:compass-outline', + 'original_name': 'Wind direction', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'wind_direction', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-WindDir', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensor[sensor.strp81_wind_direction-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Strp81 Wind direction', + 'icon': 'mdi:compass-outline', + }), + 'context': , + 'entity_id': 'sensor.strp81_wind_direction', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_wind_direction_deg-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.strp81_wind_direction_deg', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:compass-outline', + 'original_name': 'Wind direction deg', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'wind_direction_deg', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-WindDirDeg', + 'unit_of_measurement': '°', + }) +# --- +# name: test_sensor[sensor.strp81_wind_direction_deg-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Strp81 Wind direction deg', + 'icon': 'mdi:compass-outline', + 'state_class': , + 'unit_of_measurement': '°', + }), + 'context': , + 'entity_id': 'sensor.strp81_wind_direction_deg', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- +# name: test_sensor[sensor.strp81_wind_gust-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.strp81_wind_gust', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), + 'sensor.private': dict({ + 'suggested_unit_of_measurement': , + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Wind gust', + 'platform': 'weatherlink', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'wind_gust', + 'unique_id': '03e7585a-4f29-4e7c-b6cb-d9e17313b07c-WindGust', + 'unit_of_measurement': , + }) +# --- +# name: test_sensor[sensor.strp81_wind_gust-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'wind_speed', + 'friendly_name': 'Strp81 Wind gust', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.strp81_wind_gust', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unavailable', + }) +# --- diff --git a/tests/test_binary_sensor.py b/tests/test_binary_sensor.py new file mode 100644 index 0000000..1e1999f --- /dev/null +++ b/tests/test_binary_sensor.py @@ -0,0 +1,61 @@ +"""Provide tests for weatherlink sensors.""" + +from unittest.mock import patch + +import pytest +from pytest_homeassistant_custom_component.common import ( + MockConfigEntry, + snapshot_platform, +) +from syrupy import SnapshotAssertion + +from custom_components.weatherlink.const import DOMAIN +from homeassistant.const import Platform +from homeassistant.core import HomeAssistant +from homeassistant.helpers import entity_registry as er + +from . import setup_integration +from .const import ENTRY_ID, MOCK_CONFIG_V2 + + +@pytest.mark.usefixtures("entity_registry_enabled_by_default") +async def test_sensor( + hass: HomeAssistant, + bypass_get_data, + bypass_get_station, + bypass_get_all_sensors, + snapshot: SnapshotAssertion, + entity_registry: er.EntityRegistry, +) -> None: + """Test sensor states.""" + + mock_config_entry = MockConfigEntry( + domain=DOMAIN, version=2, data=MOCK_CONFIG_V2, entry_id=ENTRY_ID + ) + + with patch("custom_components.weatherlink.PLATFORMS", [Platform.BINARY_SENSOR]): + await setup_integration(hass, mock_config_entry) + + await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id) + + +# @pytest.mark.parametrize( +# "data_file_name", ["station_166.json", "station_135.json", "station_88.json"] +# ) +# @pytest.mark.usefixtures("entity_registry_enabled_by_default") +# async def test_sensor_additional_stations( +# hass: HomeAssistant, +# bypass_get_data, +# snapshot: SnapshotAssertion, +# entity_registry: er.EntityRegistry, +# ) -> None: +# """Test states for additional stations.""" + +# mock_config_entry = MockConfigEntry( +# domain=DOMAIN, data=MOCK_CONFIG, entry_id=ENTRY_ID +# ) + +# with patch("custom_components.viva.PLATFORMS", [Platform.SENSOR]): +# await setup_integration(hass, mock_config_entry) + +# await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id) diff --git a/tests/test_config_flow.py b/tests/test_config_flow.py new file mode 100644 index 0000000..ba697ac --- /dev/null +++ b/tests/test_config_flow.py @@ -0,0 +1,135 @@ +"""Tests for config flow.""" + +from unittest.mock import patch + +import pytest + +from custom_components.weatherlink.config_flow import CannotConnect, InvalidAuth +from custom_components.weatherlink.const import ( + DOMAIN, + CONF_API_KEY_V2, + CONF_API_SECRET, + CONF_STATION_ID, +) +from homeassistant import config_entries +from homeassistant.core import HomeAssistant +from homeassistant.data_entry_flow import FlowResultType + + +@pytest.fixture(autouse=True) +def bypass_setup_fixture(): + """Prevent setup.""" + with patch( + "custom_components.weatherlink.async_setup_entry", + return_value=True, + ): + yield + + +async def test_succesful_flow( + hass: HomeAssistant, bypass_get_all_stations, bypass_get_station +) -> None: + """Test that we get the form and create the entry.""" + + result = await hass.config_entries.flow.async_init( + DOMAIN, context={"source": config_entries.SOURCE_USER} + ) + + assert result["type"] is FlowResultType.FORM + assert result["errors"] is None + + result = await hass.config_entries.flow.async_configure( + result["flow_id"], + {"api_version": "api_v2"}, + ) + + assert result["type"] is FlowResultType.FORM + assert result["step_id"] == "user_2" + + with patch( + "custom_components.weatherlink.config_flow.validate_input_v2", + return_value={"title": "test"}, + ): + result = await hass.config_entries.flow.async_configure( + result["flow_id"], {CONF_API_KEY_V2: "123", CONF_API_SECRET: "456"} + ) + + assert result["type"] is FlowResultType.FORM + assert result["step_id"] == "user_3" + + result = await hass.config_entries.flow.async_configure( + result["flow_id"], + {CONF_STATION_ID: "167531"}, + ) + + assert result["type"] is FlowResultType.CREATE_ENTRY + + +@pytest.mark.parametrize( + ("exc", "key"), + [ + (CannotConnect, "cannot_connect"), + (InvalidAuth, "invalid_auth"), + (Exception, "unknown"), + ], + ids=["cannot_connect", "invalid_auth", "other_exception"], +) +async def test_failed_flow( + hass: HomeAssistant, bypass_get_all_stations, bypass_get_station, exc, key +) -> None: + """Test failing flows.""" + + result = await hass.config_entries.flow.async_init( + DOMAIN, context={"source": config_entries.SOURCE_USER} + ) + + assert result["type"] is FlowResultType.FORM + assert result["errors"] is None + + result = await hass.config_entries.flow.async_configure( + result["flow_id"], + {"api_version": "api_v2"}, + ) + + assert result["type"] is FlowResultType.FORM + assert result["step_id"] == "user_2" + + with patch( + "custom_components.weatherlink.config_flow.validate_input_v2", side_effect=exc + ): + result = await hass.config_entries.flow.async_configure( + result["flow_id"], {CONF_API_KEY_V2: "123", CONF_API_SECRET: "456"} + ) + + assert result["errors"] == {"base": key} + + +async def test_auth_error( + hass: HomeAssistant, bypass_get_all_stations, bypass_get_station +) -> None: + """Test auth error.""" + + result = await hass.config_entries.flow.async_init( + DOMAIN, context={"source": config_entries.SOURCE_USER} + ) + + assert result["type"] is FlowResultType.FORM + assert result["errors"] is None + + result = await hass.config_entries.flow.async_configure( + result["flow_id"], + {"api_version": "api_v2"}, + ) + + assert result["type"] is FlowResultType.FORM + assert result["step_id"] == "user_2" + + with patch( + "custom_components.weatherlink.WLHubV2.authenticate", + return_value=False, + ): + result = await hass.config_entries.flow.async_configure( + result["flow_id"], {CONF_API_KEY_V2: "123", CONF_API_SECRET: "456"} + ) + + assert result["errors"] == {"base": "invalid_auth"} diff --git a/tests/test_diagnostics.py b/tests/test_diagnostics.py new file mode 100644 index 0000000..ed06189 --- /dev/null +++ b/tests/test_diagnostics.py @@ -0,0 +1,62 @@ +"""Tests for the diagnostics data provided by the weatherlink integration.""" + +from http import HTTPStatus +from typing import cast + +from pytest_homeassistant_custom_component.common import MockConfigEntry +from pytest_homeassistant_custom_component.typing import ClientSessionGenerator +from syrupy import SnapshotAssertion + +from custom_components.weatherlink.const import DOMAIN +from homeassistant.config_entries import ConfigEntry +from homeassistant.core import HomeAssistant +from homeassistant.setup import async_setup_component +from homeassistant.util.json import JsonObjectType + +from .const import ENTRY_ID, MOCK_CONFIG_V2 + + +async def test_diagnostics( + hass: HomeAssistant, + hass_client: ClientSessionGenerator, + snapshot: SnapshotAssertion, + bypass_get_data, + bypass_get_station, + bypass_get_all_sensors, +) -> None: + """Test diagnostics.""" + entry = MockConfigEntry( + domain=DOMAIN, version=2, data=MOCK_CONFIG_V2, entry_id=ENTRY_ID + ) + entry.add_to_hass(hass) + await hass.config_entries.async_setup(entry.entry_id) + await hass.async_block_till_done() + assert await get_diagnostics_for_config_entry(hass, hass_client, entry) == snapshot + + +# The following 2 functions are copied from https://github.com/home-assistant/core/blob/dev/tests/components/diagnostics/__init__.py +async def _get_diagnostics_for_config_entry( + hass: HomeAssistant, + hass_client: ClientSessionGenerator, + config_entry: ConfigEntry, +) -> JsonObjectType: + """Return the diagnostics config entry for the specified domain.""" + assert await async_setup_component(hass, "diagnostics", {}) + await hass.async_block_till_done() + + client = await hass_client() + response = await client.get( + f"/api/diagnostics/config_entry/{config_entry.entry_id}" + ) + assert response.status == HTTPStatus.OK + return cast(JsonObjectType, await response.json()) + + +async def get_diagnostics_for_config_entry( + hass: HomeAssistant, + hass_client: ClientSessionGenerator, + config_entry: ConfigEntry, +) -> JsonObjectType: + """Return the diagnostics config entry for the specified domain.""" + data = await _get_diagnostics_for_config_entry(hass, hass_client, config_entry) + return cast(JsonObjectType, data["data"]) diff --git a/tests/test_init.py b/tests/test_init.py new file mode 100644 index 0000000..099f983 --- /dev/null +++ b/tests/test_init.py @@ -0,0 +1,59 @@ +"""Test initial setup.""" + +from pytest_homeassistant_custom_component.common import MockConfigEntry + +from custom_components.weatherlink import async_unload_entry +from custom_components.weatherlink.const import DOMAIN +from homeassistant.config_entries import ConfigEntryState +from homeassistant.core import HomeAssistant +from homeassistant.helpers import device_registry as dr + +from . import setup_integration +from .const import ENTRY_ID, MOCK_CONFIG_V2 + + +async def test_setup_entry( + hass: HomeAssistant, bypass_get_station, bypass_get_data, bypass_get_all_sensors +) -> None: + """Test setup entry.""" + entry = MockConfigEntry( + domain=DOMAIN, version=2, data=MOCK_CONFIG_V2, entry_id=ENTRY_ID + ) + await setup_integration(hass, entry) + + assert entry.state is ConfigEntryState.LOADED + + assert await async_unload_entry(hass, entry) + assert DOMAIN not in hass.data + + +async def test_devices_created_count( + hass: HomeAssistant, + bypass_get_station, + bypass_get_data, + bypass_get_all_sensors, +) -> None: + """Test that one device is created.""" + config_entry = MockConfigEntry( + domain=DOMAIN, version=2, data=MOCK_CONFIG_V2, entry_id=ENTRY_ID + ) + + await setup_integration(hass, config_entry) + + device_registry = dr.async_get(hass) + + assert len(device_registry.devices) == 1 + + +# @pytest.mark.parametrize("exception", [ClientResponseError, TimeoutError]) +# async def test_api_error(hass: HomeAssistant, exception, mock_api) -> None: +# """Test for exceptions during data fetch.""" +# entry = MockConfigEntry( +# domain=DOMAIN, version=2, data=MOCK_CONFIG_V2, entry_id=ENTRY_ID +# ) +# entry.add_to_hass(hass) +# mock_api.side_effect = exception +# await hass.config_entries.async_setup(entry.entry_id) +# await hass.async_block_till_done() + +# assert entry.state is ConfigEntryState.SETUP_RETRY diff --git a/tests/test_sensor.py b/tests/test_sensor.py new file mode 100644 index 0000000..1c29c0c --- /dev/null +++ b/tests/test_sensor.py @@ -0,0 +1,61 @@ +"""Provide tests for weatherlink sensors.""" + +from unittest.mock import patch + +import pytest +from pytest_homeassistant_custom_component.common import ( + MockConfigEntry, + snapshot_platform, +) +from syrupy import SnapshotAssertion + +from custom_components.weatherlink.const import DOMAIN +from homeassistant.const import Platform +from homeassistant.core import HomeAssistant +from homeassistant.helpers import entity_registry as er + +from . import setup_integration +from .const import ENTRY_ID, MOCK_CONFIG_V2 + + +@pytest.mark.usefixtures("entity_registry_enabled_by_default") +async def test_sensor( + hass: HomeAssistant, + bypass_get_data, + bypass_get_station, + bypass_get_all_sensors, + snapshot: SnapshotAssertion, + entity_registry: er.EntityRegistry, +) -> None: + """Test sensor states.""" + + mock_config_entry = MockConfigEntry( + domain=DOMAIN, version=2, data=MOCK_CONFIG_V2, entry_id=ENTRY_ID + ) + + with patch("custom_components.weatherlink.PLATFORMS", [Platform.SENSOR]): + await setup_integration(hass, mock_config_entry) + + await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id) + + +# @pytest.mark.parametrize( +# "data_file_name", ["station_166.json", "station_135.json", "station_88.json"] +# ) +# @pytest.mark.usefixtures("entity_registry_enabled_by_default") +# async def test_sensor_additional_stations( +# hass: HomeAssistant, +# bypass_get_data, +# snapshot: SnapshotAssertion, +# entity_registry: er.EntityRegistry, +# ) -> None: +# """Test states for additional stations.""" + +# mock_config_entry = MockConfigEntry( +# domain=DOMAIN, data=MOCK_CONFIG, entry_id=ENTRY_ID +# ) + +# with patch("custom_components.viva.PLATFORMS", [Platform.SENSOR]): +# await setup_integration(hass, mock_config_entry) + +# await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id)