Skip to content

Add Support for Xiaomi Vibration Sensor#16422

Merged
syssi merged 22 commits intohome-assistant:devfrom
dlashua:xiaomiVibration
Oct 8, 2018
Merged

Add Support for Xiaomi Vibration Sensor#16422
syssi merged 22 commits intohome-assistant:devfrom
dlashua:xiaomiVibration

Conversation

@dlashua
Copy link
Copy Markdown
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
Copy Markdown
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!

value = data.get(self._data_key)
if value is None:
return False
if self._data_key in ['coordination','status']:
Copy link
Copy Markdown

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))
Copy link
Copy Markdown

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))
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

@Danielhiversen Danielhiversen Sep 4, 2018

Choose a reason for hiding this comment

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

Remove

@dlashua
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

balloob commented Sep 25, 2018

@Danielhiversen can this be merged?

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

10 participants