Remove binary sensor platforms implementing state property (#7371)

* Remove binary sensor platforms implementing state property

* Fix workday inheritance
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2017-04-29 20:36:50 -07:00
1 parent 55731b759f
commit ce3d8be72b
2 files changed
+10 -20

No files matched your search

@@ -9,8 +9,7 @@ import logging
import requests
import voluptuous as vol
from homeassistant.const import (
CONF_NAME, STATE_ON, STATE_OFF, CONF_MONITORED_CONDITIONS)
from homeassistant.const import CONF_NAME, CONF_MONITORED_CONDITIONS
from homeassistant.components.binary_sensor import (
BinarySensorDevice, PLATFORM_SCHEMA)
from homeassistant.loader import get_component
@@ -85,18 +84,10 @@ class OctoPrintBinarySensor(BinarySensorDevice):
"""Return the name of the sensor."""
return self._name
@property
def state(self):
"""Return the state of the sensor."""
return self.is_on
@property
def is_on(self):
"""Return true if binary sensor is on."""
if self._state:
return STATE_ON
else:
return STATE_OFF
return bool(self._state)
@property
def device_class(self):