Google Assistant: Add support for open/close binary sensors (#22674)
* Google Assistant: Add support for binary sensors * Update test
This commit is contained in:
parent
3872ac9bf9
commit
14da2fd8c9
4 changed files with 207 additions and 73 deletions
|
@ -15,30 +15,100 @@ DOMAIN = 'binary_sensor'
|
|||
SCAN_INTERVAL = timedelta(seconds=30)
|
||||
|
||||
ENTITY_ID_FORMAT = DOMAIN + '.{}'
|
||||
|
||||
# On means low, Off means normal
|
||||
DEVICE_CLASS_BATTERY = 'battery'
|
||||
|
||||
# On means cold, Off means normal
|
||||
DEVICE_CLASS_COLD = 'cold'
|
||||
|
||||
# On means connected, Off means disconnected
|
||||
DEVICE_CLASS_CONNECTIVITY = 'connectivity'
|
||||
|
||||
# On means open, Off means closed
|
||||
DEVICE_CLASS_DOOR = 'door'
|
||||
|
||||
# On means open, Off means closed
|
||||
DEVICE_CLASS_GARAGE_DOOR = 'garage_door'
|
||||
|
||||
# On means gas detected, Off means no gas (clear)
|
||||
DEVICE_CLASS_GAS = 'gas'
|
||||
|
||||
# On means hot, Off means normal
|
||||
DEVICE_CLASS_HEAT = 'heat'
|
||||
|
||||
# On means light detected, Off means no light
|
||||
DEVICE_CLASS_LIGHT = 'light'
|
||||
|
||||
# On means open (unlocked), Off means closed (locked)
|
||||
DEVICE_CLASS_LOCK = 'lock'
|
||||
|
||||
# On means wet, Off means dry
|
||||
DEVICE_CLASS_MOISTURE = 'moisture'
|
||||
|
||||
# On means motion detected, Off means no motion (clear)
|
||||
DEVICE_CLASS_MOTION = 'motion'
|
||||
|
||||
# On means moving, Off means not moving (stopped)
|
||||
DEVICE_CLASS_MOVING = 'moving'
|
||||
|
||||
# On means occupied, Off means not occupied (clear)
|
||||
DEVICE_CLASS_OCCUPANCY = 'occupancy'
|
||||
|
||||
# On means open, Off means closed
|
||||
DEVICE_CLASS_OPENING = 'opening'
|
||||
|
||||
# On means plugged in, Off means unplugged
|
||||
DEVICE_CLASS_PLUG = 'plug'
|
||||
|
||||
# On means power detected, Off means no power
|
||||
DEVICE_CLASS_POWER = 'power'
|
||||
|
||||
# On means home, Off means away
|
||||
DEVICE_CLASS_PRESENCE = 'presence'
|
||||
|
||||
# On means problem detected, Off means no problem (OK)
|
||||
DEVICE_CLASS_PROBLEM = 'problem'
|
||||
|
||||
# On means unsafe, Off means safe
|
||||
DEVICE_CLASS_SAFETY = 'safety'
|
||||
|
||||
# On means smoke detected, Off means no smoke (clear)
|
||||
DEVICE_CLASS_SMOKE = 'smoke'
|
||||
|
||||
# On means sound detected, Off means no sound (clear)
|
||||
DEVICE_CLASS_SOUND = 'sound'
|
||||
|
||||
# On means vibration detected, Off means no vibration
|
||||
DEVICE_CLASS_VIBRATION = 'vibration'
|
||||
|
||||
# On means open, Off means closed
|
||||
DEVICE_CLASS_WINDOW = 'window'
|
||||
|
||||
DEVICE_CLASSES = [
|
||||
'battery', # On means low, Off means normal
|
||||
'cold', # On means cold, Off means normal
|
||||
'connectivity', # On means connected, Off means disconnected
|
||||
'door', # On means open, Off means closed
|
||||
'garage_door', # On means open, Off means closed
|
||||
'gas', # On means gas detected, Off means no gas (clear)
|
||||
'heat', # On means hot, Off means normal
|
||||
'light', # On means light detected, Off means no light
|
||||
'lock', # On means open (unlocked), Off means closed (locked)
|
||||
'moisture', # On means wet, Off means dry
|
||||
'motion', # On means motion detected, Off means no motion (clear)
|
||||
'moving', # On means moving, Off means not moving (stopped)
|
||||
'occupancy', # On means occupied, Off means not occupied (clear)
|
||||
'opening', # On means open, Off means closed
|
||||
'plug', # On means plugged in, Off means unplugged
|
||||
'power', # On means power detected, Off means no power
|
||||
'presence', # On means home, Off means away
|
||||
'problem', # On means problem detected, Off means no problem (OK)
|
||||
'safety', # On means unsafe, Off means safe
|
||||
'smoke', # On means smoke detected, Off means no smoke (clear)
|
||||
'sound', # On means sound detected, Off means no sound (clear)
|
||||
'vibration', # On means vibration detected, Off means no vibration
|
||||
'window', # On means open, Off means closed
|
||||
DEVICE_CLASS_BATTERY,
|
||||
DEVICE_CLASS_COLD,
|
||||
DEVICE_CLASS_CONNECTIVITY,
|
||||
DEVICE_CLASS_DOOR,
|
||||
DEVICE_CLASS_GARAGE_DOOR,
|
||||
DEVICE_CLASS_GAS,
|
||||
DEVICE_CLASS_HEAT,
|
||||
DEVICE_CLASS_LIGHT,
|
||||
DEVICE_CLASS_LOCK,
|
||||
DEVICE_CLASS_MOISTURE,
|
||||
DEVICE_CLASS_MOTION,
|
||||
DEVICE_CLASS_MOVING,
|
||||
DEVICE_CLASS_OCCUPANCY,
|
||||
DEVICE_CLASS_OPENING,
|
||||
DEVICE_CLASS_PLUG,
|
||||
DEVICE_CLASS_POWER,
|
||||
DEVICE_CLASS_PRESENCE,
|
||||
DEVICE_CLASS_PROBLEM,
|
||||
DEVICE_CLASS_SAFETY,
|
||||
DEVICE_CLASS_SMOKE,
|
||||
DEVICE_CLASS_SOUND,
|
||||
DEVICE_CLASS_VIBRATION,
|
||||
DEVICE_CLASS_WINDOW,
|
||||
]
|
||||
|
||||
DEVICE_CLASSES_SCHEMA = vol.All(vol.Lower, vol.In(DEVICE_CLASSES))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue