-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added bus message mycroft.skill.ready #333
base: dev
Are you sure you want to change the base?
Conversation
WalkthroughThe update modifies the Changes
Sequence Diagram(s)sequenceDiagram
participant Skill as OVOSSkill
participant Bus
participant Listener as Other Components
Skill->>Skill: on_ready_status()
Skill->>Bus: emit(Message("mycroft.skill.ready", {"id": self.skill_id}))
Bus->>Listener: Dispatch "mycroft.skill.ready" message
Poem
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
ovos_workshop/skills/ovos.py (1)
752-754
: Consider enhancing the message data and documentation.While the implementation is correct, consider these improvements:
- Add docstring to describe the bus message emission.
- Consider including additional context in the message data, such as:
- Skill name
- Initialization timestamp
- Skill version
Example enhancement:
def on_ready_status(self): + """ + Called when the skill is ready. Logs the status and emits a bus message. + + Emits: + mycroft.skill.ready: Indicates skill is initialized and ready + Message data includes: + - id: Unique skill identifier + """ LOG.info(f'{self.skill_id} is ready.') - self.bus.emit(Message("mycroft.skill.ready", {"id": self.skill_id})) + self.bus.emit(Message("mycroft.skill.ready", { + "id": self.skill_id, + "name": self.name, + "timestamp": time.time() + }))
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
ovos_workshop/skills/ovos.py
(1 hunks)
🔇 Additional comments (1)
ovos_workshop/skills/ovos.py (1)
753-754
: LGTM! The bus message emission is well-placed and properly implemented.The addition of the bus message
mycroft.skill.ready
with the skill's ID is a good enhancement that enables skills to execute specific tasks after loading. The message is emitted after logging, which maintains a logical sequence of operations.
Emits a bus message,
mycroft.skill.ready
after each skill is loaded. This allows for the skill to perform specific tasks after is is loaded correctly.Summary by CodeRabbit