Add support for network objects and profiles in UniFi integration - #97
Merged
Conversation
- Introduced new API endpoints and paths for managing network objects, port profiles, WLAN rate profiles, RADIUS profiles, and WAN SLA profiles. - Added a service to sync remote curated groups from specified URLs, enhancing firewall group management. - Updated the manifest version to 3.3.0 and required aiounifi version to 84.0.0. - Implemented mixins for handling various profile types and added utility functions for fetching and parsing curated lists.
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for network objects and profiles in the UniFi Network Rules integration, introducing a new service for syncing curated firewall groups from remote URLs. The changes primarily expand the integration's API capabilities and enable automated firewall group management from external sources.
- Added network objects model and API mixins for managing firewall groups and various profile types
- Introduced a service to fetch and sync curated firewall groups from remote text files
- Updated dependencies and version numbers to support new features
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
utils/remote_lists.py |
Added utility functions for building raw URLs from repository URLs and parsing curated list text files |
udm/profiles.py |
Implemented mixins for managing port, WLAN rate, RADIUS, and WAN SLA profiles |
udm/objects.py |
Added ObjectsMixin for managing firewall groups as network objects with CRUD operations |
udm/api.py |
Extended UDMAPI class to inherit from new profile and object mixins |
services/system_services.py |
Added sync_remote_curated service handler for fetching and processing remote firewall group lists |
services/constants.py |
Added new service constants for remote curated group synchronization |
services.yaml |
Added service definition for sync_remote_curated functionality |
models/network_object.py |
Defined NetworkObject model and TypedDict structures for network objects |
manifest.json |
Updated aiounifi dependency to version 84.0.0 and integration version to 3.3.0 |
const.py |
Added new API endpoints and path constants for objects and profiles |
…cy based on review suggestions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #89
This pull request introduces support for syncing curated firewall groups from remote text files, adds new models and API mixins for UniFi network objects, and updates the integration to use the latest
aiounifilibrary. The changes primarily focus on enabling users to fetch and manage firewall groups (objects) from external sources, improving extensibility and automation.Remote Curated Groups Sync Feature:
sync_remote_curatedservice, allowing users to fetch curated firewall group lists from public raw URLs and create or update corresponding firewall groups in UniFi. This includes schema validation, parsing, and enforcement of type-specific members. (services.yaml,services/constants.py,services/system_services.py) [1] [2] [3]Network Object Model and API Enhancements:
NetworkObjectmodel and related typed representations for firewall groups and their members, enabling structured handling of object data. (models/network_object.py)ObjectsMixinclass to the UDM API, providing methods to list, add, update, and remove firewall groups as network objects. (udm/objects.py,udm/api.py) [1] [2]Constants and Endpoint Updates:
const.py) [1] [2]services/constants.py)Dependency and Version Updates:
aiounifiversion to84.0.0and bumped the integration version to3.3.0. (manifest.json)These changes collectively enable the integration to automate firewall group management based on external curated lists, improve the internal data model for network objects, and prepare for further extensibility.