Commit Graph

6 Commits

Author SHA1 Message Date
f59cc3438c Add connection events 2025-01-04 13:09:07 -06:00
25acdd9481 Add documentation 2025-01-04 12:27:44 -06:00
ab4898c20b Add pings, debug logs, socket cleanup to Unit
At some point I need to stress-test this to see how long the connection can stay open, and what happens when it goes down.
2025-01-04 12:05:29 -06:00
5ae6cac549 Add ability to subscribe for updates to properties
Using SubscribeToUpdates() will cause the Unit to trigger a "notify" event any time the subscribed property changes, containing the new value of the property.

I don't know how/if you can unsubscribe from something as I don't see the official app ever doing that.
2025-01-04 11:22:12 -06:00
7daf47ac18 Fleshing out more messages
Getting a feel for how the development experience is with this setup. With the previous idea of abstracting the request into a getSystemInfo() function on the Unit itself, the documentation for what to expect from GetSystemInfo either had to live in two places or be presented as a link to the canonical location. Neither felt great, so I think the caller can just call send(GetRequest()) themselves.

Also added the first "set" message which is capable of toggling a body or circuit.
2025-01-03 16:01:58 -06:00
ceb9299d03 Create Unit class to make queries easy 2025-01-03 14:58:31 -06:00