Commit Graph

4183 Commits

Author SHA1 Message Date
Maxim Prokhorov
1112cf47c3 mqtt(common): missing header ref 2025-03-19 06:15:23 +03:00
Maxim Prokhorov
edd5481388 webui: rebuild blobs 2025-03-19 04:42:34 +03:00
Maxim Prokhorov
efffead793 webui(settings): datalist enumerable for ntp timezones
making use of the feature to programatically generate offset options
additionally, saves 38bytes in the resulting blob
2025-03-19 04:41:06 +03:00
Maxim Prokhorov
1d2503a19e webui(settings): enumerables for both datalist & select
generalize <options> handlers, providing same entrypoint for both
2025-03-19 04:40:05 +03:00
Maxim Prokhorov
f2153f4a38 webui(settings): allow string id mapping in enumerables
store names as {id: name, ...}, not [{id, name}, ...]
entries appear the same way, and js stores keys in the insertion order

fixup numbers converted to strings
fixup select options typing to accept [string, string] instead of [number, string]
2025-03-19 04:38:39 +03:00
Maxim Prokhorov
d7af980bdf test(webui): enumerables spec extended
minimum viable checks for ranges and manually created entries
listen to and trigger events for span & select enumerable elements
2025-03-19 00:05:16 +03:00
Maxim Prokhorov
faf58e9237 sns: allow sensor instance to provide slot id
implement i2c address as slot id for the current sensors
ref. #2639
2025-03-18 20:50:02 +03:00
Maxim Prokhorov
58181d21a3 sns: explicit static instantiation
avoid yet again falling for ambigious instantiation order
amends 5ff4efd513
2025-03-18 20:47:50 +03:00
Maxim Prokhorov
ceeccce0b1 sns: off-by-one errors
mod10 and mod100 should be inclusive (oops)

recover from post vs. pre increment mixup
offset when formatting, store as-is
2025-03-18 04:26:20 +03:00
Maxim Prokhorov
fe08a66819 sns: experiment with magnitude persistent id
ref. #2639

global slot to identify specific sensor+num+type+slot combination
for now, not used anywhere but terminal listing
2025-03-18 03:43:43 +03:00
Maxim Prokhorov
cfa17df261 test(dht): consistent values and types
mask magnitude for all branches, matched when inlining
accumulate values for checksum without type ambiguity
2025-03-07 15:54:00 +03:00
Maxim Prokhorov
e48dac27b5 test(a02yyu): sample data
https://github.com/xoseperez/espurna/pull/2622#issuecomment-2440181937
2025-03-07 15:08:03 +03:00
Maxim Prokhorov
f77544fbd8 test(dht): checksum and dht11 2025-03-06 00:40:00 +03:00
Maxim Prokhorov
4c3122c153 test: fix unused / uninitialized warnings 2025-03-05 23:23:10 +03:00
Maxim Prokhorov
40500b489f sns(dht): another dht22 variant w/ 12bit values 2025-03-05 23:02:13 +03:00
Maxim Prokhorov
7476793a53 sns(dht): dont overwrite dht22 sign bit 2025-03-05 22:12:42 +03:00
Maxim Prokhorov
abbf7218f4 webui(build): rename files inline
note node-22 currently harmless deprecation warning coming from vinyl-fs clone()
2025-03-05 19:09:03 +03:00
Maxim Prokhorov
93dbcb9e31 test(unity): unused function 2025-03-05 18:44:07 +03:00
Maxim Prokhorov
39f2fa14cc webui(build): bump esbuild & vitest 2025-03-05 18:44:06 +03:00
Maxim Prokhorov
12a6506905 webui(build): bump locked versions 2025-03-05 18:44:06 +03:00
Maxim Prokhorov
f984ec9dbc libs(delimiter): revert to shared iterator instance
old gcc compat, plus stl would work more nicely
2025-03-05 18:44:06 +03:00
Maxim Prokhorov
cc0f3b2d03 sns(dht): merge common dht11 & dht12 calculations
notice sign bit in both bytes, apply magnitude mask to integer & scale
nb. technically... dht11 shares dht12 format, but prefer to stay on the integer side
2025-03-05 18:13:33 +03:00
Maxim Prokhorov
305918d5d8 sns(dht): different number representations for dht22
sometimes sign-magnitude, sometimes twos-complement
resolve #2638
2025-03-05 18:13:33 +03:00
Maxim Prokhorov
ff6d86c7e5 light(color): fix stateful parser api 2025-03-05 18:13:33 +03:00
Maxim Prokhorov
edb458fac6 test(sch): fix utc offset 2025-03-05 18:13:33 +03:00
Maxim Prokhorov
5ff4efd513 test(sns): voltage magnitude should work 2025-03-05 18:13:33 +03:00
Maxim Prokhorov
180361a89d test: expected vs. actual stringified 2025-03-05 18:13:33 +03:00
Maxim Prokhorov
824c527064 libs(delimiter): stateless and stateful splitview
reference, value, difference and tag metadata
std::find_if needs same type for begin() and end()
2025-03-05 18:13:33 +03:00
Maxim Prokhorov
91fa550018 libs(delimiter): iterate over split view
adjust internals to provide .begin(), .end(), and the iterator object itself
since the original class is only forward-going, iterator behaves the same
2025-03-05 18:13:33 +03:00
Maxim Prokhorov
56061ec054 led(api): apply mode through payload string
allow to reset to a specific mode without settings reload
similarly, interpret on & off as modes and not just status updates
2025-03-05 18:13:33 +03:00
Maxim Prokhorov
6aaa62fac7 types(span): infer const from T 2025-03-05 18:13:33 +03:00
Maxim Prokhorov
6cc364e04d led(api): status changes state based on payload
do not always reset status when processing payload
allow to pass mode string as payload (e.g revert from from manual mode via mqtt)
2025-03-05 18:13:33 +03:00
Maxim Prokhorov
8e91a34a48 led: constexpr methods instead of temporaries 2025-03-05 18:13:33 +03:00
Maxim Prokhorov
4a4dcaeab5 sch(restore): avoid duplicate actions on matching schedule
skip restore::run when action was already executed at least once
(since restore search never returns offset==0 result)
2025-03-05 18:13:33 +03:00
Maxim Prokhorov
0114d69809 led: shared delay logic and schedule checks 2025-03-05 18:13:15 +03:00
Maxim Prokhorov
0033735caa led(relay): ensure link exists before applying status 2025-03-05 18:13:07 +03:00
Maxim Prokhorov
a189c5f33f test(delimiter): split and delimiter view
using comparison macro for tests referencing string views
move all local code related to unity to a separate object
2025-03-05 18:12:59 +03:00
Maxim Prokhorov
ac86899764 libs(delimiter): split strings using the same utility function 2025-03-05 18:12:47 +03:00
Maxim Prokhorov
8e698ac28b util(stream): not all 3.x.x streams have peek api 2025-03-05 18:12:39 +03:00
Maxim Prokhorov
1366713896 terminal: typo 2025-01-29 12:47:31 +03:00
Maxim Prokhorov
27cf0afc11 terminal: semicolon with serial and telnet 2025-01-29 12:36:00 +03:00
Maxim Prokhorov
776acaaa84 terminal: strict state check when injecting lf
avoid accidentally returning Lf as remaining string when the given line is already terminated
2025-01-29 12:36:00 +03:00
Maxim Prokhorov
356fcc6555 terminal: semicolon as line break 2025-01-29 12:36:00 +03:00
Maxim Prokhorov
c9e13d4025 terminal: remove line break requirement from all api calls
already handled internally
2025-01-29 12:36:00 +03:00
Maxim Prokhorov
3970dfbbcc terminal: string delimiters and reworked line api
update string search logic to use brute-force for a full string, not just a single char
(ref. c++17/c++20 algorithm std::search defaults)

original code mixed lineview/buffer logic outside of the terminal parser
instead, make sure that delimited classes never return delimiter itself
line classes do so as well, equaly handling both '\n' and '\r\n'
existing terminal api now handles implicitly terminated strings by default

reworked linebuffer initialization order to use inheritance in place of
plain member init. as a bonus, its main methods are no longer templated
reducing the resulting code size per linebuffer specialization (not by very much, though)
2025-01-29 12:35:49 +03:00
Maxim Prokhorov
ab876d4ec8 terminal: report about remaining input and auto-inject line break at the end
- extra flag to include new-line after the input ends
- keep tokens sv to the original string.
  unless escaped characters appear, prefer to not make extra buffers
  (only matters for >12byte tokens; smaller strings do not allocate)
- keep remaining sv, after line break encountered by the parser.
  update api caller to re-use the parser, no need for a separate line delim class
2025-01-29 12:27:36 +03:00
Maxim Prokhorov
96fbde0d99 terminal: serial noise 2025-01-29 12:27:36 +03:00
Maxim Prokhorov
bae01f55a1 terminal: sv switch instead of pstr 2025-01-29 12:27:36 +03:00
Lübbe Onken
97db8fcc8d ha: color_mode flag is deprecated (#2634)
Deprecated flag `color_mode` used in MQTT JSON light config , the `color_mode` flag is not used anymore and should be removed.
...
This will stop working in Home Assistant Core 2025.3
2025-01-24 05:52:34 +03:00
dependabot[bot]
0934262f14 build(deps): bump vite from 5.4.9 to 5.4.14 in /code (#2635)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.9 to 5.4.14.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.14/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.14/packages/vite)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-24 05:51:45 +03:00