Xiaomi Aqara: New xiaomi wireless button (sensor_switch.aq3) introduced (#10008)

* New xiaomi wireless button (sensor_switch.aq3) introduced.

* The next version of PyXiaomiGateway (0.5.3) is needed.
This commit is contained in:
Sebastian Muszynski 2017-10-22 11:02:01 +02:00 committed by Daniel Høyer Iversen
parent 9d39a5ced3
commit c08c8c7996
3 changed files with 5 additions and 12 deletions

View file

@ -25,13 +25,9 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
for (_, gateway) in hass.data[PY_XIAOMI_GATEWAY].gateways.items():
for device in gateway.devices['binary_sensor']:
model = device['model']
if model == 'motion':
if model in ['motion', 'sensor_motion.aq2']:
devices.append(XiaomiMotionSensor(device, hass, gateway))
elif model == 'sensor_motion.aq2':
devices.append(XiaomiMotionSensor(device, hass, gateway))
elif model == 'magnet':
devices.append(XiaomiDoorSensor(device, gateway))
elif model == 'sensor_magnet.aq2':
elif model in ['magnet', 'sensor_magnet.aq2']:
devices.append(XiaomiDoorSensor(device, gateway))
elif model == 'sensor_wleak.aq1':
devices.append(XiaomiWaterLeakSensor(device, gateway))
@ -39,10 +35,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
devices.append(XiaomiSmokeSensor(device, gateway))
elif model == 'natgas':
devices.append(XiaomiNatgasSensor(device, gateway))
elif model == 'switch':
devices.append(XiaomiButton(device, 'Switch', 'status',
hass, gateway))
elif model == 'sensor_switch.aq2':
elif model in ['switch', 'sensor_switch.aq2', 'sensor_switch.aq3']:
devices.append(XiaomiButton(device, 'Switch', 'status',
hass, gateway))
elif model == '86sw1':

View file

@ -8,7 +8,7 @@ from homeassistant.components.discovery import SERVICE_XIAOMI_GW
from homeassistant.const import (ATTR_BATTERY_LEVEL, EVENT_HOMEASSISTANT_STOP,
CONF_MAC, CONF_HOST, CONF_PORT)
REQUIREMENTS = ['PyXiaomiGateway==0.5.2']
REQUIREMENTS = ['PyXiaomiGateway==0.5.3']
ATTR_GW_MAC = 'gw_mac'
ATTR_RINGTONE_ID = 'ringtone_id'

View file

@ -37,7 +37,7 @@ PyMVGLive==1.1.4
PyMata==2.14
# homeassistant.components.xiaomi_aqara
PyXiaomiGateway==0.5.2
PyXiaomiGateway==0.5.3
# homeassistant.components.rpi_gpio
# RPi.GPIO==0.6.1