Simplify esphome (#22868)

* Add ESPHome climate support

* Adjust line length

* Update .coveragerc

* Update climate.py

* Simplify esphome integration

* Undo change

* Update cover.py
This commit is contained in:
Otto Winter 2019-04-16 22:48:46 +02:00 committed by Paulus Schoutsen
parent 10e8f4f70a
commit 3186109172
9 changed files with 113 additions and 135 deletions

View file

@ -38,7 +38,7 @@ class EsphomeBinarySensor(EsphomeEntity, BinarySensorDevice):
return super()._state
@property
def is_on(self):
def is_on(self) -> Optional[bool]:
"""Return true if the binary sensor is on."""
if self._static_info.is_status_binary_sensor:
# Status binary sensors indicated connected state.
@ -49,12 +49,12 @@ class EsphomeBinarySensor(EsphomeEntity, BinarySensorDevice):
return self._state.state
@property
def device_class(self):
def device_class(self) -> str:
"""Return the class of this device, from component DEVICE_CLASSES."""
return self._static_info.device_class
@property
def available(self):
def available(self) -> bool:
"""Return True if entity is available."""
if self._static_info.is_status_binary_sensor:
return True