resolve#2451
Paranoid locking doesn't really matter in the current setup (but, leave some comments about how to solve it when it actually does).
Also copy internal tuple of save+transition+report and give the copy to the callback. Thus, don't assume the consumer is always nice,
and does not declare refs to internal struct variables, making this kind of hard to track.
Refactor internal code so it does not export functions to the built .o
Refactor WebUI:
- remove jquery dependency from the base custom.js and use vanilla JS
- remove jquery + jquery-datatables dependency from the RFM69 module
- replace jquery-datatables handlers with pure-css table + some basic cell filtering
(may be incomplete, but tbh it is not worth additional 50Kb to the .bin size)
- introduce a common way to notify about the app errors, show small text notification
at the top of the page instead of relying on user to find out about errors by using the Web Developer Tools
- replace <span name=...> with <span data-settings-key=...>
- replace <div> templates with <template>, disallowing modification
without an explicit DOM clone
- run `eslint` on html/custom.js and `html-validate` on html/index.html,
and fix issues detected by both tools
Streamline settings group handling in custom.js & index.html
- drop module-specific button-add-... in favour of button-add-settings-group
- only enforce data-settings-max requirement when the property actually exists
- re-create label for=... and input id=... when settings group is
modified, so checkboxes refer to the correct element
- introduce additional data-... properties to generalize settings group additions
- introduce Enumerable object to track some common list elements for
<select>, allow to re-create <option> list when messages come in
different order
Minor fixes that also came with this:
- fix relay code incorrectly parsing the payload, causing no relay names
to be displayed in the SWITCHES panel
- fix scheduler code accidentally combining keys b/c of the way C parses
string literals on separate lines, without any commas in-between
- thermostat should not reference tmpUnit directly in the webui, replace with
module-specific thermostatUnit that is handled on the device itself
- fix index.html initial setup invalid adminPass ids
- fix index.html layout when removing specific schedules
- generic mdns query function so we don't forget about the removeQuery()
- full handle mdns logic in the mqtt module, check for running mdns
instance and periodically poll for _mqtt._tcp service
- autoconnect only when MQTT is enabled *and* there is no server
- use mqtt::settings and mqtt::build namespaces for settings
- some refactoring for topic <-> setting application
- prefer const String& to const char* in topic generation
Do not install libraries globally in CI, use the specified PIO .ini option.
Similar to the other package installers, prefer package cache to the actual library storage contents.
More concise foreach, generic template code also no longer expands down to ::_read_kv
Also helps with needless inlining happening with recent gcc versions
Quoting gcc-4.8.2
> espurna/sensors/BaseAnalogEmonSensor.h:19:7: note: 'BaseAnalogEmonSensor' is not literal because:
> class BaseAnalogEmonSensor : public BaseEmonSensor {
> ^
> espurna/sensors/BaseAnalogEmonSensor.h:19:7: note: 'BaseAnalogEmonSensor' has a non-trivial destructor
Ratio, Mains are specific to a magnitude type.
Make keys use global index, and do a (temporary) WebUI workaround
to use 0 index instead of the global key.
Migrate to the new settings keys.
Local magnitude-specific index is still in play, pending changes in the rest of sensors
(ADE7953, PZEM004T{,V30}, ...) to remove it completely.
Local sensor index could still be useful though, to help out with some settings
in the future as we don't really enforce magnitude type uniqueness within sensors.
- fix dubious pinMode(0, INPUT), which does not work with esp8266 as A0 != GPIO0
- I2C sensor locking code can now exist separately from the base class
- EmonSensor -> BaseAnalogEmonSensor
- move AnalogEmon-specific methods from BaseEmonSensor to BaseAnalogEmonSensor
- clean-up protected member usage across the base, force the class to implement certain methods instead
- more code reuse between sensor versions
- drop local magnitude indexes & shared arrays of values in favour of separate
class instances, refactor ADS1X115 to the new model
- (techically) allow ADS1X115 code to be used with more than one i2c address
by having a shared port instance
Make sure it does not have global flags related to the HTTPCLIENT
Use generic ::updateFS with updater, and also support generic "fs" key
in the server response
Should be buildable once again
Restore the behaviour from #1468, where button clicks were triggered
Inject relay provider using the relayAdd, add buttonAdd to provide input handling
Remove extra button handling code from the WebUI
Still assuming that DUAL code really needs a syncronized way to handle
input & output with relays, so we can't treat it as a real button.
Without the device it is only guessing, and various issues / comments
are not really clear on that part :/
Leave build.sh as a local script, assume that CI will use the release.sh instead
Generator parser returned None at the end (...this is not rust...), also
fix args.* typos with a more declarative structure.
- remove version handling, PIO already does this for us
- directly set generate_release_sh.py arguments instead of having a
getopt proxy for each one (and having to deal with short-arg support)
- slightly more logs for the build process
Multiple ways to specify version string through environment variables:
- `ESPURNA_BUILD_FULL_VERSION` to set full version string
By default it is empty, and the version is combined using the values specified below
- `ESPURNA_BUILD_VERSION` to modify the first part of the version string (1.15.0-dev)
By default, uses espurna/config/version.h APP_VERSION value
- `ESPURNA_BUILD_REVISION` to specify revision part of the version string
For example 12345678, which is expanded as either .git12345678 or -git12345678
(depending on whether the version string contains hyphen)
By default, use git to retrieve the first 8 characters of the current HEAD SHA value
- `ESPURNA_BUILD_VERSION_SUFFIX` to specify build metadata part of the string
For example nightly20210607, which is added to the full version as 1.15.0-dev+nightly20210607
Empty by defauld
Adds -t build-and-copy which uses the values above to copy firmware.bin, configurable with:
- `ESPURNA_BUILD_NAME` to set the suffix of the filename.
By default, uses the $PIOENV (aka the string after the env: in the .ini file)
- `ESPURNA_BUILD_DESTINATION` to specify where to copy the .bin files
By default, uses $PROJECT_DIR
Resulting file is stored at:
${ESPURNA_BUILD_DESTINATION}/${ESPURNA_BUILD_FULL_VERSION}/espurna-${ESPURNA_BUILD_FULL_VERSION}-${ESPURNA_BUILD_NAME}.bin
In addition, modify generate_release_sh.py to use the new environment variables.
- make use of scheduler::settings when listing schedules
- do not be overzealous with settings validation & parsing
- cleaner wildcard() usage, we return a String not a ref to something internal.
but, it is techically allowed to use `const T&` for a `T` temporary which will be destroyed
after the apiRegister() callback returns