From 1c601a2c4b8c0a735a6be5383ac96ef0c1d7059a Mon Sep 17 00:00:00 2001 From: Simon Clark Date: Sun, 22 Feb 2026 20:48:37 +0000 Subject: [PATCH] Add schedule/action group methods and open source contributing guide Update documentation with new Indigo 2025.1 methods for schedules (duplicate, execute, getDependencies, moveToFolder, removeDelayedActions) and action groups (duplicate, execute with event_data, getDependencies, moveToFolder, displayInRemoteUI). Add open source contribution workflow guide for IndigoDomotics GitHub organization. Co-Authored-By: Claude Opus 4.6 --- docs/api/iom/command-namespaces.md | 42 ++++++++++++++-- docs/patterns/api-patterns.md | 60 ++++++++++++++++++++++- docs/patterns/open-source-contributing.md | 59 ++++++++++++++++++++++ skill.md | 13 ++++- 4 files changed, 169 insertions(+), 5 deletions(-) create mode 100644 docs/patterns/open-source-contributing.md diff --git a/docs/api/iom/command-namespaces.md b/docs/api/iom/command-namespaces.md index ca69556..955accd 100644 --- a/docs/api/iom/command-namespaces.md +++ b/docs/api/iom/command-namespaces.md @@ -155,11 +155,27 @@ indigo.variable.moveToFolder(var_or_id, folder_id) # Execute action group indigo.actionGroup.execute(ag_or_id) +# Execute with event data (indigo.Dict passed to actions) +# Indigo auto-adds "source" key ("server", "python", "api-http", or "api-websocket") +indigo.actionGroup.execute(ag_or_id, event_data=some_dict) + # Enable/disable indigo.actionGroup.enable(ag_or_id, value=True) # Delete indigo.actionGroup.delete(ag_or_id) + +# Duplicate (returns new action group instance) +indigo.actionGroup.duplicate(ag_or_id, duplicateName="Copy of AG") + +# Move to folder +indigo.actionGroup.moveToFolder(ag_or_id, value=folder_id) + +# Display in remote UI +indigo.actionGroup.displayInRemoteUI(ag_or_id, value=True) + +# Get dependencies (returns indigo.Dict of dependent objects) +indigo.actionGroup.getDependencies(ag_or_id) ``` ## Schedule Commands @@ -169,11 +185,28 @@ indigo.actionGroup.delete(ag_or_id) | `indigo.Schedule` | `indigo.schedule.*` | ```python -# Enable/disable -indigo.schedule.enable(sched_or_id, value=True) +# Enable/disable (with optional delay and duration in seconds) +indigo.schedule.enable(sched_or_id, value=True, delay=0, duration=0) # Delete indigo.schedule.delete(sched_or_id) + +# Duplicate (returns new schedule instance) +indigo.schedule.duplicate(sched_or_id, duplicateName="Copy of Schedule") + +# Execute immediately +# ignoreConditions: bypass any schedule conditions +# schedule_data: indigo.Dict with optional metadata (Indigo auto-adds "source" and "timestamp") +indigo.schedule.execute(sched_or_id, ignoreConditions=False, schedule_data=None) + +# Move to folder +indigo.schedule.moveToFolder(sched_or_id, value=folder_id) + +# Get dependencies (returns indigo.Dict of dependent objects) +indigo.schedule.getDependencies(sched_or_id) + +# Remove any pending delayed actions +indigo.schedule.removeDelayedActions(sched_or_id) ``` ## Protocol-Specific Commands @@ -213,7 +246,10 @@ All namespaces support these methods for their object type: | Method | Description | |--------|-------------| | `create()` | Create new object | -| `duplicate()` | Duplicate existing object | +| `duplicate()` | Duplicate existing object (returns new instance) | | `delete()` | Delete object | | `enable()` | Enable/disable object | +| `execute()` | Execute object (action groups, schedules) | | `moveToFolder()` | Move to folder | +| `getDependencies()` | Get dependent Indigo objects (returns `indigo.Dict`) | +| `removeDelayedActions()` | Remove pending delayed actions (schedules) | diff --git a/docs/patterns/api-patterns.md b/docs/patterns/api-patterns.md index 5fbb90e..263ea81 100644 --- a/docs/patterns/api-patterns.md +++ b/docs/patterns/api-patterns.md @@ -164,7 +164,9 @@ def get_variable_value(self, name, default=""): return default ``` -## Action Group Execution +## Action Group Patterns + +### Execute ```python # By ID @@ -173,6 +175,62 @@ indigo.actionGroup.execute(123456) # By name ag = indigo.actionGroups["Morning Routine"] indigo.actionGroup.execute(ag.id) + +# With event data (passed to actions in the group) +event_data = indigo.Dict() +event_data["scene"] = "evening" +indigo.actionGroup.execute(ag.id, event_data=event_data) +``` + +### Dependencies and Management + +```python +# Check what depends on an action group before deleting +deps = indigo.actionGroup.getDependencies(ag.id) +if deps: + indigo.server.log(f"Action group has dependencies: {deps}") + +# Duplicate an action group +new_ag = indigo.actionGroup.duplicate(ag.id, duplicateName="Morning Routine v2") + +# Move to a folder +indigo.actionGroup.moveToFolder(ag.id, value=folder_id) +``` + +## Schedule Patterns + +### Execute and Control + +```python +# Execute a schedule immediately +indigo.schedule.execute(sched.id) + +# Execute ignoring conditions +indigo.schedule.execute(sched.id, ignoreConditions=True) + +# Execute with metadata +sched_data = indigo.Dict() +sched_data["reason"] = "manual override" +indigo.schedule.execute(sched.id, schedule_data=sched_data) + +# Enable with delay (seconds before activation) and duration (auto-disable after) +indigo.schedule.enable(sched.id, value=True, delay=30, duration=3600) + +# Cancel pending delayed actions +indigo.schedule.removeDelayedActions(sched.id) +``` + +### Dependencies and Management + +```python +# Check dependencies before deletion +deps = indigo.schedule.getDependencies(sched.id) + +# Duplicate a schedule +new_sched = indigo.schedule.duplicate(sched.id, duplicateName="Weekday Backup") + +# Move to a folder +indigo.schedule.moveToFolder(sched.id, value=folder_id) ``` ## Logging Patterns diff --git a/docs/patterns/open-source-contributing.md b/docs/patterns/open-source-contributing.md new file mode 100644 index 0000000..2b7d1b2 --- /dev/null +++ b/docs/patterns/open-source-contributing.md @@ -0,0 +1,59 @@ +# Contributing to Indigo Open Source Plugins + +The [IndigoDomotics GitHub organization](https://github.com/IndigoDomotics) hosts curated open-source Indigo plugins. This guide covers the contribution workflow for submitting changes or new plugins. + +## Contribution Workflow + +### 1. Create an Issue + +Open an issue in the relevant repository to discuss planned changes before starting work. This prevents conflicts with other developers and helps flesh out the approach. Skip this step only when addressing an existing issue. + +### 2. Fork the Repository + +Fork the repository on GitHub. Keep the fork updated using GitHub's "Fetch & Merge" button before starting new work. + +### 3. Make Changes + +Implement modifications in the fork. Use unit testing where available and add new tests for changes. Follow the coding and style guide from the [.github repository](https://github.com/IndigoDomotics/.github). + +### 4. Comment Changes + +Add comments explaining major modifications to help reviewers understand the intent behind changes. + +### 5. Commit and Push + +Push regularly to the fork as a backup. Use clear, descriptive commit messages. + +### 6. Create Beta Releases (Optional) + +Create beta releases in the fork for testing with beta testers when possible. This helps catch environment-specific issues before the official review. + +### 7. Submit Pull Request + +Create a pull request linking to the issue(s) the changes address. Include a clear description of what changed and why. + +### 8. Review Process + +An open source manager reviews the submission and provides feedback. Address any requested changes and update the PR. + +### 9. Approval and Merge + +Once approved, managers merge the changes, generate official releases, and update the Indigo Plugin Store. + +### 10. Issue Closure + +Linked issues are closed with the release version number noted. + +## Key Guidelines + +- **Discuss first**: Always create an issue before significant work to avoid conflicts +- **Test thoroughly**: Use and add unit tests where available +- **Follow style guides**: Check the [.github repository](https://github.com/IndigoDomotics/.github) for coding standards +- **Keep PRs focused**: Address one issue or feature per pull request +- **Document changes**: Comment code and describe PR changes clearly + +## Resources + +- **Organization**: https://github.com/IndigoDomotics +- **Style Guide**: https://github.com/IndigoDomotics/.github +- **Developer Forum**: https://forums.indigodomo.com/viewforum.php?f=18 diff --git a/skill.md b/skill.md index bde2062..c5db28c 100644 --- a/skill.md +++ b/skill.md @@ -25,6 +25,7 @@ Community-maintained expert assistant for Indigo home automation plugin developm | `docs/examples/sdk-examples-guide.md` | 8KB | Example catalog | | `docs/troubleshooting/common-issues.md` | 11KB | Troubleshooting | | `docs/patterns/api-patterns.md` | 5KB | Common API patterns | +| `docs/patterns/open-source-contributing.md` | 3KB | Contributing to IndigoDomotics open source | ### Modular IOM Reference (Load by Topic) @@ -63,6 +64,8 @@ These are complementary - load based on question type: | Custom events, Events.xml | `docs/concepts/events.md` | | Filters/iteration | `docs/api/iom/filters.md` | | Subscriptions | `docs/api/iom/subscriptions.md` | +| Schedule/action group commands | `docs/api/iom/command-namespaces.md` | +| Open source contributing | `docs/patterns/open-source-contributing.md` | ### Specific Routing @@ -85,6 +88,13 @@ These are complementary - load based on question type: **"How do I update device state?"** 1. Read `docs/patterns/api-patterns.md` +**"How do I execute/manage schedules or action groups?"** +1. Read `docs/api/iom/command-namespaces.md` +2. Read `docs/patterns/api-patterns.md` + +**"How do I contribute to open source?" / "Add plugin to IndigoDomotics"** +1. Read `docs/patterns/open-source-contributing.md` + **"What device properties exist?"** 1. Read `docs/api/iom/devices.md` @@ -128,7 +138,8 @@ docs/ │ ├── containers.md # Dict/List (3KB) │ └── utilities.md # Helpers (4KB) ├── patterns/ -│ └── api-patterns.md # Common patterns (5KB) +│ ├── api-patterns.md # Common patterns (5KB) +│ └── open-source-contributing.md # IndigoDomotics contributing guide (3KB) ├── examples/ │ └── sdk-examples-guide.md # Example catalog (8KB) └── troubleshooting/