New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Device support for different new sensors of the xiaomi aqara gateway #8577
Device support for different new sensors of the xiaomi aqara gateway #8577
Conversation
…ercase already. The ringtone services accepts the same values now. I hope it will avoid confusion.
… ctrl_ln2) added.
@syssi, thanks for your PR! By analyzing the history of the files in this pull request, we identified @Danielhiversen to be a potential reviewer. |
devices.append(XiaomiGenericSwitch(device, 'Wall Switch LN Left', | ||
'channel_0', | ||
False, gateway)) | ||
devices.append(XiaomiGenericSwitch(device, 'Wall Switch LN Right', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (82 > 79 characters)
elif model == 'ctrl_neutral2': | ||
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': | ||
devices.append(XiaomiGenericSwitch(device, 'Wall Switch LN Left', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (81 > 79 characters)
homeassistant/components/xiaomi.py
Outdated
@@ -107,7 +107,7 @@ def play_ringtone_service(call): | |||
else: | |||
ringtone = {'mid': ring_id, 'vol': int(ring_vol)} | |||
|
|||
gw_sid = call.data.get(ATTR_GW_SID) | |||
gw_sid = call.data.get(ATTR_GW_SID).replace(":", "").lower() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should replace ATTR_GW_SID with ATTR_GW_MAC, since we are using mac in the config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refactored the part a bit and updated the parameter.
Could you make sure the new devices are added to the docs: home-assistant/home-assistant.io#3028 I also think documentation for |
The new devices are already mentioned at https://github.com/home-assistant/home-assistant.github.io/pull/3028/files. Jonatan used a very recent version of the README.md as starting point. |
…ome-assistant#8577) * The gateway configuration accepts a MAC address or a SID value in uppercase already. The ringtone services accepts the same values now. I hope it will avoid confusion. * Device support for the new wall switches with neutral lead (ctrl_ln1, ctrl_ln2) added. * Measurement unit from pressure of weather.v1 fixed. * Device support for sensor_magnet.aq2 added. * Device support for sensor_motion.aq2 (motion and lux) added. * Code reformatted. * The ringtone service (start/stop) uses the parameter gw_mac instead of gw_sid now. * Version of the required library updated.
Description:
This PR adds the device support for a few new sensors of the xiaomi aqara gateway (sensor_motion.aq2, sensor_magnet.aq2, ctrl_ln1, ctrl_ln2). The sensors will be auto-discovered and doesn't need configuration. Some minor issues of the recently merged component will be fixed also.