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

Add Support for Xiaomi Vibration Sensor #16422

Merged
merged 22 commits into from Oct 8, 2018

Conversation

dlashua
Copy link
Contributor

@dlashua dlashua commented Sep 4, 2018

Description:

Adds support for Xiaomi Vibration Sensor

Example entry for configuration.yaml (if applicable):

n/a auto discovered

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@homeassistant
Copy link
Contributor

Hi @dlashua,

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!

@@ -84,6 +94,9 @@ def parse_data(self, data, raw_data):
value = data.get(self._data_key)
if value is None:
return False
if self._data_key in ['coordination','status']:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing whitespace after ','

devices.append(XiaomiSensor(device, 'Tilt Angle',
'final_tilt_angle',gateway))
devices.append(XiaomiSensor(device, 'Coordination',
'coordination', gateway))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing whitespace

devices.append(XiaomiSensor(device, 'Bed Activity',
'bed_activity', gateway))
devices.append(XiaomiSensor(device, 'Tilt Angle',
'final_tilt_angle',gateway))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing whitespace after ','

@homeassistant
Copy link
Contributor

Hi @dlashua,

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!

@homeassistant
Copy link
Contributor

Hi @dlashua,

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!

@homeassistant
Copy link
Contributor

Hi @dlashua,

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!

@dlashua
Copy link
Contributor Author

dlashua commented Sep 4, 2018

Travis CI is failing because of the use of _LOGGER.warn(). This code was not modified by me. It must not have been converted to whatever the new method is.

'coordination', gateway))
else:
_LOGGER.warn("Unmapped Device Model ")
_LOGGER.warn(device)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

@dlashua
Copy link
Contributor Author

dlashua commented Sep 6, 2018

Documentation PR has been submitted ( home-assistant/home-assistant.io#6207 ).

Please note, this requires an updated version of PyXiaomiGateway (PR already submitted Danielhiversen/PyXiaomiGateway#89 ). This will likely result in a verison number increase of that library which means the REQUIREMENTS on this component will also need to increment.

Copy link
Member

@Danielhiversen Danielhiversen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@balloob
Copy link
Member

balloob commented Sep 25, 2018

@Danielhiversen can this be merged?

Copy link
Member

@syssi syssi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just the documentation isn't ready.

@ghost ghost assigned syssi Oct 8, 2018
@syssi syssi merged commit 71a0274 into home-assistant:dev Oct 8, 2018
@ghost ghost removed the in progress label Oct 8, 2018
@PaulAnnekov
Copy link
Contributor

@dlashua I often get a WARNING (MainThread) [homeassistant.components.binary_sensor.xiaomi_aqara] Unsupported movement_type detected: None warning, when rotating sensor. I think, that's because status field is not always present, e.g. sometimes I see messages like this: [xiaomi_gateway] MCAST (report) << {'cmd': 'report', 'model': 'vibration', 'sid': '158d0002a239d9', 'short_id': 53265, 'data': '{"coordination":"75,15,-702"}'}.

@MartinHjelmare
Copy link
Member

@PaulAnnekov please open an issue.

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Oct 13, 2018
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

10 participants