mirror of
https://github.com/home-assistant/core.git
synced 2026-09-22 17:52:44 +01:00
105 lines
2.4 KiB
Python
105 lines
2.4 KiB
Python
"""Constants for the binary_sensor integration."""
|
|
|
|
from enum import StrEnum
|
|
from typing import Final
|
|
|
|
import probatio
|
|
|
|
DOMAIN: Final = "binary_sensor"
|
|
|
|
|
|
class BinarySensorDeviceClass(StrEnum):
|
|
"""Device class for binary sensors."""
|
|
|
|
# On means low, Off means normal
|
|
BATTERY = "battery"
|
|
|
|
# On means charging, Off means not charging
|
|
BATTERY_CHARGING = "battery_charging"
|
|
|
|
# On means carbon monoxide detected, Off means no carbon monoxide (clear)
|
|
CO = "carbon_monoxide"
|
|
|
|
# On means cold, Off means normal
|
|
COLD = "cold"
|
|
|
|
# On means connected, Off means disconnected
|
|
CONNECTIVITY = "connectivity"
|
|
|
|
# On means open, Off means closed
|
|
DOOR = "door"
|
|
|
|
# On means open, Off means closed
|
|
GARAGE_DOOR = "garage_door"
|
|
|
|
# On means gas detected, Off means no gas (clear)
|
|
GAS = "gas"
|
|
|
|
# On means glass break detected, Off means no glass break (clear)
|
|
GLASS_BREAK = "glass_break"
|
|
|
|
# On means hot, Off means normal
|
|
HEAT = "heat"
|
|
|
|
# On means light detected, Off means no light
|
|
LIGHT = "light"
|
|
|
|
# On means open (unlocked), Off means closed (locked)
|
|
LOCK = "lock"
|
|
|
|
# On means wet, Off means dry
|
|
MOISTURE = "moisture"
|
|
|
|
# On means motion detected, Off means no motion (clear)
|
|
MOTION = "motion"
|
|
|
|
# On means moving, Off means not moving (stopped)
|
|
MOVING = "moving"
|
|
|
|
# On means occupied, Off means not occupied (clear)
|
|
OCCUPANCY = "occupancy"
|
|
|
|
# On means open, Off means closed
|
|
OPENING = "opening"
|
|
|
|
# On means plugged in, Off means unplugged
|
|
PLUG = "plug"
|
|
|
|
# On means power detected, Off means no power
|
|
POWER = "power"
|
|
|
|
# On means home, Off means away
|
|
PRESENCE = "presence"
|
|
|
|
# On means problem detected, Off means no problem (OK)
|
|
PROBLEM = "problem"
|
|
|
|
# On means running, Off means not running
|
|
RUNNING = "running"
|
|
|
|
# On means unsafe, Off means safe
|
|
SAFETY = "safety"
|
|
|
|
# On means smoke detected, Off means no smoke (clear)
|
|
SMOKE = "smoke"
|
|
|
|
# On means sound detected, Off means no sound (clear)
|
|
SOUND = "sound"
|
|
|
|
# On means tampering detected, Off means no tampering (clear)
|
|
TAMPER = "tamper"
|
|
|
|
# On means update available, Off means up-to-date
|
|
UPDATE = "update"
|
|
|
|
# On means vibration detected, Off means no vibration
|
|
VIBRATION = "vibration"
|
|
|
|
# On means open, Off means closed
|
|
WINDOW = "window"
|
|
|
|
|
|
DEVICE_CLASSES_SCHEMA = probatio.All(
|
|
probatio.Lower, probatio.Coerce(BinarySensorDeviceClass)
|
|
)
|