Skip to content

Bug/sensors unavailable#103

Merged
derolli1976 merged 2 commits into
mainfrom
bug/sensors_unavailable
Mar 10, 2026
Merged

Bug/sensors unavailable#103
derolli1976 merged 2 commits into
mainfrom
bug/sensors_unavailable

Conversation

@derolli1976
Copy link
Copy Markdown
Owner

Description

Added a configurable HTTP timeout setting for the Enpal Box data scraping endpoint. The timeout was previously hardcoded to 30 seconds in sensor.py. It is now exposed as a user-configurable option (range: 10–120 seconds) in both the initial setup flow and the options flow, with full DE/EN translations.

Changed files:

  • const.py – New constant DEFAULT_TIMEOUT = 30
  • sensor.py – Reads timeout from config entry options instead of using a hardcoded value
  • config_flow.py – Added timeout field to setup step, options flow, and all related schemas/processing
  • translations/en.json – English label for timeout field
  • translations/de.json – German label for timeout field
  • manifest.json – Version bump to 2.3.1

Motivation and Context

Users with slow Enpal Box web interfaces frequently experienced sensors switching to "Unavailable" because the hardcoded 30-second HTTP timeout was exceeded. This is especially common on first-generation Enpal boxes under load. By making the timeout configurable, users can increase it (e.g. to 60–90s) to avoid transient unavailability without requiring a code change.

How Has This Been Tested?

  • Verified that existing tests still pass (no regressions in parsing or entity logic)
  • Validated that config_flow.py, const.py, and sensor.py have no lint/type errors
  • Confirmed backward compatibility: existing installations without a timeout option fall back to DEFAULT_TIMEOUT = 30
  • Validated voluptuous schema enforces the allowed range (min=10, max=120)

Screenshots (if appropriate):

N/A — UI change is a single additional integer input field in the configuration/options dialog.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@derolli1976 derolli1976 merged commit bc8d1f5 into main Mar 10, 2026
7 checks passed
@derolli1976 derolli1976 deleted the bug/sensors_unavailable branch March 15, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant