* continue * Rebase dev * signle function to generate attr_entity info * rewrite icon determination as an if block * handling PR * Removing wind sensors for now - separate future PR * ruff * Update coordinator.py Thought i already did this * Update sensor.py * Update icons.json * Update sensor.py * Update homeassistant/components/weatherflow_cloud/entity.py Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> * working on a unified entity * working on a unified entity * sensor refactor * addressing entity comment * Update homeassistant/components/weatherflow_cloud/entity.py Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> * Update homeassistant/components/weatherflow_cloud/sensor.py Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> * doc * pr comments again * fixing PR * fixing PR * applying entity class in sensor * Update homeassistant/components/weatherflow_cloud/sensor.py Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> * Cleaning up weather.py * station id cleanup for weather class * rewrite adding sensors the correct way * Adding snapshot testing * snapshot update * added total class * updated snapshots * minor tweak * snapshot away * adding more coverage * switch back to total * Apply suggestions from code review * Apply suggestions from code review * Apply suggestions from code review --------- Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
29 lines
857 B
Python
29 lines
857 B
Python
"""Tests for the WeatherFlow Cloud weather platform."""
|
|
|
|
from unittest.mock import AsyncMock, patch
|
|
|
|
from syrupy import SnapshotAssertion
|
|
|
|
from homeassistant.const import Platform
|
|
from homeassistant.core import HomeAssistant
|
|
from homeassistant.helpers import entity_registry as er
|
|
|
|
from . import setup_integration
|
|
|
|
from tests.common import MockConfigEntry, snapshot_platform
|
|
|
|
|
|
async def test_weather(
|
|
hass: HomeAssistant,
|
|
snapshot: SnapshotAssertion,
|
|
mock_config_entry: MockConfigEntry,
|
|
entity_registry: er.EntityRegistry,
|
|
mock_api: AsyncMock,
|
|
) -> None:
|
|
"""Test all entities."""
|
|
with patch(
|
|
"homeassistant.components.weatherflow_cloud.PLATFORMS", [Platform.WEATHER]
|
|
):
|
|
await setup_integration(hass, mock_config_entry)
|
|
|
|
await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id)
|