Conversation
…omments in validation
… use of Ruff for linting
…ptions, add version inputs
…t and error handling details
…n keys; enhance error handling and add reconfiguration support in config flow
…res, development scripts, and next steps
…anslations for clarity
…sary constructor parameters; streamline entity initialization
There was a problem hiding this comment.
Pull Request Overview
This PR modernizes the integration blueprint and development workflow for a 2025 update, aligning with current Home Assistant and tooling practices.
- Adopt uv for dependency management and Ruff for linting/formatting (with pre-commit and CI updates).
- Introduce config flow reconfiguration and diagnostics, and improve error handling with translatable exceptions.
- Streamline scripts with Scripts to Rule Them All and update documentation accordingly.
Reviewed Changes
Copilot reviewed 29 out of 31 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/update | Adds update script that re-runs bootstrap after pull. |
| scripts/setup | Switches to sh and delegates to bootstrap. |
| scripts/motd | Adds a development environment MOTD and exposes scripts/help. |
| scripts/lint-check | Adds non-mutating lint check via uv+ruff for CI. |
| scripts/lint | Runs Ruff format and check with uv and better messages. |
| scripts/help | Adds a helper to list scripts and descriptions. |
| scripts/bootstrap | Installs uv (via pipx), deps via uv, and pre-commit hooks. |
| pyproject.toml | Moves Ruff config to pyproject and sets Python 3.13. |
| hacs.json | Updates minimum Home Assistant version. |
| translations/en.json | Adds entity names and exception messages; reconfigure texts. |
| switch.py | Adds translated errors, logging, and translation_key for entity. |
| sensor.py | Uses translation_key for entity; simplifies init. |
| entity.py | Centralizes entity init with entity_description and unique_id scheme. |
| diagnostics.py | Adds config entry diagnostics endpoint. |
| coordinator.py | Adds translated exceptions and docs improvements. |
| config_flow.py | Adds reconfigure step and centralizes error mapping. |
| binary_sensor.py | Uses translation_key and simplifies init. |
| api.py | Switches to asyncio.timeout and removes async_timeout; minor cleanup. |
| config/configuration.yaml | Adds logger filters for common noisy logs. |
| README.md | Major documentation overhaul aligning with new tooling and features. |
| CONTRIBUTING.md | Updates workflow steps; switches to Ruff and scripts. |
| .ruff.toml | Removes redundant Ruff config (moved to pyproject). |
| .pre-commit-config.yaml | Adds local ruff hooks using system environment. |
| .github/workflows/validate.yml | Minor wording update in comments. |
| .github/workflows/lint.yml | Uses setup-uv and scripts for linting in CI. |
| .github/pull_request_template.md | Adds a PR template. |
| .github/ISSUE_TEMPLATE/* | Improves issue templates with labels and fields. |
| .devcontainer.json | Updates container name and adds MOTD on start. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| except Exception as exception: | ||
| msg = f"Something really wrong happened! - {exception}" | ||
| raise IntegrationBlueprintApiClientError( | ||
| msg, |
There was a problem hiding this comment.
Catching Exception is flagged by Ruff (BLE001) under your configuration (select = ["ALL"]). Either narrow the exception handling to expected errors or add an inline suppression to keep the intent explicit.
| """Get information from the API.""" | ||
| try: | ||
| async with async_timeout.timeout(10): | ||
| async with asyncio.timeout(10): |
There was a problem hiding this comment.
Since this uses asyncio.timeout, ensure the corresponding except clause catches asyncio.TimeoutError (not just the built-in TimeoutError) so timeouts are handled reliably across Python versions. Update the timeout except handler accordingly.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
I wonder if this will make it easier to run HA versions |
|
Not yet, which is why this is still open, it is not working. |
|
I was able to takle it at http://github.com/jpawlowski/hass.tibber_prices but not sure if that's the way it is supposed to be. I could create a separate PR to make some suggestions if you want? |
|
please do 👍 |
No description provided.