ref. https://github.com/xoseperez/espurna/issues/1132#issuecomment-431868924
it is slightly bigger, but better looking and no jquery dependency
rework colorpicker style as well, hide to prevent sending garbage when
lights are off. update lights module to send `lightState()` and separate
state from status payloads
yes, input[type="color"] is an option, but it does not look good
support es6 syntax
use js comment style in custom.js
only minify the custom.js
using 4.x branch, since 5.x wants async / await and more changes to the gulp script
- gpio module now tracks the known providers (right now, hardware and mcp expander)
- refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions
- refactored button module to use gpio provider instead of referencing types itself
- removed dual & stm code from buttons, migrate both to relay module
- added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did)
- relays runtime configuration keys
- relay command now shows configured relays and current & target statuses
- refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead
- remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT
- allow to bind rf codes to real relays
- drop tuya-specific lights provider, remove tuya code from relays and lights modules
- integrate tuya via relay listeners and providers, use lights custom provider
- implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle)
- lights custom provider (global, not per-pin) and state listeners
- remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT
- lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT
- refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing
- transition time + step parameter for the lightUpdate
- report mask parameter for the lightUpdate
- minor fixes across the board
resolve#2222
fixes#2407
avoid depending on other settings
technically, it could be another block in the snsConfigure for
magnitudes, however it also should be a new type of one-shot logic
Exchange sneaky memory leak with a squeaky wheel...
Web server will immediatly delete the request object, so not really much
point in tracking the pointer via some external means.
- store name+callback pairs in list instead of a hash map
remove vector reserve() overhead
- rework callbacks to expect flash strings
- comments...
Small difference is that now there's no way to know if command already
exists. Meaning, while we do override the existing callback, comman
names list will have more than one entry.
Flash strings are quite weird. In case we finally get all `const char*`s
in PROGMEM (which is the case for ESP32?), this could use a comment-proposed
method of having handlers per-module instead of handlers per-command.
- match paths through a custom AsyncWebHandler instead of using generic not-found fallback handler
- allow MQTT-like patterns when registering paths (`simple/path`, `path/+/something`, `path/#`)
Replaces `relay/0`, `relay/1` etc. with `relay/+`. Magnitudes are plain paths, but using `/+` in case there's more than 1 magnitude of the same type.
- restore `std::function` as callback container (no more single-byte arg nonsense). Still, limit to 1 type per handler type
- adds JSON handlers which will receive JsonObject root as both input and output. Same logic as plain - GET returns resource data, PUT updates it.
- breaking change to `apiAuthenticate(request)`, it no longer will do `request->send(403)` and expect this to be handled externally.
- allow `Api-Key` header containing the key, works for both GET & PUT plain requests. The only way to set apikey for JSON.
- add `ApiRequest::param` to retrieve both GET and PUT params (aka args), remove ApiBuffer
- remove `API_BUFFER_SIZE`. Allow custom form-data key=value pairs for requests, allow to send basic `String`.
- add `API_JSON_BUFFER_SIZE` for the JSON buffer (both input and output)
- `/apis` replaced with `/api/list`, no longer uses custom handler and is an `apiRegister` callback
- `/api/rpc` custom handler replaced with an `apiRegister` callback
WIP further down:
- no more `webLog` for API requests, unless `webAccessLog` / `WEB_ACCESS_LOG` is set to `1`. This also needs to happen to the other handlers.
- migrate to ArduinoJson v6, since it become apparent it is actually a good upgrade :)
- actually make use of JSON endpoints more, right now it's just existing GET for sensors and relays
- fork ESPAsyncWebServer to cleanup path parsing and temporary objects attached to the request (also, fix things a lot of things based on PRs there...)
- provide a generic way to read default status of the pin after boot
allows us to use switch as both on and off, independent of the position on boot
- add BUTTON_DEFAULT_LOW & BUTTON_DEFAULT_BOOT (now it's not just BUTTON_DEFAULT_HIGH)
wiki described raw numbers for some reason :/ this will break that
- clean-up 'constexpr const' and 'const' function args, both are redundant
- clean-up debounce event member defaults, put things in the header
alexa device discovery/state calls use URL of type
/api/hash_id_key_whatever/lights
This is blocked when API is disabled and fails
also when http API is enabled because no apikey is
sent by amazon calls
Don't try to use the http api for alexa calls.
Responses for alexa are done by fauxmoesp lib,
so there's no need for the http api call.
- Add ::Released button event to be used specifically with switches, opposite of ::Pressed
- Always use default state for switches instead of ignoring it and using current pin reading as value. This allows us to boot with the switch held in the opposite state and trigger the correct event immediately
(meaning, switches now depend on the BUTTON_DEFAULT_HIGH presence to detect the default position)
- BREAKING: Fixup hardware.h. Any custom board needs manual changes.
- BREAKING: Rework MQTT button messages to send text from debug messages instead of numeric code
resolve#2327, #2220
- remove legacy support in the webui
- format datetime strings on the device, use NTP panel to display them both
- migrate from the old ntpOffset + ntpDST + ntpRegion to ntpTZ
ensure the only operation from main loop() is load
since isr handles incrementing the counter, resulting value is calculated as
offset between the current and the previous reading (always positive)