-
Notifications
You must be signed in to change notification settings - Fork 4
Enhance TP-Link driver #163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The `Dimmer` class was changed to use `SharedReadWriteDevice` types. This commit also required changes to the TP-Link driver (which only supports the HS220 dimmer.) The driver isn't using the `Shared` type as it was intended, so the TP-Link might not work. This will be verified or fixed.
This module holds types that are assigned to fields in requests.
A lot of the types were too exposed. This moves definitions into areas that restrict their access. Also got rid of `CmdWriter`; it was a complication that a lot of areas needed. Instead, I created a `crypt` module and put simple `encode` and `decode` functions in it. The `CmdWriter` was no longer necessary since `Vec<>` is a `Writer` for the `serde_json` API. 🎉
- Add an error device to report errors - Make the read/write device sharable
Its contents were incorporated into another file, but I forgot to delete the source file.
This driver now correctly uses the `SharedReadWriteDevice` API. It also adds support for switches (i.e. non-dimmer devices.)
These messages should use a more consistent convention.
With a small set of configured drivers and a few logic blocks, there was a chance that the logic blocks would try to initialize before all the drivers registered their devices. This commit adds barriers to the driver start-up code so that we don't proceed to the logic block start-up until all devices are registered with core. This also simplifies the logic block start-up by having a simple barrier instead of nested barriers.
|
I still need to make another change to the driver. Right now, as it's trying to connect to the device, it's not listening or handling incoming settings. It needs to process settings in a timely fashion no matter what and right now, settings will hang until a connection is made. This may seem like a short time and ignorable but I use one of the outlets to control the Christmas tree lights. Most of the year the WiFi outlet is in a drawer so settings to that device would hang until the outlet is plugged back in. |
|
I also need to update the |
- `drmem-api` is now v0.6.1 - `drmem-drv-tplink` is now v0.6.1 and depends on `drmem-api` v0.6.1
This commit adds a parameter when registering devices that specifies the override timeout. Only SharedReadWriteDevice devices actually use this parameter. It'll be ignored for devices that can't be modified in the real world.
This driver now should be responsive to settings even when connecting and when sleeping between reconnects.
This PR has several important changes:
SharedReadWriteDevicetype for managing state. This means I can control my TP-Link devices manually, and DrMem will leave it in "manual mode" for a predetermined amount of time (4 hours, at the moment.)