Skip to content
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

Merged
merged 8 commits into from Jul 21, 2017

Conversation

syssi
Copy link
Member

@syssi syssi commented Jul 20, 2017

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.

@mention-bot
Copy link

@syssi, thanks for your PR! By analyzing the history of the files in this pull request, we identified @Danielhiversen to be a potential reviewer.

@homeassistant
Copy link
Contributor

Hi @syssi,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

devices.append(XiaomiGenericSwitch(device, 'Wall Switch LN Left',
'channel_0',
False, gateway))
devices.append(XiaomiGenericSwitch(device, 'Wall Switch LN Right',

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',

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)

@@ -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()
Copy link
Member

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

Copy link
Member Author

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.

@Danielhiversen
Copy link
Member

Could you make sure the new devices are added to the docs: home-assistant/home-assistant.io#3028

I also think documentation for play_ringtone_service is missing.

@syssi
Copy link
Member Author

syssi commented Jul 21, 2017

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.

@Danielhiversen Danielhiversen merged commit fada6d3 into home-assistant:dev Jul 21, 2017
@balloob balloob mentioned this pull request Jul 29, 2017
dethpickle pushed a commit to dethpickle/home-assistant that referenced this pull request Aug 18, 2017
…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.
@home-assistant home-assistant locked and limited conversation to collaborators Oct 20, 2017
@ghost ghost removed the platform: switch.xiaomi label Mar 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants