Update demo entities
This commit is contained in:
parent
dc2f3861c9
commit
72ebb22eba
3 changed files with 7 additions and 38 deletions
|
@ -9,18 +9,17 @@ from homeassistant.components.binary_sensor import BinarySensorDevice
|
|||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
""" Sets up the Demo binary sensors. """
|
||||
add_devices([
|
||||
DemoBinarySensor('Window Bathroom', True, None),
|
||||
DemoBinarySensor('Floor Basement', False, None),
|
||||
DemoBinarySensor('Basement Floor Wet', False),
|
||||
DemoBinarySensor('Movement Backyard', True),
|
||||
])
|
||||
|
||||
|
||||
class DemoBinarySensor(BinarySensorDevice):
|
||||
""" A Demo binary sensor. """
|
||||
|
||||
def __init__(self, name, state, icon=None):
|
||||
def __init__(self, name, state):
|
||||
self._name = name
|
||||
self._state = state
|
||||
self._icon = icon
|
||||
|
||||
@property
|
||||
def should_poll(self):
|
||||
|
@ -32,11 +31,6 @@ class DemoBinarySensor(BinarySensorDevice):
|
|||
""" Returns the name of the binary sensor. """
|
||||
return self._name
|
||||
|
||||
@property
|
||||
def icon(self):
|
||||
""" Returns the icon to use for device if any. """
|
||||
return self._icon
|
||||
|
||||
@property
|
||||
def is_on(self):
|
||||
""" True if the binary sensor is on. """
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue