margyle / decaf

Decaf: Does Every Coffee Action, Friend
26 stars 10 forks source link

Higher level API for RelayControl functions #19

Open levi opened 5 years ago

levi commented 5 years ago

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:

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