4365 Commits

Author SHA1 Message Date
Maxim Prokhorov
93f2608753 sns: vl53l1x updates
stronger time types, overrides

init underlying lib object as a member
this might be changed to unique_ptr, in case we really want begin() to
be idempotent and being able to re-init things
(which might not be actually possible?)
2022-05-18 21:20:10 +03:00
Maxim Prokhorov
20203633ed sns: similar updates to pulse meter 2022-05-18 21:20:10 +03:00
Maxim Prokhorov
34f8f04c94 sns: mics* sensor updates
structure, overrides, strong time types

actually use the analog sensor base to read
(and fixing yet another pinmode accident)
2022-05-18 21:20:10 +03:00
Maxim Prokhorov
9cd798ba1a sns: geiger sensor updates
fixed structure, overrides. strong time types
2022-05-18 21:20:10 +03:00
Maxim Prokhorov
d670e85b10 sns: update events sensor
updated structure, overrides. strong time type
testing timesource changes. this should work, but might need to tweak
things if it starts to fail b/c of flash code loads
2022-05-18 21:20:10 +03:00
Maxim Prokhorov
c0d6ed1288 sns: actually load bmx280 fixed address from settings
conversion is not working for signed ints, only unsigned
2022-05-18 21:20:10 +03:00
Maxim Prokhorov
080d7ab930 sns: more abstract properties for base sensor
do not force to implement constructor, just update vtable
continue testing with bme280 class, update structure
2022-05-18 21:20:10 +03:00
Maxim Prokhorov
91b137e92f sns: do not auto-detect when i2c address is set
make sure there's an option for direct address setup
sensor updates are wip, since base sensor code is also changing
2022-05-18 21:20:01 +03:00
Maxim Prokhorov
0005c659e7 i2c: simplify find and locking logic
use bitset when locking, avoid manual index & mask calculation
update check() to use boolean logic instead of returning int status
remove wip address-range, just use the {begin, end} pair
uint8_t instead of unsigned char when dealing with data
2022-05-18 21:16:31 +03:00
Maxim Prokhorov
864a8c84fe i2c: remove extra {begin,end} transmission when reading 2022-05-18 21:16:31 +03:00
Maxim Prokhorov
092db6b3a5 sns: generic wrappers for sensor and filter pointer
Avoid confusion between ref and pointer when looping over sensors
Re-use helper class in the magnitude object as well

Remove custom code related to filter movement, just use unique_ptr
Plus, updates filter code to use stl vector where possible

Experimening with dynamic cls id. Perhaps this should be something
else... but, at least there are no longer any header-defined values.
2022-05-18 21:16:31 +03:00
Maxim Prokhorov
85ee526c8a sns: more flash strings for type prefix and value suffix 2022-05-11 18:12:55 +03:00
Maxim Prokhorov
b080dd9ea6 i2c: ...and show addresses in hex 2022-05-07 15:38:57 +03:00
Maxim Prokhorov
e40f91397b pio: use git toolchain with -latest-base
preemptive fix for the issue resolved in the 3.1.0
2022-05-07 15:25:35 +03:00
Maxim Prokhorov
c0e6372559 i2c: actually show addresses on boot 2022-05-07 15:22:45 +03:00
Maxim Prokhorov
3275f4921f sns: the rest of magnitude settings
As mentioned in the #2491
Hides parent element when these groups are empty
2022-05-06 18:56:54 +03:00
Maxim Prokhorov
c04cdff200 sns: build flag for dummy sensor 2022-05-06 18:56:54 +03:00
Maxim Prokhorov
7c2130b722 pio: prune unused libraries from shared_lib_dir 2022-05-06 15:48:16 +03:00
Xose Pérez
1c9553176d hw: add support for PM1006 (IKEA Vindriktning) (#2505)
IKEA Vindriktning Air Quality Sensor
https://www.ikea.com/gb/en/p/vindriktning-air-quality-sensor-80515910/
2022-05-06 14:37:49 +03:00
Ken Nixon
99c3d24bbd hw: add support for Itead Sonoff POW R3 (#2506)
Added support for Itead Sonoff POW R3 (https://itead.cc/product/sonoff-powr3/)

This device is essentially the same as the POW R2, except:
- the relay is a normally closed type,
- the current and power ratings of the device are higher.
2022-05-06 13:47:37 +03:00
Maxim Prokhorov
59bd14966e webui: rebuild blobs 2022-05-05 22:49:02 +03:00
Maxim Prokhorov
62b2edadc4 sns: show and edit correction values in webui
fixes #2491
2022-05-05 22:35:34 +03:00
Maxim Prokhorov
57f04023d4 pio: major version option renames 2022-05-05 20:02:35 +03:00
Maxim Prokhorov
f9df216409 pio: mention registry ui 2022-05-05 17:50:21 +03:00
Maxim Prokhorov
2b50620f92 pio: move some of libraries to the registry
While I am still hesitant to call this an improvement,
at least this makes part of the installation slightly faster
2022-05-05 17:50:21 +03:00
Maxim Prokhorov
c971716b66 settings: fixup c-string comparison
since it won't decide between String and StringView,
manually direct it to the StringView
2022-05-05 17:50:21 +03:00
Maxim Prokhorov
6b1a2de06d ir: bump IRremoteESP8266 to 2.8.2 2022-05-05 17:50:21 +03:00
Maxim Prokhorov
128acef7dd sys: port blocking delay code from Core 2022-05-05 17:50:21 +03:00
Maxim Prokhorov
0c3b1acecc sns: more flash strings
also normalize token values of particle measurements
2022-05-05 17:50:21 +03:00
Maxim Prokhorov
5ccc70e42e pio: trying to work out 6.0.0 changes 2022-05-05 17:50:21 +03:00
dependabot[bot]
02581c6988 webui: bump minimist from 1.2.5 to 1.2.6 in /code (#2508)
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-11 14:08:35 +03:00
Maxim Prokhorov
791576458f prometheus: anonymous namespace & fix warnings
clangd does not like integer SUPPORT flags and `||`
2022-02-12 17:52:37 +03:00
Maxim Prokhorov
afd914609d sns: comments & update sensor::Value helpers 2022-02-12 17:51:50 +03:00
Maxim Prokhorov
e5e8f86866 sns: really handle all of available temperature conversions
amends e51e259f02
fixing incorrect conversion from kelvin, and also add full
conversion from possible farenheit source (if that ever happens)

experimenting with the idea of unit conversion... while a table-like
approach will work and will be slightly shorter, it would not have the
specific type checks and constexpr still does not play well with lambdas

plus, any conversion function referenced as a pointer will not really
be a constexpr (...and still require c++17 to work correctly when iterating)
2022-02-11 22:09:01 +03:00
Maxim Prokhorov
0933ab80e1 sns: fixup missing static object binding with gcc4.8 2022-02-11 13:54:30 +03:00
Maxim Prokhorov
456d1cc586 ci: reference dump() method for the settings storage 2022-02-11 13:53:34 +03:00
Maxim Prokhorov
c37bbb42a6 ci: make sure ctest prints it's failures 2022-02-11 13:53:05 +03:00
Maxim Prokhorov
ec17bf652c settings: clean-up & make sure kv result is actually moved
cursor no longer calculates 'offset' but stores the absolute position
this also helps not introducing that specific math to the outside code

more const-correctness fixes and general accessors instead of plain structs
access and modification, where specific ctor or helper method should've
been used instead
2022-02-11 13:48:39 +03:00
Maxim Prokhorov
ce7de7d812 mqtt: once again, do not quote numbers in MQTT JSON payload
Restore behaviour from dd12251e43
7ba1283024 unintentionally removed it
Instead of reverting to the 'atof' code, just use the provided string
as-is via RawJson (aka `serialized()` in the v6)

Note that the old approach may have caused some silent data loss b/c the
data could have been stored in 'double' or 'u64', where the ArduinoJson
only stores 'u32' and 'float' in it's internal buffer and does not (really)
warn us about any type incompatibilities.
(at least by default. but, the alternative is to store all floating point
numbers as 'double' internally, see ArduinoJson/Configuration.hpp)

resolves #2503
2022-02-10 14:54:45 +03:00
Maxim Prokhorov
d4c18a6f52 web: would be a clang warning 2022-02-09 16:00:41 +03:00
Maxim Prokhorov
3e9acdf892 rpn: do not link with Core wifi lib 2022-02-09 16:00:41 +03:00
Maxim Prokhorov
69b6f8461d ntp: more flash strings 2022-02-09 16:00:41 +03:00
Maxim Prokhorov
812cd7dee2 system: sync HeapStats with upstream
both heap size values should be u32
2022-02-09 16:00:41 +03:00
Maxim Prokhorov
dfe01d1bbf relay: constexpr is already const 2022-02-09 16:00:41 +03:00
Maxim Prokhorov
28aa9622bb rfbridge: handle rfb{ON,OFF} just like any other setting
removes the extra 'save' button from the ui and the code that handles it
also make sure to use the updated foreach_prefix when looking for the
match in the settings

resolve #2502
2022-02-09 16:00:41 +03:00
Maxim Prokhorov
1a4926da2d settings: const-correctness and simplify prefix search
Cursor is in a weird spot, by being both the pointer to the data and the
read-range that is used of specify the range in which we operate
Next TODO would be to move even more things to 'const', but that would
at least require to rework the cursor object and also remove it from the
members list.
2022-02-09 15:43:08 +03:00
Maxim Prokhorov
9501595a16 relay: fix never attempting mqtt group subscriptions
Also, try to fix the API helper objects to persist the referenced struct
(best effort only, though, it is still possible to break things when not careful)
2022-02-09 15:43:08 +03:00
Maxim Prokhorov
c22b369c86 sns: ntc temperature returned as kelvin
also rework internals of the analog and ntc sensor classes to use
explicit delays and update it's comments
2022-01-31 21:23:17 +03:00
Maxim Prokhorov
e51e259f02 sns: handle all of available temperature conversions 2022-01-31 16:32:40 +03:00
Maxim Prokhorov
2338f54cf5 wifi: show the current config via terminal 2022-01-31 16:32:04 +03:00