Replace the usage of unit constants by enumerations in Tests [m-n] (#85935)

* replace unit conts by enums m-n

* fix mqtt
This commit is contained in:
Michael
2023-01-15 15:45:00 +01:00
committed by GitHub
parent e35ab75c0b
commit 104f74054b
16 changed files with 141 additions and 113 deletions

View File

@@ -12,9 +12,8 @@ from homeassistant.const import (
EVENT_STATE_CHANGED,
STATE_UNAVAILABLE,
STATE_UNKNOWN,
TEMP_CELSIUS,
TEMP_FAHRENHEIT,
Platform,
UnitOfTemperature,
)
import homeassistant.core as ha
from homeassistant.helpers import device_registry as dr
@@ -1127,14 +1126,14 @@ async def test_cleanup_triggers_and_restoring_state(
config1["expire_after"] = 30
config1["state_topic"] = "test-topic1"
config1["device_class"] = "temperature"
config1["unit_of_measurement"] = TEMP_FAHRENHEIT
config1["unit_of_measurement"] = str(UnitOfTemperature.FAHRENHEIT)
config2 = copy.deepcopy(DEFAULT_CONFIG[mqtt.DOMAIN][domain])
config2["name"] = "test2"
config2["expire_after"] = 5
config2["state_topic"] = "test-topic2"
config2["device_class"] = "temperature"
config2["unit_of_measurement"] = TEMP_CELSIUS
config2["unit_of_measurement"] = str(UnitOfTemperature.CELSIUS)
freezer.move_to("2022-02-02 12:01:00+01:00")