From 489cd7df3da8bc59df38538009139da75f4f0643 Mon Sep 17 00:00:00 2001 From: Tianyu Liu Date: Mon, 22 Jun 2026 20:28:12 +0200 Subject: [PATCH] M5: default Modbus polling to off (opt-in) to avoid unnecessary DB writes --- .env.example | 4 ++-- app/config.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index ba192c6..cf61e22 100644 --- a/.env.example +++ b/.env.example @@ -29,8 +29,8 @@ TICKTICK_CLIENT_SECRET= TICKTICK_TOKEN= HOME_ASSISTANT_ACTION_TASK_PROJECT_ID= -# Optional: Modbus polling (global kill-switch; default true). -# MODBUS_POLLING_ENABLED=true +# Optional: Modbus polling (global kill-switch; default false — opt-in). +# MODBUS_POLLING_ENABLED=false # Optional: MQTT broker connection. # Leave MQTT_ENABLED=false (or unset) when MQTT is not needed. diff --git a/app/config.py b/app/config.py index 2a33b60..5e2a838 100644 --- a/app/config.py +++ b/app/config.py @@ -42,7 +42,9 @@ class Settings(BaseSettings): auth_totp_issuer: str = "" # defaults to app_name when empty # Modbus polling — global kill-switch (CONFIG_FIELDS registered in T08). - modbus_polling_enabled: bool = True + # Off by default: polling is opt-in so a fresh deploy writes no modbus_reading + # rows until the admin explicitly enables it (matches mqtt/discovery defaults). + modbus_polling_enabled: bool = False # MQTT broker connection (T08 wires into CONFIG_FIELDS/UI; T10 builds the client). mqtt_enabled: bool = False