From a33b1ae39f663f39548782310ee20fcc89ee0d34 Mon Sep 17 00:00:00 2001 From: Simon Koelsch Date: Sat, 4 Nov 2017 14:03:22 +0100 Subject: [PATCH 1/3] Addition of new binary sensor class 'plug' --- homeassistant/components/binary_sensor/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/homeassistant/components/binary_sensor/__init__.py b/homeassistant/components/binary_sensor/__init__.py index 4ba29e9b2ba96d..986ea1cd758cdc 100644 --- a/homeassistant/components/binary_sensor/__init__.py +++ b/homeassistant/components/binary_sensor/__init__.py @@ -35,6 +35,7 @@ 'smoke', # Smoke detector 'sound', # On means sound detected, Off means no sound 'vibration', # On means vibration detected, Off means no vibration + 'plug', # On means plugged in, Off means plugged off ] DEVICE_CLASSES_SCHEMA = vol.All(vol.Lower, vol.In(DEVICE_CLASSES)) From faf2be9ff53eac105f624fb2eca63f06c21de2fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20K=C3=B6lsch?= Date: Sat, 4 Nov 2017 14:48:18 +0100 Subject: [PATCH 2/3] use term "unplugged" --- homeassistant/components/binary_sensor/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/binary_sensor/__init__.py b/homeassistant/components/binary_sensor/__init__.py index 986ea1cd758cdc..1d6343123e1167 100644 --- a/homeassistant/components/binary_sensor/__init__.py +++ b/homeassistant/components/binary_sensor/__init__.py @@ -35,7 +35,7 @@ 'smoke', # Smoke detector 'sound', # On means sound detected, Off means no sound 'vibration', # On means vibration detected, Off means no vibration - 'plug', # On means plugged in, Off means plugged off + 'plug', # On means plugged in, Off means unplugged ] DEVICE_CLASSES_SCHEMA = vol.All(vol.Lower, vol.In(DEVICE_CLASSES)) From b7e26c31b602b15e9eaf501711d12c62325877a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20K=C3=B6lsch?= Date: Sat, 4 Nov 2017 15:04:05 +0100 Subject: [PATCH 3/3] add the entry to the right place --- homeassistant/components/binary_sensor/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/binary_sensor/__init__.py b/homeassistant/components/binary_sensor/__init__.py index 1d6343123e1167..baf9c41cfdfc91 100644 --- a/homeassistant/components/binary_sensor/__init__.py +++ b/homeassistant/components/binary_sensor/__init__.py @@ -30,12 +30,12 @@ 'moving', # On means moving, Off means stopped 'occupancy', # On means occupied, Off means not occupied 'opening', # Door, window, etc. + 'plug', # On means plugged in, Off means unplugged 'power', # Power, over-current, etc 'safety', # Generic on=unsafe, off=safe 'smoke', # Smoke detector 'sound', # On means sound detected, Off means no sound 'vibration', # On means vibration detected, Off means no vibration - 'plug', # On means plugged in, Off means unplugged ] DEVICE_CLASSES_SCHEMA = vol.All(vol.Lower, vol.In(DEVICE_CLASSES))