Skip to content

Commit 54d3500

Browse files
committed
Update coding practices and add project overview documentation
- Corrected typos in the coding standards section of the rules file. - Added a new copilot instructions file outlining the project structure, libraries, and coding standards for the custom Home Assistant integration.
1 parent b6343a0 commit 54d3500

2 files changed

Lines changed: 40 additions & 5 deletions

File tree

.cursor/rules/unr-rules.mdc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
description: Purpose of this custom home assistant integration along with general coding practics and scope guidance
2+
description: Purpose of this custom home assistant integration along with general coding practices and scope guidance
33
globs: custom_components/**/*.py
44
alwaysApply: true
55
---
@@ -8,12 +8,12 @@ alwaysApply: true
88

99
- Always keep the code DRY for testability and separation of concerns
1010
- Prefer modern idiomatic Python 3.13 and open source conventions, Leverage type hints, use CONST over hard coded strings
11-
- Prioritize native Home Assistant libraries, like aiounifi, and other core capabilities to respect available resources and to avoid building duplicate fuctionality. Leverage the latest Home Assistant documentation.
11+
- 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.
1212
- Diagnostics enabled for observability and debugging should be targeted, respecting the resources of the system
13-
- All data retrived and stored from the API should be typed, if not supplied by aiounifi, then a custom type should be created
13+
- All data retrieved and stored from the API should be typed, if not supplied by aiounifi, then a custom type should be created
1414
- When designing a new feature, prefer elegant solutions using established best practices and patterns.
15-
- When fixing a problem or bug, avoid treating the symptop, look for the root cause.
16-
- Details matter, ensure to always preserve existing functionlity unless otherwise instructed.
15+
- When fixing a problem or bug, avoid treating the symptom, look for the root cause.
16+
- Details matter, ensure to always preserve existing functionality unless otherwise instructed.
1717
- KISS
1818

1919
## Notes

.github/copilot-instructions.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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

Comments
 (0)