Add iaqualink binary sensor and unique_id (#26616)

* Add binary_platform to iaqualink integration, add unique_id

* Revert Mixin changes, move self.dev to AqualinkEntity

* Style fixes
This commit is contained in:
Florent Thoumie 2019-09-13 22:05:47 -07:00 committed by Martin Hjelmare
parent bca7363a80
commit a71cd6e90e
7 changed files with 74 additions and 31 deletions

View file

@ -1,8 +1,6 @@
"""Support for Aqualink pool feature switches."""
import logging
from iaqualink import AqualinkToggle
from homeassistant.components.switch import DOMAIN, SwitchDevice
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType
@ -25,13 +23,9 @@ async def async_setup_entry(
async_add_entities(devs, True)
class HassAqualinkSwitch(SwitchDevice, AqualinkEntity):
class HassAqualinkSwitch(AqualinkEntity, SwitchDevice):
"""Representation of a switch."""
def __init__(self, dev: AqualinkToggle):
"""Initialize the switch."""
self.dev = dev
@property
def name(self) -> str:
"""Return the name of the switch."""