defaults ======== .. py:module:: defaults .. autoapi-nested-parse:: 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 ---------- .. autoapisummary:: defaults.HOME_ASSISTANT_URL defaults.FETCH_INTERVAL_S defaults.BATTERY_MODES defaults.LOW_BATTERY_PERCENT defaults.NIGHT defaults.NIGHT_FETCH_INTERVAL_S defaults.AWAKE_AFTER_RESET_S defaults.USB_SENSE_PIN defaults.USB_SENSE_DIVIDER defaults.DISPLAY_OFF_IN_SLEEP defaults.FULL_REFRESH_INTERVAL_S defaults.MAINTENANCE_S defaults.WATCHDOG_S defaults.SHOW_QR_CODE defaults.STATUS_SCREENS defaults.STATUS_SCREEN_PAUSE_S defaults.DEVICE_NAME defaults.DEVICE_MODEL defaults.DEFAULT_TILES defaults.DEFAULT_ALERTS Module Contents --------------- .. py:data:: HOME_ASSISTANT_URL :value: 'http://homeserver.local:8123' Base URL of Home Assistant's REST API. .. py:data:: FETCH_INTERVAL_S :value: 600 Fetch interval on USB power (awake mode). .. py:data:: 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. .. py:data:: LOW_BATTERY_PERCENT :value: 25 Below this level the bottom-left tile asks to charge the board. .. py:data:: 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. .. py:data:: NIGHT_FETCH_INTERVAL_S :value: 3600 Shortest fetch interval at night, see `NIGHT`. .. py:data:: AWAKE_AFTER_RESET_S :value: 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. .. py:data:: USB_SENSE_PIN :value: 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. .. py:data:: USB_SENSE_DIVIDER :value: 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 .. py:data:: DISPLAY_OFF_IN_SLEEP :value: 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. .. py:data:: FULL_REFRESH_INTERVAL_S :value: 3600 Shortest interval between full refreshes. Data updates refresh the screen without flashing; a full refresh flashes but clears ghosting. .. py:data:: MAINTENANCE_S :value: 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. .. py:data:: WATCHDOG_S :value: 120 Restart the board if `main` does 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. .. py:data:: SHOW_QR_CODE :value: 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_sticker` prints the QR code as a sticker for the frame instead. .. py:data:: STATUS_SCREENS :value: 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_S` before going on. Useful while developing; it costs a few seconds and display refreshes per reset. .. py:data:: STATUS_SCREEN_PAUSE_S :value: 2 How long the last line of a status screen stays before going on. .. py:data:: DEVICE_NAME :value: 'ePaper' Name of the board as a device in Home Assistant (MQTT discovery). .. py:data:: DEVICE_MODEL :value: 'Feather ESP32-S3 + Waveshare 4.2"' Model of the board as a device in Home Assistant (MQTT discovery). .. py:data:: DEFAULT_TILES Tiles until others are saved through the web interface. Display order, two per row; see `tiles` for the format. .. py:data:: DEFAULT_ALERTS :value: [] Warning sources until others are saved through the web interface. While one of them is on, a warning screen replaces the tiles (see `alerts`). Set the NINA sensors of your area, for instance, in config.py.