Next generation of Xiaomi Aqara devices added (#12659)

* Next generation of Xiaomi Aqara devices added: ctrl_neutral1.aq1, ctrl_neutral2.aq1, ctrl_ln1.aq1, ctrl_ln2.aq1, ctrl_86plug.aq1

* The Aqara wireless button (3rd gen, sensor_switch.aq3) supports a click_type called "shake".

* Warning added to spot new features.
pull/10717/head
Sebastian Muszynski 2018-02-26 21:54:06 +01:00 committed by Daniel Høyer Iversen
parent f8a0a0ba59
commit 2c1083bda1
4 changed files with 10 additions and 7 deletions

View File

@ -319,7 +319,10 @@ class XiaomiButton(XiaomiBinarySensor):
click_type = 'double'
elif value == 'both_click':
click_type = 'both'
elif value == 'shake':
click_type = 'shake'
else:
_LOGGER.warning("Unsupported click_type detected: %s", value)
return False
self._hass.bus.fire('click', {

View File

@ -28,22 +28,22 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
if model == 'plug':
devices.append(XiaomiGenericSwitch(device, "Plug", 'status',
True, gateway))
elif model == 'ctrl_neutral1':
elif model in ['ctrl_neutral1', 'ctrl_neutral1.aq1']:
devices.append(XiaomiGenericSwitch(device, 'Wall Switch',
'channel_0',
False, gateway))
elif model == 'ctrl_ln1':
elif model in ['ctrl_ln1', 'ctrl_ln1.aq1']:
devices.append(XiaomiGenericSwitch(device, 'Wall Switch LN',
'channel_0',
False, gateway))
elif model == 'ctrl_neutral2':
elif model in ['ctrl_neutral2', 'ctrl_neutral2.aq1']:
devices.append(XiaomiGenericSwitch(device, 'Wall Switch Left',
'channel_0',
False, gateway))
devices.append(XiaomiGenericSwitch(device, 'Wall Switch Right',
'channel_1',
False, gateway))
elif model == 'ctrl_ln2':
elif model in ['ctrl_ln2', 'ctrl_ln2.aq1']:
devices.append(XiaomiGenericSwitch(device,
'Wall Switch LN Left',
'channel_0',
@ -52,7 +52,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
'Wall Switch LN Right',
'channel_1',
False, gateway))
elif model == '86plug':
elif model in ['86plug', 'ctrl_86plug.aq1']:
devices.append(XiaomiGenericSwitch(device, 'Wall Plug',
'status', True, gateway))
add_devices(devices)

View File

@ -23,7 +23,7 @@ from homeassistant.helpers.event import async_track_point_in_utc_time
from homeassistant.util.dt import utcnow
from homeassistant.util import slugify
REQUIREMENTS = ['PyXiaomiGateway==0.8.1']
REQUIREMENTS = ['PyXiaomiGateway==0.8.2']
_LOGGER = logging.getLogger(__name__)

View File

@ -39,7 +39,7 @@ PyMVGLive==1.1.4
PyMata==2.14
# homeassistant.components.xiaomi_aqara
PyXiaomiGateway==0.8.1
PyXiaomiGateway==0.8.2
# homeassistant.components.rpi_gpio
# RPi.GPIO==0.6.1