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

Refactor mysensors message handling #17214

Merged
merged 4 commits into from Nov 4, 2018

Conversation

Projects
None yet
3 participants
@MartinHjelmare
Member

MartinHjelmare commented Oct 7, 2018

Description:

  • Add handler module and register handlers per message type or message sub-type. This will allow easier extension of message handling in the future.
  • Move some common functions to a helpers module.
  • Fix inconsistent return.
  • Upgrade pymysensors to 0.18.0 to fix message modification.

Checklist:

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

This comment has been minimized.

Member

MartinHjelmare commented Oct 7, 2018

CC @inetAnt

This should allow you to more easily handle heartbeats. Register a handler of that internal message type in the handler module. Connect an additional callback in the base mysensors entity class and the device tracker platform for node updates.

@MartinHjelmare MartinHjelmare changed the title from WIP: Refactor mysensors message handling to Refactor mysensors message handling Oct 21, 2018

@MartinHjelmare MartinHjelmare force-pushed the MartinHjelmare:refactor-mysensors-msg-handling branch from 4309771 to cf3c015 Oct 21, 2018

@MartinHjelmare

This comment has been minimized.

Member

MartinHjelmare commented Oct 21, 2018

@inetAnt I've now included node callbacks and a node update helper in the handler module. So handling hearbeats should be just registering a new handler and calling the node update handler helper, besides adding hearbeats to device state attributes.

This PR is now tested, so it's ready for review.

MartinHjelmare added some commits Oct 7, 2018

Refactor mysensors message handling
* Add handler module and register handlers per message type or message
  sub-type. This will allow easier extension of message handling in the
  future.
* Move some common functions to a helpers module.
Upgrade pymysensors to 0.18.0
* Fix bug in message modification.

@MartinHjelmare MartinHjelmare force-pushed the MartinHjelmare:refactor-mysensors-msg-handling branch from cf3c015 to 2dfb015 Nov 2, 2018

@amelchio

LGTM

@MartinHjelmare

This comment has been minimized.

Member

MartinHjelmare commented Nov 4, 2018

Thanks!

@MartinHjelmare MartinHjelmare merged commit 9a6c229 into home-assistant:dev Nov 4, 2018

5 checks passed

Hound No violations found. Woof!
WIP ready for review
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 93.065%
Details

@wafflebot wafflebot bot removed the in progress label Nov 4, 2018

@balloob balloob referenced this pull request Nov 29, 2018

Merged

0.83 #18776

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment