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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 141 additions and 113 deletions

View file

@ -21,8 +21,8 @@ from homeassistant.const import (
ATTR_ASSUMED_STATE,
EVENT_HOMEASSISTANT_STARTED,
EVENT_HOMEASSISTANT_STOP,
TEMP_CELSIUS,
Platform,
UnitOfTemperature,
)
import homeassistant.core as ha
from homeassistant.core import CoreState, HomeAssistant, callback
@ -816,7 +816,7 @@ async def test_all_subscriptions_run_when_decode_fails(
await mqtt.async_subscribe(hass, "test-topic", record_calls, encoding="ascii")
await mqtt.async_subscribe(hass, "test-topic", record_calls)
async_fire_mqtt_message(hass, "test-topic", TEMP_CELSIUS)
async_fire_mqtt_message(hass, "test-topic", UnitOfTemperature.CELSIUS)
await hass.async_block_till_done()
assert len(calls) == 1