2021-04-13 16:21:01 +00:00
|
|
|
"""Test the sma sensor platform."""
|
2023-01-16 08:00:27 +00:00
|
|
|
from homeassistant.const import ATTR_UNIT_OF_MEASUREMENT, UnitOfPower
|
2019-08-19 20:10:35 +00:00
|
|
|
|
|
|
|
|
2021-04-20 08:59:02 +00:00
|
|
|
async def test_sensors(hass, init_integration):
|
2021-04-13 16:21:01 +00:00
|
|
|
"""Test states of the sensors."""
|
2022-02-19 19:27:06 +00:00
|
|
|
state = hass.states.get("sensor.sma_device_grid_power")
|
2019-08-19 20:10:35 +00:00
|
|
|
assert state
|
2023-01-16 08:00:27 +00:00
|
|
|
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfPower.WATT
|