Comments (4)
The issue here is that the library is as ignorant as the consumer w.r.t. what specifically the received callback is for. ScreenLogic sends a packet for getScheduleData's response and whatever it contains is what it contains. We can't add or remove context from it since we don't control the ScreenLogic system's code. If we provided a separate API for getRunOnceEvents, we would still, under the hood, be sending a getScheduleData packet and would, in turn, receive a getScheduleData response packet. We cannot guarantee that the packet is for recurring or run-once events unless the body of the message indicates such.
And to be clear, getScheduleData(1)
is returning "run-once" events, not egg timer events.
My recommendation is to call them one at a time and not call one until you've received a response from the other.
from node-screenlogic.
Right... because the message IDs are the same... Duh.
That occurred to me about 20 minutes after opening the issue.
I'll just have to break the scheduling support code out of that polling loop and make it stand-alone. That's the way I was going originally, and then I changed course because I was trying to stay consistent in my methodology...
I thought that run-once events were the same as egg timers? Although I still don't understand Pentair's official app interface for egg timers.
Anyway, closing the issue. Thanks @parnic.
from node-screenlogic.
No, run-once events and egg timers are separate. The best place I know to see the two is in the Windows ScreenLogic app which separates them out. Egg timers define how long a circuit is allowed to stay on before the controller turns it off automatically. Run-once events are scheduled events that only fire once.
from node-screenlogic.
So, in thinking about this further, it occurs to me that there's an unused field in screenlogic messages called the "sender id". This ID is set by the caller and is provided by the device when the response is received. Currently the library always specifies a sender ID of 0. We could, potentially, offer a way of setting the sender ID for any given message which would allow for differentiating multiple messages of the same type.
The least destructive way to do this for the library is to either offer a function on the Unit that allows setting the sender ID to use. The use case would be something like
unit.setSenderID(42)
unit.getScheduleData(0)
unit.setSenderID(43)
unit.getScheduleData(1)
Then the object passed to the getScheduleData
event would have a senderID
property that could be inspected to tell them apart.
Another solution would be to modify every function signature such that the final argument is an optional value of the sender ID. This is a more invasive change, but would retain compatibility with existing users. Something like
unit.getScheduleData(0, 42)
unit.getScheduleData(1, 43)
from node-screenlogic.
Related Issues (20)
- Unable to set salt level for pool or spa individually HOT 2
- Schedule Create/Delete is a very long operation (15-20 seconds) HOT 23
- Calling getPumpStatus() is timing out. HOT 4
- SenderID's don't work with an old version of the library ... duh. HOT 3
- History messages HOT 2
- Can Intellibrite "save" and "recall" functionality from the mobile app be leveraged to store and set custom light colors? HOT 12
- Uncaught Exception crashing node-red HOT 13
- ECONNREFUSED on connect HOT 3
- Can you tell if a scheduled event is running or not? HOT 2
- CoolSetpoint on Spa tracks outdoor air temp? HOT 2
- getNumPumps() returns number of available pump slots, not actual number of pumps HOT 8
- feature request: Access "history" data HOT 1
- Integration with nodejs-poolController HOT 54
- Set pump speeds HOT 7
- Unit is found but remote connection is hanging?
- SLSetHeatSetPoint not parsing API response HOT 4
- FEATURE: Set Timeout HOT 4
- Timeout / Parameter Failure on setCircuitAsync HOT 3
- Is UDP Broadcast the same as mdns/dns service discovery? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-screenlogic.