👍🎉 First off, thanks for taking the time to contribute! 🎉👍
The following is a set of guidelines for contributing to Better Thermostat. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
- VSCode
- Docker
- Devcontainer Extension
- Clone the repository
- Open the repository in VSCode
- Click on the green button in the bottom left corner and select "Reopen in Container"
- Wait for the container to build
- Open Task Runner and run "Run Home Assistant on port 9123"
- Open the browser and go to http://localhost:9123 -> Inital DEV HA Setup
- Debuging is possible with the VSCode Debuger. Just run the HomeAssistant in Debugger and open browser on http://localhost:9123 (No task run needed)
- Update your local in devcontainer configuration.yaml to the current version of the repository to get the latest changes. -> Run "Sync configuration.yaml (Override local)" in Task Runner
- Test BT in a specific HA version -> Run "Install a specific version of Home Assistant" in Task Runner and the the version you want to test in the terminal promt.
- Test BT with the latest HA version -> Run "pgrade Home Assistant to latest dev" in Task Runner
If you want to add a new adapter, please create a new python file with the name of the adapter in the adapters folder. The file should contain all functions find in the generic.py. The if you adapter needs a special handling for one of the base functions, override it, if you can use generic functions, use them like:
async def set_temperature(self, entity_id, temperature):
"""Set new target temperature."""
return await generic_set_temperature(self, entity_id, temperature)
You can create an issue if you have any kind of bug or error but please use the issue template.
We use numpy type docstrings. Documentation can be found here:
https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_numpy.html
Install the pip install pre-commit used for pre-commit hooks.