Thank you for your interest in contributing! This guide will help you get started.
- 🐛 Report bugs — open an issue with reproduction steps.
- 💡 Suggest features — open an issue describing the use case.
- 🌍 Add translations — contribute a new language file.
- 🔧 Submit code — fix a bug or implement a feature via pull request.
- 📖 Improve docs — fix typos, add examples, or clarify instructions.
See the Development Guide for full instructions.
Quick start:
git clone https://github.com/Kvikku/ElectricityPriceAddon.git
cd ElectricityPriceAddon
python -m venv .venv
source .venv/bin/activate
pip install pytest aiohttp ruff- Fork the repository and create a feature branch from
main. - Make your changes — keep them focused and minimal.
- Add or update tests for any new functionality.
- Run the checks before submitting:
ruff check . ruff format --check . pytest tests/ -v
- Update documentation if your changes affect user-facing behavior.
- Open a pull request with a clear description of what and why.
Use clear, descriptive commit messages:
Add: new sensor for daily price rangeFix: handle missing tomorrow prices gracefullyDocs: update automation examplesRefactor: extract price calculation to helper
- Python 3.12+, with
from __future__ import annotations. - Type hints on all function signatures.
- Docstrings on public classes and methods.
- Constants in
const.py, not inline. - Linted and formatted with Ruff.
- Copy
custom_components/norway_electricity/translations/en.jsonto a new file named with the BCP 47 language code (e.g.,sv.jsonfor Swedish). - Translate all values (keep the keys unchanged).
- Submit a pull request.
Note:
strings.jsonis the source of truth for English strings andtranslations/en.jsonmust always be an identical copy. If you change one, update the other to match.
When reporting a bug, please include:
- Home Assistant version
- Integration version (from
manifest.json) - Price area configured
- Relevant log entries (Settings → System → Logs)
- Steps to reproduce
Be respectful and constructive. We're all here to build something useful for the Home Assistant community.
By contributing, you agree that your contributions will be licensed under the same MIT License that covers the project.