* First draft * Generate device id * No obscure registry * Dont store config_entry_id in device * Storage * Small mistake on rebase * Do storage more like entity registry * Improve device identification * Add tests * Remove deconz device support from PR * Fix hound comments, voff! * Fix comments and clean up * Fix proper indentation * Fix pydoc issues * Fix mochad component to not use self.device * Fix mochad light platform to not use self.device * Fix TankUtilitySensor to not use self.device * Fix Soundtouch to not use self.device * Fix Plex to not use self.device * Fix Emby to not use self.device * Fix Heatmiser to not use self.device * Fix Wemo lights to not use self.device * Fix Lifx to not use self.device * Fix Radiotherm to not use self.device * Fix Juicenet to not use self.device * Fix Qwikswitch to not use self.device * Fix Xiaomi miio to not use self.device * Fix Nest to not use self.device * Fix Tellduslive to not use self.device * Fix Knx to not use self.device * Clean up a small mistake in soundtouch * Fix comment from Ballob * Fix bad indentation * Fix indentatin * Lint * Remove unused variable * Lint
34 lines
935 B
Python
34 lines
935 B
Python
"""
|
|
Support for binary sensors using Tellstick Net.
|
|
|
|
This platform uses the Telldus Live online service.
|
|
|
|
For more details about this platform, please refer to the documentation at
|
|
https://home-assistant.io/components/binary_sensor.tellduslive/
|
|
|
|
"""
|
|
import logging
|
|
|
|
from homeassistant.components.tellduslive import TelldusLiveEntity
|
|
from homeassistant.components.binary_sensor import BinarySensorDevice
|
|
|
|
_LOGGER = logging.getLogger(__name__)
|
|
|
|
|
|
def setup_platform(hass, config, add_devices, discovery_info=None):
|
|
"""Set up Tellstick sensors."""
|
|
if discovery_info is None:
|
|
return
|
|
add_devices(
|
|
TelldusLiveSensor(hass, binary_sensor)
|
|
for binary_sensor in discovery_info
|
|
)
|
|
|
|
|
|
class TelldusLiveSensor(TelldusLiveEntity, BinarySensorDevice):
|
|
"""Representation of a Tellstick sensor."""
|
|
|
|
@property
|
|
def is_on(self):
|
|
"""Return true if switch is on."""
|
|
return self._device.is_on
|