defaults¶
Defaults for everything configurable (versioned).
Per installation, src/config.py (git-ignored, template config_example)
starts with from defaults import * and adds the secrets (WLAN, Home
Assistant token, MQTT login) plus whatever should differ from these
defaults. The firmware only reads config.
Attributes¶
Base URL of Home Assistant's REST API. |
|
Fetch interval on USB power (awake mode). |
|
Fetch interval on battery by charge level. |
|
Below this level the bottom-left tile asks to charge the board. |
|
Night in local time as (start, end) in minutes since midnight. |
|
Shortest fetch interval at night, see |
|
How long the web API stays up after a reset (not a timer wake). |
|
GPIO with a voltage divider from the Feather's "USB" pin (8 = A5). |
|
(upper + lower) / lower resistance. |
|
Switch the display off in deep sleep (Rev2.2 PWR pin). |
|
Shortest interval between full refreshes. |
|
How long the maintenance switch keeps the board awake at most. |
|
Restart the board if |
|
Show a QR code for the web interface in the bottom-left tile. |
|
Show boot sequence and updates on the display (see |
|
How long the last line of a status screen stays before going on. |
|
Name of the board as a device in Home Assistant (MQTT discovery). |
|
Model of the board as a device in Home Assistant (MQTT discovery). |
|
Tiles until others are saved through the web interface. |
|
Warning sources until others are saved through the web interface. |
Module Contents¶
- defaults.HOME_ASSISTANT_URL = 'http://homeserver.local:8123'¶
Base URL of Home Assistant’s REST API.
- defaults.FETCH_INTERVAL_S = 600¶
Fetch interval on USB power (awake mode).
- defaults.BATTERY_MODES¶
Fetch interval on battery by charge level.
Rows of (from percent, fetch interval s, update the clock every minute); the first row the battery reaches applies. The minute clock is off everywhere: it cost too much battery, and the header shows the last and next update instead.
- defaults.LOW_BATTERY_PERCENT = 25¶
Below this level the bottom-left tile asks to charge the board.
- defaults.NIGHT¶
Night in local time as (start, end) in minutes since midnight.
At night there is no minute clock and fetches come at most every
NIGHT_FETCH_INTERVAL_S; None disables the night mode.
- defaults.AWAKE_AFTER_RESET_S = 120¶
How long the web API stays up after a reset (not a timer wake).
The board can then be reached for deploys and debugging before it goes to sleep.
- defaults.USB_SENSE_PIN = None¶
GPIO with a voltage divider from the Feather’s “USB” pin (8 = A5).
It detects USB power directly, wakes the board when USB is plugged in and shows the charging symbol; None judges USB power from the fuel gauge instead, which takes a few minutes after plugging in or out. See the wiring page for the divider.
- defaults.USB_SENSE_DIVIDER = 1.68¶
(upper + lower) / lower resistance.
68 kΩ to the USB pin and 100 kΩ to GND give about 3 V at the pin, safely high enough to wake the board; 100 kΩ/100 kΩ (ratio 2) is measured fine but at 2.5 V too close to the pin’s threshold for waking.
- Type:
Ratio of the USB divider
- defaults.DISPLAY_OFF_IN_SLEEP = True¶
Switch the display off in deep sleep (Rev2.2 PWR pin).
The panel keeps its image without power, and partial refreshes compare against the copy of the image on flash (
screen) either way, so this only saves current. False keeps the display powered, for comparing the sleep current.
- defaults.FULL_REFRESH_INTERVAL_S = 3600¶
Shortest interval between full refreshes.
Data updates refresh the screen without flashing; a full refresh flashes but clears ghosting.
- defaults.MAINTENANCE_S = 1800¶
How long the maintenance switch keeps the board awake at most.
The “Maintenance mode” switch in Home Assistant (or
deploy_wlan) keeps the board awake at its next fetch, for web interface and updates.
- defaults.WATCHDOG_S = 120¶
Restart the board if
maindoes not feed the watchdog for this long.It catches hangs such as in the WLAN driver; the longest regular step, trying all known WLANs, takes about 35 s.
- defaults.SHOW_QR_CODE = False¶
Show a QR code for the web interface in the bottom-left tile.
While the board is awake, the WLAN symbol in the header shows that the web interface can be reached.
qr_stickerprints the QR code as a sticker for the frame instead.
- defaults.STATUS_SCREENS = False¶
Show boot sequence and updates on the display (see
statusscreen).Every start that is not a wake from deep sleep shows “Dashboard startet” and each WLAN connection attempt; an update over the WLAN shows which files it changed before the board restarts. Each pauses
STATUS_SCREEN_PAUSE_Sbefore going on. Useful while developing; it costs a few seconds and display refreshes per reset.
- defaults.STATUS_SCREEN_PAUSE_S = 2¶
How long the last line of a status screen stays before going on.
- defaults.DEVICE_NAME = 'ePaper'¶
Name of the board as a device in Home Assistant (MQTT discovery).
- defaults.DEVICE_MODEL = 'Feather ESP32-S3 + Waveshare 4.2"'¶
Model of the board as a device in Home Assistant (MQTT discovery).