-
Notifications
You must be signed in to change notification settings - Fork 44
0.6 #42
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
Merged
Merged
0.6 #42
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
don't let exceptions in event callback bubble up into library.
For continuous integration on Travis-CI
* Rename test.py for pytest compatability.
* Update sensor data structure. * Add example about sending new values to node, using Gateway.set_child_value. * Clarify how persistence can be set. * Add travis build badge.
Rename tests/test.py to tests/test_mysensors.py
* Add Sensor.protocol_version to json encoder. * Update tests to test for protocol_version after json encoding/decoding.
Add protocol_version to json encoder
Update readme and main.py
* Add tox.ini to use with tox. Install tox and run tox, to run tests in specified environments, currently python3.4 and python3.5. Linting tests use pylint and flake8. Use more python envs on Travis, python3.5-dev and nightly. * Add requirements_test.txt for use in tox. * Add pylintrc to use with pylint. * Add setup.cfg and flake8 section for use with flake8. * Make tests a proper python package directory, to make pydocstyle run. * Fix lint errors in mysensors.py. * Update .travis.yml to use the new tox environments and run tox.
Add test env, local and travis
* Use is_sensor to to see if node exists, before adding child to node. * If node is None, log error and return. * Add unit test for none presented node.
* Add try... except ValueError to decode and encode methods in Message class. Remove the corresponding try... except statements in run method in SerialGateway class. Also add try... except ValueError in logic method to handle raised ValueError in Message.decode method. * Move statements out of try... except blocks that don't need to be there, to not catch things blindly. * Add guard clause to send method in SerialGateway class. * Fix PEP issues. * Add unit tests.
Handle error for unknown node during presentation
* Save persistence file: 1. Save persistence file in temporary file. 2. Flush temporary file handle and sync buffer to disk. 3. Rename persistence file to backup file. 4. Rename temporary file to persistence file. 5. Remove backup file. * Load persistence file: 1. Try loading persistence file. 2. If the above failes, try renaming backup file to persistence file and load that file. If parsing the file failes, remove file. 3. If the above failes, log warning that loading sensors from file failed. * Change log levels in save and load sensors functions.
Move except statements upstream
Add safe saving and loading of persistence file
This adds a gateway class for tcp socket. Arguments to the class are similar to the serial gateway class. The first argument is a positional argument called host. Specify the host ip address there. A keyword argument called port is used for specifying the port of the connection. The rest of the arguments are named exactly the same and used in a similar fashion. * Add TCPGateway child class to Gateway class. * Use non blocking socket and blocking select. * Blocking with select should return the socket ready for either reading or writing instantly. * Use socket.SHUT_WR when shutting down socket. * Update main.py with example of TCP gateway. * Use socket.create_connection instead of creating the socket separately and then connecting it. * Only handle queue if there's a socket available for writing in TCPGateway. * Use correct socket exceptions. * Add lock to TCPGateway send method. * Add short sleep to while loop in run method for TCPGateway class to avoid CPU burning at 100%. * Change logging level from exception to error in connect methods. * Add check that socket is not None before trying to read or write to it. * Stop thread before disconnecting socket. * Put disconnect call at end of run method in TCPGateway class. This makes sure the while loop is finished before disconnecting and avoids errors in socket methods when stopping thread.
Add TCP ethernet gateway
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bump version to 0.6.