-
Notifications
You must be signed in to change notification settings - Fork 0
WIP - [WFM Wrapper] Move device specific methods into device lib & invert dependencies between devices and wfm #3
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
base: master
Are you sure you want to change the base?
Conversation
lib/Relay/Relay.cpp
Outdated
|
|
||
|
|
||
|
|
||
| void Relay::SendHTTP(WiFiClient client) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we should keep this? Weve seen that using a UI kinda wrecks the webserver.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Theoretically, that is improved by the division of work across cores. It's nice to have it as a debug option for individual devices if the overhead ends up not being an issue.
Will test!
| Relay relay = Relay(); | ||
| TaskHandle_t WebServerTaskHandle; | ||
| TaskHandle_t IOTaskHandle; | ||
| WiFiManagerWrapper wfm = WiFiManagerWrapper(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this WiFiManagerWrapper (we could prolly change the name of this at some point soon) still handles the /specification endpoint. I think we will want to inject whatever device information we want to include in that spec response. The most basic example could be the device_type. Which in this case would be relay?
The benefit of having the wfm do it for all devices will be the standardization of the spec responses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm this is a tricky one, I actually intended to move this path into the Relay class. I just hadn't done it yet.
We can inject the spec in when we instantiate a new WFM in Relay, but I think it should be a shared type that contains maps of paths/parameters/etc. Then wfmw can validate the input and pull data from known keys.
That way the wfm wrapper can stay generic and there's closure around device business logic in the lib/Relay/
- moved shouldSaveConfig into Wfm Wrapper Class - updated shouldSaveConfig to use an anon func that sets shouldSaveConfig - delete unused mutex
No description provided.