Skip to content

Commit 882b903

Browse files
authored
Adds support for LED switches to LED enabled managed UniFi devices and new real-time Trigger system (#66)
- Adds LED control for LED capable UniFi devices - Adding a new `UnifiLedToggleSwitch` entity. - Fetching LED states from the `/stat/device` endpoint. - Allowing users to toggle the LED on/off via a switch entity. - switch entity has additional meta data, including mac address and model id - Extends LED toggle to other devices - Enhance API operation queue with retry logic and device LED control - Added `QueuedOperation` class for managing queued operations with retries. - Enhanced `ApiOperationQueue` to include retry logic and queue management. - Updated LED toggle handling for devices in `switch.py` and `rule.py`. - Update version in manifest.json from 2.3.0-beta.1 to 2.3.0, promoting the beta release to stable. - Refactor GitHub Actions workflows by removing the HACS validation from `hacs-integration.yml` and creating a new `hass-validation.yml` for dedicated Home Assistant validation. This improves workflow organization and clarity. - Implement trigger system for UniFi Network Rules - Addition of a `triggers.yaml` file defining various triggers for rule events (enabled, disabled, changed, deleted). - Refactoring of the websocket message handling to integrate with the new trigger system, allowing for more efficient processing of rule-related events. - Updates to the `coordinator.py` and `trigger.py` files to support the new trigger logic and improve logging for debugging purposes. - Minor adjustments to the `manifest.json` to include the new trigger platform. - Enhance UniFi Network Rules integration with real-time trigger system - Added a new section in `README.md` detailing the real-time triggers, their features, and setup instructions. - Updated `trigger.py` to support device automation style schemas and improved logging for better debugging. - Enabled detailed logging for trigger detection and processing, enhancing the ability to monitor rule changes. - Updated `const.py` to enable trigger logging for state-diff debugging. - Incremented version in `manifest.json` to 3.0.0 to reflect the significant enhancements.
1 parent e103642 commit 882b903

15 files changed

Lines changed: 1976 additions & 324 deletions

File tree

.github/workflows/hacs-integration.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
workflow_dispatch:
55
push:
66
pull_request:
7-
schedule:
8-
- cron: "0 0 * * *"
97

108
permissions:
119
contents: read
@@ -37,24 +35,3 @@ jobs:
3735
description: conclusion === 'success' ? 'HACS validation passed!' : 'HACS validation failed.',
3836
context: 'HACS Validation'
3937
});
40-
41-
validate:
42-
name: Validate with hassfest
43-
runs-on: "ubuntu-latest"
44-
steps:
45-
- uses: "actions/checkout@v4"
46-
- uses: "home-assistant/actions/hassfest@master"
47-
- name: Report Hassfest Status
48-
if: always()
49-
uses: actions/github-script@v7
50-
with:
51-
script: |
52-
const conclusion = '${{ job.status }}'.toLowerCase();
53-
await github.rest.repos.createCommitStatus({
54-
owner: context.repo.owner,
55-
repo: context.repo.repo,
56-
sha: context.sha,
57-
state: conclusion === 'success' ? 'success' : 'failure',
58-
description: conclusion === 'success' ? 'Hassfest validation passed!' : 'Hassfest validation failed.',
59-
context: 'Hassfest Validation'
60-
});
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Home Assistant Validation
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
checks: write
11+
pull-requests: write
12+
statuses: write
13+
14+
jobs:
15+
validate:
16+
name: Validate with hassfest
17+
runs-on: "ubuntu-latest"
18+
steps:
19+
- uses: "actions/checkout@v4"
20+
- uses: "home-assistant/actions/hassfest@master"
21+
- name: Report Hassfest Status
22+
if: always()
23+
uses: actions/github-script@v7
24+
with:
25+
script: |
26+
const conclusion = '${{ job.status }}'.toLowerCase();
27+
await github.rest.repos.createCommitStatus({
28+
owner: context.repo.owner,
29+
repo: context.repo.repo,
30+
sha: context.sha,
31+
state: conclusion === 'success' ? 'success' : 'failure',
32+
description: conclusion === 'success' ? 'Hassfest validation passed!' : 'Hassfest validation failed.',
33+
context: 'Hassfest Validation'
34+
});

0 commit comments

Comments
 (0)