Skip to content

Higher level API for RelayControl functions #19

@levi

Description

@levi

The relay control REST API provides raw access to the underlying GPIO functions of Mugsy:

'/relayControl/<int:pinNumber>/<int:relayChannel>/<timeOn>/<int:repeatValue>/<int:repeatDelay>/<string:connectedHardware>'

This enables very specific control of the boiler, grinder, and mechanical pour-over dispenser, but is too much control for most use cases in a public API. To improve this, the functions of Mugsy should be reified as various REST endpoints that provide clear abstractions for developers to use in their applications. For example:

  • GET /services/boiler -> Get status of the boiler
  • POST /services/boiler -> Control function of boiler with POST body providing parameters
  • GET /services/grinder -> Get status of the grinder
  • POST /services/grinder -> Control function of grinder with POST body providing parameters
  • GET /services/pour_over -> Get status of pour over
  • POST /services/pour_over -> Control pour over with POST body providing parameters

You could even introduce an MQTT layer on top of the core models package, providing realtime IoT communication to Mugsy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions