available to switchmate (#17640)

This commit is contained in:
Daniel Høyer Iversen 2018-10-21 13:41:27 +02:00 committed by GitHub
parent 9982867d66
commit ef93d48d50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,6 +52,11 @@ class Switchmate(SwitchDevice):
"""Return a unique, HASS-friendly identifier for this entity."""
return self._mac.replace(':', '')
@property
def available(self) -> bool:
"""Return True if entity is available."""
return self._device.available
@property
def name(self) -> str:
"""Return the name of the switch."""