-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathunr-rules.mdc
More file actions
28 lines (22 loc) · 2.01 KB
/
Copy pathunr-rules.mdc
File metadata and controls
28 lines (22 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
---
description: Purpose of this custom home assistant integration along with general coding practices and scope guidance
globs: custom_components/**/*.py
alwaysApply: true
---
## Rules
- Always keep the code DRY for testability and separation of concerns
- Prefer modern idiomatic Python 3.13 and open source conventions, Leverage type hints, use CONST over hard coded strings
- 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.
- Diagnostics enabled for observability and debugging should be targeted, respecting the resources of the system
- All data retrieved and stored from the API should be typed, if not supplied by aiounifi, then a custom type should be created
- When designing a new feature, prefer elegant solutions using established best practices and patterns.
- When fixing a problem or bug, avoid treating the symptom, look for the root cause.
- Details matter, ensure to always preserve existing functionality unless otherwise instructed.
- KISS
## Notes
- If a reference to the aiounifi library is needed or required, check for a local copy in the root /aiounifi
- Changes preserving backwards compatibility may not be required, ask before assuming.
- Avoid excessive code comments
- Keep a rolling log of each change you make in a file called changelog.md
## Purpose
The focus of this home assistant custom integration is to extend the functionality of the Unifi Network application within the home assistant ecosystem. Build upon the home assistant unifi core integration and the aiounifi library. Bundling and enabling advanced automation, customizable backup and restore, and to be generally useful for homelab and home automation environments. Some examples: enhancing guest network access. Managing child device access. Promoting good security practices. This is open source and should remain accessible and usable by a wide variety of users and supported devices.