New manual device trigger for LED and future device changes - #85
Merged
Conversation
- 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.
- Implemented a new method in `coordinator.py` to check for device state changes and fire corresponding triggers. - Enhanced `fire_device_trigger_via_dispatcher` to dispatch device change events using Home Assistant's dispatcher pattern. - Updated `switch.py` to fire immediate device triggers for LED toggles, improving responsiveness. - Added support for device change triggers in `trigger.py`, allowing for manual firing and filtering based on device ID and change type. - Improved logging for device trigger events to facilitate better monitoring and debugging.
- Introduced a new trigger for device changes to enhance the integration's capabilities. - Updated the triggers.yaml file to include the 'device_changed' rule so HA properly registers the new trigger.
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.
This pull request introduces several updates to enhance functionality, improve maintainability, and fix minor issues in the custom Home Assistant integration for managing UniFi Network policies and rules. The most significant changes include adding device state change detection and triggers, updating project documentation, and fixing typographical errors in coding standards and comments.
Enhancements to Device State Management:
coordinator.pyto detect device state changes, such as LED toggles and connection state changes, and dispatch triggers using Home Assistant's dispatcher system (fire_device_trigger_via_dispatcherand_check_for_device_state_changes). [1] [2]switch.pyto handle immediate device triggers for LED toggles, bypassing delayed verification for faster feedback. [1] [2]device_changedintrigger.pyto support device-related events, including listener registration for dispatcher signals. [1] [2]Documentation Updates:
.github/copilot-instructions.mdfile to provide an overview of the project, its structure, coding standards, and dependencies.Typographical Fixes in Coding Standards:
.cursor/rules/unr-rules.mdcto improve clarity and professionalism. Examples include fixing "fuctionality" to "functionality" and "retrived" to "retrieved." [1] [2]Dependency and Version Updates:
manifest.jsonfrom3.1.0to3.2.0to reflect the new features and fixes.Minor Code Improvements:
LOG_TRIGGERSto relevant files (coordinator.py,switch.py,trigger.py) to enable logging for device triggers and improve debugging capabilities. [1] [2] [3]