-
Notifications
You must be signed in to change notification settings - Fork 151
Description
Description
It would be nice to have a (disabled by default) option to make the module send the web API action to the MM2 notification/event bus. And It could be pretty easy to implement! (See below)
Example:
- I set the display brightness to 70% using the API
- MMM-Remote control processes the change
- Module sends the change to the MM2 event bus
Changelog
MMM-Remote-Control/node_helper.js
Line 688 in fb20bd4
| executeQuery(query, res) { |
The query could be resent here to the fronted so it can be sent to the MM2 event bus.
executeQuery → sendSocketNotification → module → MM2 notification
Requirements
I think it could be fairly easy to implement this as a middleware in express, after the request is made and authorized the module could just send a . (Optionally the config entry could be an array to match the feature in the api to resend, filtering what is resended).RC_WEBAPI_SET (or similar) notification with the payload/endpoint
As said in "changelog", the best idea would be to get the query and just resend it to the MM2 event bus
Additional info
Why?
Compatibility with other modules that use MMM-Remote-Control. Im writing MMM-HomeKit, that adds native homekit support for MM2, exposing accessories to control modules/the mirror. I would love to use MMM-Remote-Control as the endpoint for things like screen brightness, on/off/reboot/etc, and having the info reflected on the Homekit app even if not made by it could be nice:
MMMHomeKit-test.mp4
Example with HA and MMM-OnSpotify / MMM-LiveLyrics