Skip to content

Conversation

andythigpen
Copy link
Collaborator

I apologize in advance for the number of commits in this pull request. I probably should have broken this up into many smaller ones instead...

The major changes include:

  • Refactor to remove (most) pylint/flake8 warnings.
  • Switch to using enums instead of arrays of strings in const.py.
  • Simplify the logic in some areas.
  • Break the unit tests into smaller individual tests.
  • Add support for reconnecting to the serial port during operation -- for instance, if you unplug it and then plug it back in.
  • Add support for multiple values for a child sensor.
  • Move all the code into its own module -- this might make it easier to package for pypi in the future.

I'll send you a separate pull request for the HA component changes so you can review/test those out before we try merge them into the main repo.

Breaks single unit tests into self smaller tests.
Each message type is processed in a separate function.
Reformats comments into docstrings and refactors the implementation of a
few minor classes/functions.
Message stores values as int which can be easily compared with IntEnums
instead of strings.
Responses typically share most of the same fields, but with the payload
and sub_types sometimes changed.  The copy function will return a new
message with the same fields, optionally overridden by keyword arguments
to the function.
@theolind
Copy link
Owner

theolind commented Apr 7, 2015

Awesome. I have looked through the code and tested it. Great updates! Don't worry about the number of commits :). Will merge now. Many thanks!

@theolind theolind merged commit 75e0f50 into theolind:master Apr 7, 2015
@andythigpen andythigpen deleted the improvements branch May 15, 2015 00:40
exxamalte pushed a commit to exxamalte/pymysensors that referenced this pull request Feb 10, 2017
check socket status before shutdown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants