Skip to content

Instantly share code, notes, and snippets.

@sirkirby
Last active March 24, 2025 16:47
Show Gist options
  • Save sirkirby/e4491f4892c5648dd9ac2eedd8852bad to your computer and use it in GitHub Desktop.
Save sirkirby/e4491f4892c5648dd9ac2eedd8852bad to your computer and use it in GitHub Desktop.
Unfi Network Rules Home assistant custom integration general rules

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 fuctionality. Leverage the latest Home Assistant documentation.
  • Diagnostics enabled for observability and debugging should be targeted, respecting the resources of the system
  • 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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment