Skip to content

Conversation

MartinHjelmare
Copy link
Collaborator

Bump version to 0.6.

Br3nda and others added 21 commits March 11, 2016 01:53
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 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.
* 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.
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.
@MartinHjelmare MartinHjelmare merged commit cc5d0b3 into theolind:master Apr 19, 2016
@MartinHjelmare MartinHjelmare deleted the 0.6 branch May 23, 2016 17:52
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