Rachio component modernization (#16911)

Add `unique_id` to all rachio entities
Add platform discovery to rachio component
Move config options from switch.rachio platform to the rachio component
This commit is contained in:
Greg Laabs 2018-09-27 14:17:15 -07:00 committed by Paulus Schoutsen
parent f879ac0993
commit 9abdbf3db6
3 changed files with 38 additions and 17 deletions

View file

@ -92,6 +92,11 @@ class RachioControllerOnlineBinarySensor(RachioControllerBinarySensor):
"""Return the name of this sensor including the controller name."""
return "{} online".format(self._controller.name)
@property
def unique_id(self) -> str:
"""Return a unique id for this entity."""
return "{}-online".format(self._controller.controller_id)
@property
def device_class(self) -> str:
"""Return the class of this device, from component DEVICE_CLASSES."""