Fix: Remove incorrect super().startup() and super().shutdown() calls from documentation#2
Conversation
BREAKING BUG FIX: Documentation incorrectly instructed developers to call super().startup() and super().shutdown(), which don't exist in indigo.PluginBase. This caused AttributeError exceptions in all plugins created using the docs. Root Cause: - Documentation was written without validating against official SDK examples - All 16 official SDK examples show NO super() calls in startup/shutdown - startup() and shutdown() are pure callbacks with no parent implementation Changes: - snippets/plugin-base-template.py: Removed super() calls, added clarifying notes - docs/concepts/plugin-lifecycle.md: Fixed 8+ incorrect examples - docs/quick-start.md: Corrected "Common Mistakes" section - docs/troubleshooting/README.md: Fixed debug example - docs/troubleshooting/common-issues.md: Added AttributeError troubleshooting Impact: - Fixes critical bug that broke all plugins created from templates - Aligns documentation with official SDK examples - Adds clear guidance on which methods need super() calls Testing: - Created test plugin following old docs: AttributeError ❌ - Created test plugin following new docs: Works correctly ✅ Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughUpdates documentation and plugin examples to remove calls to Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/concepts/plugin-lifecycle.md (1)
595-608: Checklist item contradicts the new guidance.Line 599 states "✅
super()called in all lifecycle methods" but this directly contradicts the documentation changes in this PR. The guidance now explicitly states thatstartup()andshutdown()should NOT callsuper().Suggested fix
## Resource Management Checklist - [ ] All instance variables initialized in `__init__()` - [ ] No Indigo database access in `__init__()` -- [ ] `super()` called in all lifecycle methods +- [ ] `super().__init__()` called in `__init__()` (required) +- [ ] `super()` called in device callbacks like `deviceStartComm()` (recommended) +- [ ] `super()` NOT called in `startup()` or `shutdown()` - [ ] Connections opened in `startup()` - [ ] Event subscriptions done in `startup()`
The checklist incorrectly stated 'super() called in all lifecycle methods'. This contradicts the new guidance that startup() and shutdown() should NOT call super(). Changed to specific guidance: - Required: super().__init__() in __init__() - Recommended: super() in device callbacks (deviceStartComm, etc.) - DO NOT: super() in startup() or shutdown() Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Updated all references from old repo (indigo-community/indigo-skill) to current repo (simons-plugins/indigo-claude-skill). This fixes the link validation workflow failures: - Updated 9 markdown files - Fixed 22 broken GitHub links (issues, discussions, pulls) - Resolves 404 errors in CI/CD checks Files updated: - CONTRIBUTING.md - QUICK_START.md - README.md - ROADMAP.md - docs/quick-start.md - docs/troubleshooting/README.md - reference/README.md - sdk-examples/README.md - skill.md Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixed: - QUICK_START.md: Updated install script URL to new repository - CONTRIBUTING.md: Updated fork/clone example to use correct repo name These were 404 dead links pointing to the old indigo-community/indigo-skill repository. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Bug: Documentation incorrectly instructs calling super().startup() and super().shutdown()
Summary
The Indigo skill documentation contains incorrect guidance that tells developers to call
super().startup()andsuper().shutdown()in their plugin code. These methods do not exist inindigo.PluginBase, causingAttributeErrorexceptions when developers follow the documentation.Impact
Severity: High - Breaks all plugins created using the documentation/templates
Affected Components:
snippets/plugin-base-template.py- Template code hadsuper().startup()andsuper().shutdown()docs/concepts/plugin-lifecycle.md- Multiple examples showing incorrect super() callsdocs/quick-start.md- "Common Mistakes" section showed wrong patterndocs/troubleshooting/README.md- Debug examples had super() callsThe Problem
What the Documentation Said (WRONG)
What the SDK Examples Actually Do (CORRECT)
Checked all 16 official SDK examples - ZERO call
super().startup()orsuper().shutdown():Examples:
def startup(self): pass(no super)def startup(self): self.logger.debug("startup called")(no super)Root Cause
The documentation was written incorrectly without validating against the official SDK examples. The methods
startup()andshutdown()are pure callbacks with no parent implementation inindigo.PluginBase.Error Produced
When developers follow the documentation, they get:
Which Methods Actually Need super()?
__init__()super().__init__(...)startup()shutdown()deviceStartComm()super().deviceStartComm(dev)deviceStopComm()super().deviceStopComm(dev)deviceUpdated()super().deviceUpdated(origDev, newDev)variableUpdated()super().variableUpdated(origVar, newVar)The Fix
Correct Pattern
Files Fixed
snippets/plugin-base-template.py
super().startup()callsuper().shutdown()calldocs/concepts/plugin-lifecycle.md
docs/quick-start.md
docs/troubleshooting/README.md
docs/troubleshooting/common-issues.md
Testing
Created a test Netro sprinkler plugin following the OLD documentation:
AttributeError: 'super' object has no attribute 'startup'References
sdk-examples/directoryLesson Learned
Always validate documentation against official SDK examples before adding it to community resources. The SDK examples are the source of truth.
Summary by CodeRabbit
Documentation
Tests
✏️ Tip: You can customize this high-level summary in your review settings.