feat(advert): osm úrovní baterie místo dvou stavů, blesk na externím napájení
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5f56a80a78
commit
f2b952ec4a
5 files changed
+312
-152
No files matched your search
+27
-20
@@ -362,9 +362,9 @@ in order of preference:
|
||||
|
||||
#### Show battery state as an icon on the advertised name
|
||||
|
||||
*(TeTeHacko fork)* Appends a battery icon to the name carried in adverts, so
|
||||
anyone who hears the node can see its state without logging in for telemetry.
|
||||
Off by default.
|
||||
*(TeTeHacko fork)* Appends a solar marker and a charge level to the name
|
||||
carried in adverts, so anyone who hears the node can see its state without
|
||||
logging in for telemetry. Off by default.
|
||||
|
||||
**Usage:**
|
||||
- `get batt.icon`
|
||||
@@ -372,33 +372,40 @@ Off by default.
|
||||
|
||||
**Default:** `off`
|
||||
|
||||
**Icons:** `☀️` above the threshold, `🪫` below it.
|
||||
**Glyphs:** `☀` permanently (solar node), then one of `▁▂▃▄▅▆▇█`
|
||||
for the charge level -- or `⚡` instead of the level while the node runs on
|
||||
external power (USB), where VBAT reads the charger rather than the cell.
|
||||
|
||||
**Note:** The icon costs name bytes, and the LONGER of the two is always
|
||||
budgeted for -- `☀️` is 6 bytes (U+2600 plus an invisible variation
|
||||
selector), `🪫` is 4. With a position in the advert that leaves 17
|
||||
bytes of name. If the name is too long the icon is dropped whole rather than
|
||||
truncated, and `get batt.icon` says so; it also reports the measured voltage
|
||||
and the state the next advert would carry.
|
||||
**Note:** The indicator costs 6 bytes of the name (3 + 3), which with a
|
||||
position in the advert leaves 17. Unicode has only two battery emoji and no
|
||||
"half full" one, and at 4 bytes each they do not fit -- hence block elements,
|
||||
which are 3 bytes and come in eight steps. If the name is too long the whole
|
||||
indicator is dropped rather than truncated, and both `set` and `get` say so.
|
||||
|
||||
**Note:** Switching is hysteretic (`BATT_ICON_HYST_MV`, default 100 mV) so the
|
||||
icon does not follow the daily charge cycle of a solar node. A node drifting at
|
||||
the measured 13 mV/day crosses a threshold about once a month, so the 25 h
|
||||
flood advert interval is not a limitation here.
|
||||
**Note:** Every level is the same byte width on purpose. A name that changed
|
||||
length with the charge would be re-truncated at some steps and not others, and
|
||||
every client that heard it would rewrite the contact.
|
||||
|
||||
**Note:** Switching is hysteretic (`BATT_ICON_HYST_MV`, default 50 mV) and
|
||||
asymmetric -- the level drops as soon as the voltage crosses a boundary but
|
||||
climbs only once clear of it. The measured daily swing of a solar node under
|
||||
weak sun is 38-46 mV and the drift 13 mV/day, so at eight levels the name
|
||||
changes roughly once a week.
|
||||
|
||||
---
|
||||
|
||||
#### Battery threshold for the name icon
|
||||
#### Battery scale for the name icon
|
||||
**Usage:**
|
||||
- `get batt.icon.mv`
|
||||
- `set batt.icon.mv <millivolts>`
|
||||
- `get batt.icon.lo` / `set batt.icon.lo <millivolts>`
|
||||
- `get batt.icon.hi` / `set batt.icon.hi <millivolts>`
|
||||
|
||||
**Set by build flag:** `BATT_ICON_LOW_MV`
|
||||
**Set by build flag:** `BATT_ICON_LO_MV`, `BATT_ICON_HI_MV`
|
||||
|
||||
**Default:** `3700` (roughly 44 % of a 1S Li-Ion cell)
|
||||
**Default:** `3300` and `4200` -- the same 1S Li-Ion scale the dashboards use,
|
||||
so the icon and the Grafana percentage tell one story.
|
||||
|
||||
**Parameters:**
|
||||
- `millivolts`: `3000`..`4200`, or `0` to use the build default
|
||||
- `millivolts`: `2500`..`4500`, or `0` to use the build default
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in new issue
Block a user