1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-23 12:29:55 +00:00

SMA code quality improvement and bugfix (#49346)

* Minor code quality improvements
Thanks to @MartinHjelmare

* Convert legacy dict config to list

* Improved test

* Typo

* Test improvements

* Create fixtures in conftest.py
This commit is contained in:
René Klomp
2021-04-20 10:59:02 +02:00
committed by GitHub
parent a278ebd37b
commit 12853438c5
5 changed files with 142 additions and 100 deletions

View File

@@ -5,13 +5,11 @@ from homeassistant.const import (
POWER_WATT,
)
from . import MOCK_CUSTOM_SENSOR, init_integration
from . import MOCK_CUSTOM_SENSOR
async def test_sensors(hass):
async def test_sensors(hass, init_integration):
"""Test states of the sensors."""
await init_integration(hass)
state = hass.states.get("sensor.current_consumption")
assert state
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == POWER_WATT