Otherwise, some things are still hidden
(or, depend on the order of incoming messages)
Make thermostat code use those as well, instead of injecting
thermostatVisible in every json payload
Since there are no dynamic callbacks registered at setup(),
use simple function pointers as the input type.
Internal type is still std::func, though
(and not yet sure how to get rid of it correctly)
Previous version used add_timestamp=false for outputs, this one
accidentally used const char*, size_t overload in place of const char*, boolean
Make sure this can't happen by using a stronger constexpr boolean
specifically for the timestamp conversion.
Also, naming clean-up and making sure raw bytes sender does not enable
already disabled debugging output.
As well as previous commits, remove ..._config.h header in favour of .cpp
Refactor loop to only use the `Led` instance, without needing to know
it's ID. Link relay<->led on demand instead of using a flat list.
Import LedPattern implementation into the .cpp, preserve existing .in
file to generate the constructor code (when needed).
Use accessor methods instead of plain members where possible, try to
hide the actual implementation details behind some common ones.
Introduce default settings query for `led` prefix. Setting function
reworked to use common string `prefix` checker instead of requiring the
consumer to provide a onKeyCheck-like lambda / standalone function.
Resolve the code generation issue with vector methods being unable to
store the exception info string in the same elf section
(which apparently becomes duplicated, somehow, when building single .cpp)
Error messages look like something like this:
```
vector.tcc:405
error: __c causes a section type conflict with __c
_M_check_len(size_type(1), __EXCSTR("vector::_M_emplace_back_aux"));
vector.tcc:71
note: '__c' was declared here
__throw_length_error(__EXCSTR(__N("vector::reserve")));
```
Common functions moved into namespace domoticz { ... }
Module functions moved into namespace { ... }
Remove templates and favour simple function for nvalue & svalue formatting,
and also use ArduinoJson for the JSON serialization.
Detach lights from the 1st relay, introduce `dczLightIdx`
Use named channel functions instead of counting channels manually.
Try to migrate the old settings.
Introduce stronger type for Idx to avoid entity id vs. domoticz idx confusion in function arguments,
since both are numeric and there's no distinction besides the name itself.
Don't use variable length array and remove `debugSend_P`, directly give the format to `vsnprintf_P`.
Common functions moved into namespace debug { ... }
Module functions moved into namespace { ... }
Provide len argument to most outputs, so it's calculated exactly once.
Early checks for nullptr and zero length.
Fix include order once again, try not to depend on config in header and
only use it in the actual .cpp code.
Still involves strlen for flash strings, but that needs to be addressed by using a custom type like:
```
struct PstrWithLength {
const char* const ptr;
size_t size;
};
```
And define PSTR macro to return:
```
PstrWithLength{&__pstr__[0], sizeof(__pstr__)};`
```
(and, probably, for any `const char (&fixed)[Size]` arrays as well)
Use namespace instead of custom prefix everywhere.
Multiple init() funcs per namespace, instead of one large one for all
of available operators
Continue to apply namespace { ... }
For when scanning is disabled. Remove uniqueness requirement, since
settings may contain multiple SSID with different BSSID values.
wifi::Mac conversion helpers for both xxxxxxxxxx and xx:xx:xx:xx:xx:xx
Shuffle std::vector usage, trying out std::array for static data and
std::unique_ptr where common use-case is reserve / resize + emplace
Also try to workaroud exception string issue with gcc4.8, which should
not be a problem with gcc10.3 coming with Core 3.0.0, but... one solution at a time
Initialize the vector with the values directly, ::reserve(len) instead of ::resize(len) (throught the ctor)
Use assignment when the intent is to replace the target value, not to exchange with something else.
- queue the actual response, as sending immediatly seems to have
inconsistent results with the initial setup page
- allow single string password, just like a normal key
- provide default value for adminPass wsStore variant
- `reload` & `saved` are mutually exclusive
Generate initial connection list with all suitable networks, not only the best ones.
When scanning for a better network, remove results with worse rssi.
Don't remove extra scan results in the delayed scan function,
allow consumer to filter by itself.