mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +00:00
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:
parent
9d39a5ced3
commit
c08c8c7996
@ -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 (_, gateway) in hass.data[PY_XIAOMI_GATEWAY].gateways.items():
|
||||||
for device in gateway.devices['binary_sensor']:
|
for device in gateway.devices['binary_sensor']:
|
||||||
model = device['model']
|
model = device['model']
|
||||||
if model == 'motion':
|
if model in ['motion', 'sensor_motion.aq2']:
|
||||||
devices.append(XiaomiMotionSensor(device, hass, gateway))
|
devices.append(XiaomiMotionSensor(device, hass, gateway))
|
||||||
elif model == 'sensor_motion.aq2':
|
elif model in ['magnet', 'sensor_magnet.aq2']:
|
||||||
devices.append(XiaomiMotionSensor(device, hass, gateway))
|
|
||||||
elif model == 'magnet':
|
|
||||||
devices.append(XiaomiDoorSensor(device, gateway))
|
|
||||||
elif model == 'sensor_magnet.aq2':
|
|
||||||
devices.append(XiaomiDoorSensor(device, gateway))
|
devices.append(XiaomiDoorSensor(device, gateway))
|
||||||
elif model == 'sensor_wleak.aq1':
|
elif model == 'sensor_wleak.aq1':
|
||||||
devices.append(XiaomiWaterLeakSensor(device, gateway))
|
devices.append(XiaomiWaterLeakSensor(device, gateway))
|
||||||
@ -39,10 +35,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||||||
devices.append(XiaomiSmokeSensor(device, gateway))
|
devices.append(XiaomiSmokeSensor(device, gateway))
|
||||||
elif model == 'natgas':
|
elif model == 'natgas':
|
||||||
devices.append(XiaomiNatgasSensor(device, gateway))
|
devices.append(XiaomiNatgasSensor(device, gateway))
|
||||||
elif model == 'switch':
|
elif model in ['switch', 'sensor_switch.aq2', 'sensor_switch.aq3']:
|
||||||
devices.append(XiaomiButton(device, 'Switch', 'status',
|
|
||||||
hass, gateway))
|
|
||||||
elif model == 'sensor_switch.aq2':
|
|
||||||
devices.append(XiaomiButton(device, 'Switch', 'status',
|
devices.append(XiaomiButton(device, 'Switch', 'status',
|
||||||
hass, gateway))
|
hass, gateway))
|
||||||
elif model == '86sw1':
|
elif model == '86sw1':
|
||||||
|
@ -8,7 +8,7 @@ from homeassistant.components.discovery import SERVICE_XIAOMI_GW
|
|||||||
from homeassistant.const import (ATTR_BATTERY_LEVEL, EVENT_HOMEASSISTANT_STOP,
|
from homeassistant.const import (ATTR_BATTERY_LEVEL, EVENT_HOMEASSISTANT_STOP,
|
||||||
CONF_MAC, CONF_HOST, CONF_PORT)
|
CONF_MAC, CONF_HOST, CONF_PORT)
|
||||||
|
|
||||||
REQUIREMENTS = ['PyXiaomiGateway==0.5.2']
|
REQUIREMENTS = ['PyXiaomiGateway==0.5.3']
|
||||||
|
|
||||||
ATTR_GW_MAC = 'gw_mac'
|
ATTR_GW_MAC = 'gw_mac'
|
||||||
ATTR_RINGTONE_ID = 'ringtone_id'
|
ATTR_RINGTONE_ID = 'ringtone_id'
|
||||||
|
@ -37,7 +37,7 @@ PyMVGLive==1.1.4
|
|||||||
PyMata==2.14
|
PyMata==2.14
|
||||||
|
|
||||||
# homeassistant.components.xiaomi_aqara
|
# homeassistant.components.xiaomi_aqara
|
||||||
PyXiaomiGateway==0.5.2
|
PyXiaomiGateway==0.5.3
|
||||||
|
|
||||||
# homeassistant.components.rpi_gpio
|
# homeassistant.components.rpi_gpio
|
||||||
# RPi.GPIO==0.6.1
|
# RPi.GPIO==0.6.1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user