Add support for setting the current system date/time

#56
This commit is contained in:
2021-09-06 22:52:57 -05:00
parent f271554d89
commit a5d207d3aa
4 changed files with 60 additions and 0 deletions

View File

@ -34,6 +34,7 @@ Tested with a Pentair ScreenLogic system on firmware versions 5.2 Build 736.0 Re
* [SLAddClient](#sladdclient)
* [SLRemoveClient](#slremoveclient)
* [SLGetSystemTime](#slgetsystemtime)
* [SLSetSystemTime](#slsetsystemtime)
## Usage
@ -295,6 +296,10 @@ No longer receive `poolStatus` messages from controller. Emits the `removeClient
Retrieves the current time the system is set to. Emits the `getSystemTime` event when response is received. `senderId` is an optional 16-bit integer and will be present as the `senderId` field on the returned message.
#### setSystemTime(date, adjustForDST, senderId)
Sets the current date and time of the ScreenLogic system. Emits the `setSystemTime` event when request is acknowledged. `date` must be a `Date` instance holding the date/time to set, and `adjustForDST` must be a boolean indicating whether the system should adjust for daylight saving time or not. `senderId` is an optional 16-bit integer and will be present as the `senderId` field on the returned message.
### Events
* `loggedIn` - Indicates that a connection to the server has been established and the login process completed. `get` methods can be called once this event has been emitted.
@ -320,6 +325,7 @@ Retrieves the current time the system is set to. Emits the `getSystemTime` event
* `addClient` - Indicates that a response to `addClient()` has been received. Event handler receives a [`SLAddClient`](#sladdclient) object.
* `removeClient` - Indicates that a response to `removeClient()` has been received. Event handler receives a [`SLRemoveClient`](#slremoveclient) object.
* `getSystemTime` - Indicates that a response to `getSystemTime()` has been received. Event handler receives a [`SLGetSystemTime`](#slgetsystemtime) object.
* `setSystemTime` - Indicates that a response to `setSystemTime()` has been received. Event handler receives a [`SLSetSystemTime`](#slsetsystemtime) object if the request was valid, or `null` if the request was invalid (input parameters were not of the required types).
* `loginFailed` - Indicates that a remote login attempt via supplying a system address and password to `UnitConnection` has failed likely due to the incorrect password being used.
* `badParameter` - Indicates that a bad parameter has been supplied to a function. This can be triggered, for example, by sending the wrong controller ID to a `set` function.
* `error` - Indicates that an unhandled error was caught (such as the connection timing out)
@ -783,3 +789,7 @@ Contains information about the system's current time and date. Passed as an argu
* `millisecond` - short representing current system millisecond
* `adjustForDST` - bool indicating whether the system should adjust for daylight saving time or not
* `date` - `Date` instance representing the current system datetime (convenience, constructed from the above properties)
### SLSetSystemTime
Passed as an argument to the emitted `setSystemTime` event.