Development & Contributing ๐ฉโ๐ป
Thank you for your interest in improving ha-db_infoscreen! This guide explains how to set up your environment, run tests, and contribute changes.
๐ ๏ธ Local Environment Setup
To get started with development, you'll need Python 3.12+ installed.
-
Clone the repository:
-
Create a virtual environment:
-
Install dependencies:
๐งช Testing
We value stability. All Pull Requests must pass our automated test suite.
Running Tests
We use pytest for all tests.
Key Test Suites
tests/test_config_flow.py: Verifies the setup wizard and options menu.tests/test_stability.py: Ensures the integration handles API errors and malformed data gracefully.tests/test_translations.py: Checks for consistency across all language files.
๐ค CI/CD & Renovate
We use GitHub Actions to automate our quality control and deployment.
Automated API Validation
Our backend-api-update.yml workflow is a unique "early warning system".
-
Renovate monitors the db-fakedisplay project.
-
When a new backend version is released, Renovate opens a PR updating our
.backend_version. -
The CI automatically runs our stability tests against this new version.
-
If it passes, we know the integration is safe to use with the new backend.
Documentation Deployment
The documentation (this site!) is automatically built and deployed to GitHub Pages whenever changes are pushed to main.
๐ Translations
Help us reach more users by contributing translations!
- Add your language code to
custom_components/db_infoscreen/translations/(e.g.,fr.json). - Use
en.jsonorde.jsonas a template. - Run
pytest tests/test_translations.pyto ensure all keys are present.
๐ Pull Request Guidelines
- Issue First: For major changes, please open an issue first to discuss your proposal.
- Formatting: We use
blackfor code formatting andrufffor linting. - Documentation: If you add a new feature, please update the relevant
.mdfile in thedocs/folder.