Skip to content

Fixes triggers for HA 2025.7 release, performance optimizations, and extensive documentation updates - #76

Merged
sirkirby merged 3 commits into
mainfrom
dev
Jul 3, 2025
Merged

Fixes triggers for HA 2025.7 release, performance optimizations, and extensive documentation updates#76
sirkirby merged 3 commits into
mainfrom
dev

Conversation

@sirkirby

@sirkirby sirkirby commented Jul 3, 2025

Copy link
Copy Markdown
Owner

This pull request updates the README.md file to improve clarity, reorganize content, and enhance automation examples, while also introducing a minor code update in the const.py and coordinator.py files. The changes focus on improving user guidance for the UniFi Network Rules integration and refining internal operation tracking.

Documentation Improvements:

  • Reorganized the "Features" section into clearer categories, such as "Switches for enabling and disabling rules" and "Advanced automations powered by Custom Triggers and Services" (README.md).
  • Added YAML-based examples for automation use cases, including security monitoring, game server management, and VPN connection handling (README.md) [1] [2] [3].
  • Enhanced troubleshooting guidance for custom triggers, addressing UI and validation errors in Home Assistant 2025.7.0 (README.md).

Automation Enhancements:

  • Updated trigger configurations to use a more concise YAML format, replacing type and trigger keys with a unified structure (README.md) [1] [2].
  • Improved examples of real-time triggers, such as monitoring parental controls and creating notifications for rule changes (README.md) [1] [2].

Codebase Updates:

  • Added SWITCH_DELAYED_VERIFICATION_SLEEP_SECONDS constant to const.py to introduce a delay for switch state verification (custom_components/unifi_network_rules/const.py).
  • Introduced _ha_initiated_operations in coordinator.py to track operations initiated by Home Assistant, preventing redundant refreshes and race conditions (custom_components/unifi_network_rules/coordinator.py).

… updates (#74)

- Enhance UniFi Network Rules integration with CQRS-style operation tracking and delayed verification
- Introduced a new mechanism in `coordinator.py` to track Home Assistant initiated operations, attempting to prevent redundant refreshes.
- Added delayed verification logic in `switch.py` to ensure state consistency after operations.
- Incremented version in `manifest.json` to 3.1.0 to reflect these enhancements.
- Revised the README.md to enhance clarity on integration features and usage, including a new section on advanced automations.
- Updated the features list to provide a more detailed overview of supported rules and configurations.
- Removed the `reset_rate_limit` service from services.yaml and its implementation in system_services.py to streamline functionality.
- Remove `reset_rate_limit` service from the integration to streamline functionality and improve code clarity. Updated related imports and constants accordingly.
- Revised the README.md to clarify the limitations of the automation UI and provide updated YAML configuration examples.
- Enhanced the trigger.py file by removing unused code and improving the validation process for trigger configurations.
- Incremented the version in manifest.json to 3.1.0 to reflect these updates.
- Modified trigger.py to handle asynchronous action execution more effectively, ensuring proper task scheduling.
- Enhanced logging for trigger events to improve debugging and monitoring capabilities.
- Updated the security monitoring section to clarify notification creation for firewall policy changes.
- Added a new automation example for handling UniFi policy changes with detailed notification messages.
- Revised the VPN connection monitoring section to include a specific client reconnection automation and improved messaging for connection status notifications.
@sirkirby sirkirby self-assigned this Jul 3, 2025
@sirkirby sirkirby added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request labels Jul 3, 2025
sirkirby and others added 2 commits July 3, 2025 01:34
- Enhanced the `async_toggle_rule`, `async_delete_rule`, and `async_bulk_update_rules` functions to handle VPN clients and servers.
- Introduced helper functions for toggling and deleting VPN configurations.
- Updated rule type handling to include VPN clients and servers in the relevant operations, improving the integration's capabilities.
Add support for VPN clients and servers in rule management service
@sirkirby
sirkirby marked this pull request as ready for review July 3, 2025 13:22
@sirkirby

sirkirby commented Jul 3, 2025

Copy link
Copy Markdown
Owner Author

Updated the rules service to properly support VPN switches and use the API queue for better rate limit management.

@sirkirby
sirkirby merged commit b6343a0 into main Jul 3, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant