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