2021-04-13 16:21:01 +00:00
|
|
|
"""Test the sma sensor platform."""
|
2022-01-04 15:04:16 +00:00
|
|
|
from homeassistant.const import ATTR_UNIT_OF_MEASUREMENT, POWER_WATT
|
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."""
|
2021-05-27 10:53:14 +00:00
|
|
|
state = hass.states.get("sensor.grid_power")
|
2019-08-19 20:10:35 +00:00
|
|
|
assert state
|
2021-04-13 16:21:01 +00:00
|
|
|
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == POWER_WATT
|