Wink AC and addidtional sensor support (#5670)
* Added door bell sensors * Initial support for AC units. * Added new device service * Quirky Aros AC unit support * Use super() everywhere and error checking for token request. * Ignore camera sensors during setup of alarms. * Added manufacturer/device attributes to all wink devices. * Fixed style errors * Fixed remaining lint errors.
This commit is contained in:
parent
b5f285a789
commit
80a794e587
11 changed files with 361 additions and 88 deletions
|
@ -11,7 +11,7 @@ from homeassistant.const import (STATE_UNKNOWN,
|
|||
STATE_ALARM_DISARMED,
|
||||
STATE_ALARM_ARMED_HOME,
|
||||
STATE_ALARM_ARMED_AWAY)
|
||||
from homeassistant.components.wink import WinkDevice
|
||||
from homeassistant.components.wink import WinkDevice, DOMAIN
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -24,7 +24,14 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
import pywink
|
||||
|
||||
for camera in pywink.get_cameras():
|
||||
add_devices([WinkCameraDevice(camera, hass)])
|
||||
# get_cameras returns multiple device types.
|
||||
# Only add those that aren't sensors.
|
||||
try:
|
||||
camera.capability()
|
||||
except AttributeError:
|
||||
_id = camera.object_id() + camera.name()
|
||||
if _id not in hass.data[DOMAIN]['unique_ids']:
|
||||
add_devices([WinkCameraDevice(camera, hass)])
|
||||
|
||||
|
||||
class WinkCameraDevice(WinkDevice, alarm.AlarmControlPanel):
|
||||
|
@ -32,7 +39,7 @@ class WinkCameraDevice(WinkDevice, alarm.AlarmControlPanel):
|
|||
|
||||
def __init__(self, wink, hass):
|
||||
"""Initialize the Wink alarm."""
|
||||
WinkDevice.__init__(self, wink, hass)
|
||||
super().__init__(wink, hass)
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue