Skip to content

Fix Property Updates, Add Timestamps, Unused Status Handling#100

Merged
OverloadUT merged 7 commits intoautomicus:masterfrom
shbatm:prop_updates
May 15, 2020
Merged

Fix Property Updates, Add Timestamps, Unused Status Handling#100
OverloadUT merged 7 commits intoautomicus:masterfrom
shbatm:prop_updates

Conversation

@shbatm
Copy link
Copy Markdown
Collaborator

@shbatm shbatm commented May 9, 2020

Changed / Fixed

  • Changed the default Status Property (ST) unit of measurement (UOM) to ISY_PROP_NOT_SET = "-1": Some NodeServer and Z-Wave nodes do not make use of the ST (or status) property in the ISY and only report aux_properties; in addition, most NodeServer nodes do not report the ST property when all nodes are retrieved, they only report it when queried directly or in the Event Stream. Previously, there was no way to differentiate between Insteon Nodes that don't have a valid status yet (after ISY reboot) and the other types of nodes that don't report the property correctly since they both reported ISY_VALUE_UNKNOWN. The ISY_PROP_NOT_SET allows differentiation between the two conditions based on having a valid UOM or not. Fixes Identifying nodes with no ST property #98.
  • Rewrite the Node status update receiver: currently, when a Node's status is updated, the formatted property is not updated and the uom/prec are updated with separate functions from outside of the Node's class. This updates the receiver to pass a NodeProperty instance into the Node, and allows the Node to update all of it's properties if they've changed, before reporting the status change to the subscribers. This makes the formatted property actually useful.

Added

  • Added *.last_update and *.last_changed properties which are UTC Datetime Timestamps, to allow detection of stale data. Fixes Add Last Updated Property to Nodes #99
  • Return consistent event feedback on status updates that is traceable to the caller (contains the address of the node/program/variable). This is for subscribers that use the same function for multiple nodes.
  • Updated aux_properties will now fire the status event as well. This is for de-coupling of "control events" and events that update a nodes' status.

Fixes #98

@shbatm
Copy link
Copy Markdown
Collaborator Author

shbatm commented May 9, 2020

@OverloadUT -- These changes support some significant improvements to how Home Assistant can handle NodeServer nodes as well as updates to sensors and eventual support for "stale values" in Home Assistant -- my plan is to tack them on to the end of the PR chain if you're willing to test and push a 2.0.3.

Copy link
Copy Markdown
Collaborator

@OverloadUT OverloadUT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple comments!

Comment thread .gitignore Outdated
Comment thread pyisy/events.py Outdated
@shbatm
Copy link
Copy Markdown
Collaborator Author

shbatm commented May 12, 2020

I'm going to call that last commit the "you shouldn't eff with something you don't completely understand" fix.

Somehow in everything I've worked on with the ISY I've missed that /rest/status returns details that /rest/nodes/ does not include and uses a different tag for the node address. When I consolidated code, I lumped those two together--which broke the ability to get the full status details of every node.

Fixed the update function back to what it was originally intended for and added a dedicated function to update the /rest/nodes endpoint.

This requires another sync call with isy.nodes.update() after initializing the module, but before connecting to the event stream.

That's the last change I have in this round -- no extra PR required.

@shbatm
Copy link
Copy Markdown
Collaborator Author

shbatm commented May 13, 2020

Rebased.

Copy link
Copy Markdown
Collaborator

@OverloadUT OverloadUT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay; this one looks good to me!

@OverloadUT OverloadUT merged commit e54b3a6 into automicus:master May 15, 2020
@shbatm shbatm deleted the prop_updates branch September 10, 2020 09:59
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.

Add Last Updated Property to Nodes Identifying nodes with no ST property

2 participants