Skip to content

Commit

Permalink
Add Xiaomi Aqara wireless and light switches (2020 model) (#37985)
Browse files Browse the repository at this point in the history
  • Loading branch information
chewbh committed Aug 5, 2020
1 parent c0c30bb commit 3fc5f9d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions homeassistant/components/xiaomi_aqara/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
"sensor_86sw1",
"sensor_86sw1.aq1",
"remote.b186acn01",
"remote.b186acn02",
]:
if "proto" not in entity or int(entity["proto"][0:1]) == 1:
data_key = "channel_0"
Expand All @@ -72,6 +73,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
"sensor_86sw2",
"sensor_86sw2.aq1",
"remote.b286acn01",
"remote.b286acn02",
]:
if "proto" not in entity or int(entity["proto"][0:1]) == 1:
data_key_left = "channel_0"
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/xiaomi_aqara/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Xiaomi Gateway (Aqara)",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/xiaomi_aqara",
"requirements": ["PyXiaomiGateway==0.12.4"],
"requirements": ["PyXiaomiGateway==0.13.2"],
"after_dependencies": ["discovery"],
"codeowners": ["@danielhiversen", "@syssi"],
"zeroconf": ["_miio._udp.local."]
Expand Down
8 changes: 4 additions & 4 deletions homeassistant/components/xiaomi_aqara/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
device, "Plug", data_key, True, gateway, config_entry
)
)
elif model in ["ctrl_neutral1", "ctrl_neutral1.aq1"]:
elif model in ["ctrl_neutral1", "ctrl_neutral1.aq1", "switch_b1lacn02"]:
entities.append(
XiaomiGenericSwitch(
device, "Wall Switch", "channel_0", False, gateway, config_entry
)
)
elif model in ["ctrl_ln1", "ctrl_ln1.aq1"]:
elif model in ["ctrl_ln1", "ctrl_ln1.aq1", "switch_b1nacn02"]:
entities.append(
XiaomiGenericSwitch(
device, "Wall Switch LN", "channel_0", False, gateway, config_entry
)
)
elif model in ["ctrl_neutral2", "ctrl_neutral2.aq1"]:
elif model in ["ctrl_neutral2", "ctrl_neutral2.aq1", "switch_b2lacn02"]:
entities.append(
XiaomiGenericSwitch(
device,
Expand All @@ -70,7 +70,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
config_entry,
)
)
elif model in ["ctrl_ln2", "ctrl_ln2.aq1"]:
elif model in ["ctrl_ln2", "ctrl_ln2.aq1", "switch_b2nacn02"]:
entities.append(
XiaomiGenericSwitch(
device,
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ PyTurboJPEG==1.4.0
PyViCare==0.2.0

# homeassistant.components.xiaomi_aqara
PyXiaomiGateway==0.12.4
PyXiaomiGateway==0.13.2

# homeassistant.components.bmp280
# homeassistant.components.mcp23017
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ PyTransportNSW==0.1.1
PyTurboJPEG==1.4.0

# homeassistant.components.xiaomi_aqara
PyXiaomiGateway==0.12.4
PyXiaomiGateway==0.13.2

# homeassistant.components.remember_the_milk
RtmAPI==0.7.2
Expand Down

0 comments on commit 3fc5f9d

Please sign in to comment.