mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #888] Addon: JSON message callback to change innerHTML realtime by id's #751
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#751
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dontsovcmc on GitHub (May 19, 2019).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/888
Look at my crazy addition.
I can request sensors while ConfigPortal is running and change innerHTML of labels.
I add my callback to WiFiManager.cpp:
link
link
WiFiManager.h:
void (*_wateriuscallback)(String &) = NULL;I add this javascript to WebServer page:
Now i can create a function
void update_data(String &message)and linked it by WiFiManager object in my code:
And do some rock!
The 'state0' is an 'id' of the label, that I want to change.
I use it to check wire connection: If signal received, I write 'connected' on the webpage to user =).
@tablatronix commented on GitHub (May 19, 2019):
hmm you can do this in development with no code, see dev example for adding custom route endppoints