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

Central command and event handling #2865

Closed
TD-er opened this issue Jan 27, 2020 · 4 comments
Closed

Central command and event handling #2865

TD-er opened this issue Jan 27, 2020 · 4 comments
Labels
Category: Controller Related to interaction with other platforms Category: Rules Related to the rule engine Type: Enhancement Improve something already present

Comments

@TD-er
Copy link
Member

TD-er commented Jan 27, 2020

Currently we have the possibility to receive commands from a number of sources.
For example:

  • serial port
  • p2p controller
  • MQTT (Domoticz/OpenHAB)
  • HTTP GET
  • Rules

The problem is that there is no generic handler for receiving a command and executing it.
For example two MQTT controllers (C002 - Domoticz and C005 OpenHAB) do accept commands or events.
But both do have their own unique special handling for some plugins.
For some specific scenario's this can be a valid use case, but for most it is just code duplication and adding to the confusion why functionality differs among controllers.

So in short:

  • Add (or choose) a generic command handler.
  • Find a way to handle specific commands or events inside the plugin and not in the controllers.
  • Proper detect whether something is an event or a command, so we don't have to use the "spaghetti method" to see what call may be successful in handling the incoming command or event.
  • Evaluate demands for permission for some events or commands. (factory reset via MQTT doesn't sound like a good idea)
@TD-er TD-er added Category: Controller Related to interaction with other platforms Category: Rules Related to the rule engine Type: Enhancement Improve something already present labels Jan 27, 2020
@giig1967g
Copy link
Contributor

Ah ah ah!!!! I can't stop laughing.

* Proper detect whether something is an event or a command, so we don't have to use the "spaghetti method" to see what call may be successful in handling the incoming command or event.

What is a "spaghetti method" ?
(Warning: I am italian!)
:) :) :) 💯

@TD-er
Copy link
Member Author

TD-er commented Jan 27, 2020

"Spaghetti programming" is trying random things and see what sticks.
Analogue to testing whether Spaghetti is well cooked. If you throw it to a wall and it sticks, then it is OK. (well, at least that's what I have been told, never tried it)

There is also "banana programming", which is releasing it and let it ripe at the customer via lots and lots of bug fixes :)

@giig1967g
Copy link
Contributor

Analogue to testing whether Spaghetti is well cooked. If you throw it to a wall and it sticks, then it is OK. (well, at least that's what I have been told, never tried it)

That's too much fun!

@tonhuisman
Copy link
Contributor

This seems no longer relevant, except for the jokes, but still can be closed. 😄

@TD-er TD-er closed this as completed Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Controller Related to interaction with other platforms Category: Rules Related to the rule engine Type: Enhancement Improve something already present
Projects
None yet
Development

No branches or pull requests

3 participants