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:
parent
98b1bc9bed
commit
a595cd7141
6 changed files with 141 additions and 1 deletions
27
tests/components/aosmith/test_sensor.py
Normal file
27
tests/components/aosmith/test_sensor.py
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue