|
| 1 | +# Project Overview |
| 2 | + |
| 3 | +This project is a custom home assistant integration to manage UniFi Network policies and rules. It is designed to provide a seamless and efficient way to manage and automate your home network policies and rules within home assistant. |
| 4 | + |
| 5 | +## Project Structure |
| 6 | + |
| 7 | +The project is organized into the following directories: |
| 8 | + |
| 9 | +- `custom_components/unifi_network_rules`: The custom home assistant integration |
| 10 | +- - `udm`: Code for interacting with the Unifi Network API |
| 11 | +- - `models`: data models |
| 12 | +- - `services`: custom services |
| 13 | +- - `helpers`: helper functions |
| 14 | +- - `utils`: utility functions |
| 15 | +- - `manifest.json`: The manifest for the integration. |
| 16 | +- `tests`: The test suite. |
| 17 | +- `docs`: The documentation. |
| 18 | + |
| 19 | +## Libraries and Frameworks |
| 20 | + |
| 21 | +- `aiounifi`: The library for interacting with the Unifi Network API |
| 22 | +- `homeassistant`: The library for interacting with the Home Assistant API |
| 23 | +- python 3.13 |
| 24 | + |
| 25 | +## Coding Standards |
| 26 | + |
| 27 | +- Always keep the code DRY for testability and separation of concerns |
| 28 | +- Prefer modern idiomatic Python 3.13 and open source conventions, Leverage type hints, use CONST over hard coded strings |
| 29 | +- Prioritize native Home Assistant libraries, like aiounifi, and other core capabilities to respect available resources and to avoid building duplicate functionality. Leverage the latest Home Assistant documentation. |
| 30 | +- Diagnostics enabled for observability and debugging should be targeted, respecting the resources of the system |
| 31 | +- All data retrieved and stored from the API should be typed, if not supplied by aiounifi, then a custom type should be created |
| 32 | +- When designing a new feature, prefer elegant solutions using established best practices and patterns. |
| 33 | +- When fixing a problem or bug, avoid treating the symptom, look for the root cause. |
| 34 | +- Details matter, ensure to always preserve existing functionality unless otherwise instructed. |
| 35 | +- KISS |
0 commit comments