cppp-io
cppp-io copied to clipboard
Robot events
In my interactions with a robot, I am able to issue it commands directly. I am also able to command it's "ears and eyes" via it's devices, and I can listen to ears and eyes for events.
A robot is a valuable abstraction of connections and devices that make an independent identity, and this abstraction could offer valuable events as that identity.
Would you be willing to entertain a pull request which adds events
to the robot (a peer to commands
) and adds a POST to /api/:robot/events/:event
?
Hi, @lorenwest adding events to robots sounds like a great idea.
Could you please clarify what you would want to do with the POST to events?
Oops - I meant GET vs. POST. My intention is to follow the same patterns for discovering events as well as listening for events.
OK, now I get it. So back to your original question: yes please, we'd love a PR for that.
Thanks!
Will do - thanks.
While doing this work I noticed a couple things:
- Discoverability: There's a GET for command discovery at various levels
/api/robots/:robot/devices/:device/commands
, but no GET for event discovery/api/robots/:robot/devices/:device/events
. Implementations may find it easy to auto-discover commands, but events aren't as easily discoverable, so implementations would be required to list the events they wish to be discoverable. - MCP Events: Like robots, the MCP also has commands and no events. I can see helpful events such as robotStarted, robotStopped, apiStarted, etc.
Would you like me to add these to the pull request, or should I leave them alone - for another day?
-Loren
These are all things we've at least partly implemented in Gobot. Seems like a great thing.
Ok, I'll include in the pull request.
Submitted in pull request #3
Ping: Were you wanting to implement before merging? Just checking in.