Add automatic red and black night mode for color screens
Default to one hour after sunset through sunrise, using fresh cached GPS or recent direct RF neighbor locations. Provide saved CLI and WebConfig controls with a small integer solar approximation and no additional framebuffer.
This commit is contained in:
1 parent
94139c79be
commit
fb73e3afac
49 files changed
+4072
-2421
No files matched your search
@@ -316,6 +316,7 @@ should use command `0x42`. See [Companion radio binary protocol](companion_proto
|
||||
| Operational | [`advert.zerohop`](cli_commands.md#send-a-zero-hop-advert) | Advert-capable role | Yes | Yes | Yes | Yes | Yes |
|
||||
| Operational | [`erase`](cli_commands.md#erasefactory-reset) | Local connection | Local | Local | Local | Local | Local |
|
||||
| Display | [`get/set display.mode`; `display.timeout`; `display.usb.mode`; `display.usb.timeout`](cli_commands.md#set-display-modes-and-timeouts) | Display-equipped roles; pairing modes require BLE Companion | Feature | Feature | Feature | Feature | Feature |
|
||||
| Night display | [`get/set display.night`; `display.night.delay`](cli_commands.md#set-display-modes-and-timeouts) | Color displays only; auto uses clock and location | Feature | Feature | Feature | Feature | Feature |
|
||||
| Display | [`get/set display.flip`](cli_commands.md#set-mqtt-observer-display-flip) | MQTT observer with supported display driver | No | No | No | Feature | No |
|
||||
| Information | [`ver`](cli_commands.md#get-the-version) | All text CLI roles | Yes | Yes | Yes | Yes | Yes |
|
||||
| Information | [`board`](cli_commands.md#show-the-hardware-name) | All text CLI roles | Yes | Yes | Yes | Yes | Yes |
|
||||
|
||||
@@ -1326,6 +1326,25 @@ saved settings. The WebConfig **Display** card exposes the same controls:
|
||||
Modes are `off`, `on`, `button`, `pairing`, `button-pairing`, and `automatic`.
|
||||
Pairing modes are available only on builds supporting BLE pairing.
|
||||
|
||||
Color displays also support saved night-mode controls in the CLI and WebConfig:
|
||||
|
||||
| Setting | CLI | Default |
|
||||
| --- | --- | --- |
|
||||
| Night mode | `get/set display.night auto\|on\|off` | `auto` |
|
||||
| Minutes after sunset | `get/set display.night.delay -180..180` | `60` |
|
||||
|
||||
Night mode uses red and black only. `auto` starts after sunset plus the selected delay and ends at sunrise. Negative
|
||||
delays start before sunset. Automatic mode requires a valid clock and location;
|
||||
use `on` or `off` to choose manually. Monochrome and headless boards do not
|
||||
support these controls.
|
||||
|
||||
The device's cached GPS fix takes priority. Without GPS, it averages the latest
|
||||
16 distinct neighbors with coordinates heard directly over LoRa in the last
|
||||
12 hours. Relayed, bridged and imported locations do not count. With no usable
|
||||
position, automatic mode keeps normal colors. The small integer approximation
|
||||
uses UTC and longitude, so it needs neither a time zone nor daylight-saving
|
||||
configuration. Screen brightness and screen-off timers still work normally.
|
||||
|
||||
All display-equipped Companion builds show the screen at boot in the default
|
||||
`button` or `button-pairing` mode, on battery or USB power. It stays on for the
|
||||
selected profile's timeout (15 minutes on e-paper, 15 seconds elsewhere).
|
||||
|
||||
Reference in new issue
Block a user