feat: add ha_fire_event tool for firing events on the HA event bus (#996)#1228
feat: add ha_fire_event tool for firing events on the HA event bus (#996)#1228SealKan wants to merge 3 commits into
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new tool, Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces the ha_fire_event tool to the Home Assistant MCP service, allowing AI agents to fire custom events on the Home Assistant event bus. The implementation includes comprehensive unit and end-to-end tests covering various data formats and error scenarios. Feedback is provided regarding compliance with the repository's style guide, specifically concerning the approved verb list for tool naming and the required structure for multi-line docstrings, including the 'Caveats' section.
7233009 to
af05f1c
Compare
af05f1c to
a7e6298
Compare
…cstring (homeassistant-ai#996) - Add `fire` verb to AGENTS.md approved-verb list as Gemini suggested - Add Caveats section to ha_fire_event docstring: events are fire-and-forget
- ha_fire_event fires events with side effects (triggers automations, subscribers) so destructiveHint=True is correct; False was bypassing the annotation compliance test - Remove unused safe_call_tool import from test_ha_fire_event.py (ruff F401)
|
Closing to refocus resources. Will revisit when bandwidth allows. |
Closes #996
Adds
ha_fire_event(event_type, data=None)— fires arbitrary HA events viaPOST /api/events/{event_type}.ha_call_servicecovers service calls; firing a raw event is a distinct mechanism used by event-triggered automations and custom integrations. The underlyingHomeAssistantClient.fire_event()already exists inrest_client.py.Verb
fire: Not in the approved-verb list yet. Happy to rename (trigger,send,emit) or addfireto AGENTS.md — your call.3 files changed: tool implementation + 7 unit tests + E2E test.