mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
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.
This commit is contained in:
parent
f8a0a0ba59
commit
2c1083bda1
@ -319,7 +319,10 @@ class XiaomiButton(XiaomiBinarySensor):
|
|||||||
click_type = 'double'
|
click_type = 'double'
|
||||||
elif value == 'both_click':
|
elif value == 'both_click':
|
||||||
click_type = 'both'
|
click_type = 'both'
|
||||||
|
elif value == 'shake':
|
||||||
|
click_type = 'shake'
|
||||||
else:
|
else:
|
||||||
|
_LOGGER.warning("Unsupported click_type detected: %s", value)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
self._hass.bus.fire('click', {
|
self._hass.bus.fire('click', {
|
||||||
|
@ -28,22 +28,22 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||||||
if model == 'plug':
|
if model == 'plug':
|
||||||
devices.append(XiaomiGenericSwitch(device, "Plug", 'status',
|
devices.append(XiaomiGenericSwitch(device, "Plug", 'status',
|
||||||
True, gateway))
|
True, gateway))
|
||||||
elif model == 'ctrl_neutral1':
|
elif model in ['ctrl_neutral1', 'ctrl_neutral1.aq1']:
|
||||||
devices.append(XiaomiGenericSwitch(device, 'Wall Switch',
|
devices.append(XiaomiGenericSwitch(device, 'Wall Switch',
|
||||||
'channel_0',
|
'channel_0',
|
||||||
False, gateway))
|
False, gateway))
|
||||||
elif model == 'ctrl_ln1':
|
elif model in ['ctrl_ln1', 'ctrl_ln1.aq1']:
|
||||||
devices.append(XiaomiGenericSwitch(device, 'Wall Switch LN',
|
devices.append(XiaomiGenericSwitch(device, 'Wall Switch LN',
|
||||||
'channel_0',
|
'channel_0',
|
||||||
False, gateway))
|
False, gateway))
|
||||||
elif model == 'ctrl_neutral2':
|
elif model in ['ctrl_neutral2', 'ctrl_neutral2.aq1']:
|
||||||
devices.append(XiaomiGenericSwitch(device, 'Wall Switch Left',
|
devices.append(XiaomiGenericSwitch(device, 'Wall Switch Left',
|
||||||
'channel_0',
|
'channel_0',
|
||||||
False, gateway))
|
False, gateway))
|
||||||
devices.append(XiaomiGenericSwitch(device, 'Wall Switch Right',
|
devices.append(XiaomiGenericSwitch(device, 'Wall Switch Right',
|
||||||
'channel_1',
|
'channel_1',
|
||||||
False, gateway))
|
False, gateway))
|
||||||
elif model == 'ctrl_ln2':
|
elif model in ['ctrl_ln2', 'ctrl_ln2.aq1']:
|
||||||
devices.append(XiaomiGenericSwitch(device,
|
devices.append(XiaomiGenericSwitch(device,
|
||||||
'Wall Switch LN Left',
|
'Wall Switch LN Left',
|
||||||
'channel_0',
|
'channel_0',
|
||||||
@ -52,7 +52,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||||||
'Wall Switch LN Right',
|
'Wall Switch LN Right',
|
||||||
'channel_1',
|
'channel_1',
|
||||||
False, gateway))
|
False, gateway))
|
||||||
elif model == '86plug':
|
elif model in ['86plug', 'ctrl_86plug.aq1']:
|
||||||
devices.append(XiaomiGenericSwitch(device, 'Wall Plug',
|
devices.append(XiaomiGenericSwitch(device, 'Wall Plug',
|
||||||
'status', True, gateway))
|
'status', True, gateway))
|
||||||
add_devices(devices)
|
add_devices(devices)
|
||||||
|
@ -23,7 +23,7 @@ from homeassistant.helpers.event import async_track_point_in_utc_time
|
|||||||
from homeassistant.util.dt import utcnow
|
from homeassistant.util.dt import utcnow
|
||||||
from homeassistant.util import slugify
|
from homeassistant.util import slugify
|
||||||
|
|
||||||
REQUIREMENTS = ['PyXiaomiGateway==0.8.1']
|
REQUIREMENTS = ['PyXiaomiGateway==0.8.2']
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ PyMVGLive==1.1.4
|
|||||||
PyMata==2.14
|
PyMata==2.14
|
||||||
|
|
||||||
# homeassistant.components.xiaomi_aqara
|
# homeassistant.components.xiaomi_aqara
|
||||||
PyXiaomiGateway==0.8.1
|
PyXiaomiGateway==0.8.2
|
||||||
|
|
||||||
# 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