mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 09:05:56 +03:00
[GH-ISSUE #1548] Provide methods to validate custom parameters #1321
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#1321
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 @jonasbjurel on GitHub (Jan 13, 2023).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1548
Basic Infos
A very nice library - Kudos!
Feature request.
I would propose a way to feed-back customer parameters validation errors. I think the validation should be performed by the application in the setPreSaveConfigCallback(..) callback. The application should have the opportunity to feed-back any custom parameter validation failure which would result in a configmanger GUI error message guiding where the validation failed, and prohibit it to save any of the other configuration - ensuring atomic validation and save:
A very naive thought on the implementation:
void myPreSaveConfigCb(){
if (setMqttUri(mqttServerUriParam.getValue()){ //returns true/or positive if mqttServerUriParam.getValue() is not a valid URI string conventions
mqttServerUriParam.validationError("MQTT URI validation error, %s is not a valid URI" CR, mqttServerUriParam.getValue())
}
Hardware
WiFimanager Branch/Release: Master
Esp8266/Esp32: ESP32
Hardware: ESP32 Wrover
Core Version: 2.4.0, staging
Description
See above
Settings in IDE
Additional libraries:
Sketch
Not an error - but a feature request - See proposal above
Debug Messages
Not an error - but a feature request.