Use DEVICE_CLASS_WINDOW constant in various integrations (#39949)

This commit is contained in:
springstan 2020-09-12 04:24:23 +02:00 committed by GitHub
parent a6d3ee90f0
commit f93c0c5cd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 32 additions and 14 deletions

View file

@ -2,7 +2,10 @@
import logging
from typing import Callable
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_WINDOW,
BinarySensorEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
@ -33,8 +36,8 @@ BINARY_SENSOR_TYPES = {
SENSOR_SAFE: ("Safe", "door"),
SENSOR_SLIDING: ("Sliding Door/Window", "door"),
SENSOR_SMOKE_CO: ("Smoke/Carbon Monoxide Detector", "smoke"),
SENSOR_WINDOW_HINGED_HORIZONTAL: ("Hinged Window", "window"),
SENSOR_WINDOW_HINGED_VERTICAL: ("Hinged Window", "window"),
SENSOR_WINDOW_HINGED_HORIZONTAL: ("Hinged Window", DEVICE_CLASS_WINDOW),
SENSOR_WINDOW_HINGED_VERTICAL: ("Hinged Window", DEVICE_CLASS_WINDOW),
}