Add sensor platform to A. O. Smith integration (#105604)

* Add sensor platform to A. O. Smith integration

* Fix typo

* Remove unnecessary mixin

* Simplify async_setup_entry
This commit is contained in:
Brandon Rothweiler 2023-12-12 18:52:15 -05:00 committed by GitHub
parent 98b1bc9bed
commit a595cd7141
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 141 additions and 1 deletions

View file

@ -0,0 +1,27 @@
"""Tests for the sensor platform of the A. O. Smith integration."""
from syrupy.assertion import SnapshotAssertion
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from tests.common import MockConfigEntry
async def test_setup(
hass: HomeAssistant,
entity_registry: er.EntityRegistry,
init_integration: MockConfigEntry,
) -> None:
"""Test the setup of the sensor entity."""
entry = entity_registry.async_get("sensor.my_water_heater_hot_water_availability")
assert entry
assert entry.unique_id == "hot_water_availability_junctionId"
async def test_state(
hass: HomeAssistant, init_integration: MockConfigEntry, snapshot: SnapshotAssertion
) -> None:
"""Test the state of the sensor entity."""
state = hass.states.get("sensor.my_water_heater_hot_water_availability")
assert state == snapshot