Skip to content

Conversation

MartinHjelmare
Copy link
Collaborator

@MartinHjelmare MartinHjelmare commented Mar 25, 2017

BREAKING CHANGES

  • Changed arguments that are passed when calling event callback. Old arguments
    were a fixed string 'sensor_update' and an integer for node id, from the node
    that was updated. Now only the message instance is passed as a single
    argument. The message instance has the following attributes:
    Message
      gateway - the gateway instance
      node_id - the sensor node identifier (int)
      child_id - the child sensor id (int)
      type - the message type (int)
      ack - True if message was an ACK, false otherwise (int)
      sub_type - the message sub_type (int)
      payload - the payload of the message (string)
    
  • Removed gateway debug attribute. All debug info will be logged as debug
    level.
  • Local time is returned instead of UTC time, when requesting time the
    controller, with an internal message. This change is done in accordance to
    the official MySensors API.

All changes

MartinHjelmare and others added 13 commits October 19, 2016 21:26
Modified the event callback mechanism to support callbacks with a
message argument. This is a breaking change to the event callback
signature. The benefit of providing the full message to the event
callback is that it's no longer necessary to poll all node sensors
when a single sensor value changes or when a node event, like a
battery level update, occurs. The Message class was also modified to
include a reference to the gateway so the handler can use that
information for comparing gateway-specific constants (message types,
etc.).
* Add discover

* REMOVED FEATURE: Remove debug attribute on Gateway. Let log level
  setting control logging.
* Remove references to gateway attribute debug.
* Add check of internal message I_GATEWAT_READY. When this is received,
  broadcast I_DISCOVER internal message.
* Add check of internal message I_DISCOVER_RESPONSE. Check if sensor
  exists, which will in turn send presentation request if sensor is
  missing.
* Clean up pylint disable codes.
* Refactor _handle_internal to avoid too many branches.
* Add dictionary to lookup actions to take in _handle_internal method.
* Add property and setter for batter_level to set value as integer.
* Update JSON persistence to cater for changed attribute name for
  battery level.
* Add and update tests.
* tcp_check to reconnect in case of connection lost

tcp_check is trying to send an internal message every 10 seconds to test
the connection even if there is no activity.

* main set back to the original

* mysensors updated with the tcp_check

* main.py modified to match the original version

* Spaces added on the comments to align with the original version

* Code updated to fix the errors detected by the Travis code checker.

* More changes to fix the Travis code checker

* Another change to fix the Travis code checker

*  Another change to fix the Travis code checker

* _check_connection method created and called from run loop. The timer is inside the _check_connection method.

* check socket status before shutdown

* check socket status before shutdown from gtortone (with some modifications to pass the David check)

* check socket status before shutdown (from gtortone)

* Added the I_VERSION receivig timeout at 2*reconnect_timeout

* _handle_internal moved to the parent called with super()

* Added "return" in the super() call
* Return local time instead of UTC time from Controller

* Fix mock of localtime return value
* Import gateways into mysensors module for backwards compatibility.
* Also enable travis pip cache.
* Use modify to change a message attribute and return the same message
  instance.
* Ensure value_type is correct type when setting.
@MartinHjelmare MartinHjelmare merged commit ff3476b into theolind:master Apr 3, 2017
@MartinHjelmare MartinHjelmare deleted the 0.9 branch April 3, 2017 22:20
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.

3 participants