muesli / beehive

A flexible event/agent & automation system with lots of bees 🐝
GNU Affero General Public License v3.0
6.3k stars 324 forks source link

Config file - reference bees by ID, not name #256

Open rocket357 opened 5 years ago

rocket357 commented 5 years ago

Actions in beehive.conf are referenced by ID, which makes sense given that they don't really have a "pretty name" associated with them. Bees, however, do have "pretty names", so they are referenced by said names.

I have a pretty extensive list of Bees (and this is going to sound so "first-world-problem"), and I'd like to refactor how I've named them. Since they are referenced by name in the config, refactoring Bee naming involves changing every location where the old name is used (and given shell commands that's not entirely difficult, just error prone and tedious).

Example: Bee:

    {
      "Name": "RSS_Hack-A-Day",
      "Class": "rssbee",
      "Description": "Hack-A-Day RSS",
      "Options": [
        {
          "Name": "url",
          "Value": "https://hackaday.com/blog/feed/"
        },
        {
          "Name": "skip_first",
          "Value": "1"
        }
      ]
    },

Associated Chain:

    {
      "Name": "RSS_Hack-a-day2Discord",
      "Description": "Hack-a-day 2 discord",
      "Event": {
        "Bee": "RSS_Hack-A-Day",  <~~~ referenced by name
        "Name": "new_item",
        "Options": null
      },
      "Filters": [],
      "Actions": [
        "5aecd53c-08ee-4b1c-4d99-0c90b95d1982"
      ]
    },

More just thinking out loud than a serious "bug report" (request for an enhancement?), but I thought I'd bring it up and see what you think.

muesli commented 5 years ago

You're certainly right, on the other hand the name of a bee is treated as a form of ID here. This still stems from a time where we didn't have any config interface whatsoever, and users were expected to edit the config file by hand.

Will take that into consideration while I'm refactoring the entire admin interface. Thank you!