Enable strict type checks for onewire (#50422)

This commit is contained in:
epenet 2021-05-11 17:28:17 +02:00 committed by GitHub
parent efa5c59559
commit d6c99a3db9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 202 additions and 84 deletions

View file

@ -1,4 +1,6 @@
"""Constants for 1-Wire component."""
from __future__ import annotations
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
@ -44,7 +46,7 @@ SENSOR_TYPE_WETNESS = "wetness"
SWITCH_TYPE_LATCH = "latch"
SWITCH_TYPE_PIO = "pio"
SENSOR_TYPES = {
SENSOR_TYPES: dict[str, list[str | None]] = {
# SensorType: [ Unit, DeviceClass ]
SENSOR_TYPE_TEMPERATURE: [TEMP_CELSIUS, DEVICE_CLASS_TEMPERATURE],
SENSOR_TYPE_HUMIDITY: [PERCENTAGE, DEVICE_CLASS_HUMIDITY],