Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Listening for changes in other modules #299

Open
Fabrizz opened this issue Mar 8, 2024 · 0 comments
Open

Listening for changes in other modules #299

Fabrizz opened this issue Mar 8, 2024 · 0 comments

Comments

@Fabrizz
Copy link

Fabrizz commented Mar 8, 2024

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:

  1. I set the display brightness to 70% using the API
  2. MMM-Remote control processes the change
  3. Module sends the change to the MM2 event bus

Changelog

executeQuery(query, res) {

The query could be resent here to the fronted so it can be sent to the MM2 event bus.

executeQuerysendSocketNotification → 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 RC_WEBAPI_SET (or similar) notification with the payload/endpoint. (Optionally the config entry could be an array to match the feature in the api to resend, filtering what is resended).

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant