bitfocus / companion

Bitfocus Companion enables the reasonably priced Elgato Stream Deck and other controllers to be a professional shotbox surface for an increasing amount of different presentation switchers, video playback software and broadcast equipment.
http://bitfocus.io/companion
Other
1.57k stars 499 forks source link

buttons break on companion restart #868

Closed depili closed 4 years ago

depili commented 5 years ago

Describe the bug For some reason unknown to me the buttons for my module depili-clock-8001 break on companion restart. The button text and default colors stay, but the actions and color feedback goes away. Feedback variables work.

To Reproduce

  1. Start companion (with headless mode)
  2. Add clock-8001 instance
  3. Drag buttons from clock-8001/mode presets to a page
  4. Restart companion
  5. Observe that the actions are gone
  6. Observe that the state feedback on the buttons is gone

This is what gets saved to ~/companion/db:

{
    "deviceconfig": {
    },
    "bank": {
        "1": {
            "1": {
                "style": "text",
                "text": "Time\\nof day",
                "size": "18",
                "color": 16744448,
                "bgcolor": 0
            },
            "2": {
            },
            "3": {
            },
            "4": {
            },
            "5": {
            },
            "6": {
            },
            "7": {
            },
            "8": {
            },
            "9": {
            },
            "10": {
            },
            "11": {
            },
            "12": {
            }
        },
        "2": {
            "3": {
            },
            "4": {
            },
            "5": {
            },
            "6": {
            },
            "7": {
            },
            "8": {
            },
            "9": {
            },
            "10": {
            },
            "11": {
            },
            "12": {
            }
        },
        "3": {
            "4": {
            },
            "5": {
            },
            "6": {
            },
            "7": {
            },
            "8": {
            },
            "9": {
            },
            "10": {
            },
            "11": {
            },
            "12": {
            }
        },
        "4": {
            "5": {
            },
            "6": {
            },
            "7": {
            },
            "8": {
            },
            "9": {
            },
            "10": {
            },
            "11": {
            },
            "12": {
            }
        },
        "5": {
            "6": {
            },
            "7": {
            },
            "8": {
            },
            "9": {
            },
            "10": {
            },
            "11": {
            },
            "12": {
            }
        },
        "6": {
            "7": {
            },
            "8": {
            },
            "9": {
            },
            "10": {
            },
            "11": {
            },
            "12": {
            }
        },
        "7": {
            "8": {
            },
            "9": {
            },
            "10": {
            },
            "11": {
            },
            "12": {
            }
        },
        "8": {
            "9": {
            },
            "10": {
            },
            "11": {
            },
            "12": {
            }
        },
        "9": {
            "10": {
            },
            "11": {
            },
            "12": {
            }
        },
        "10": {
            "11": {
            },
            "12": {
            }
        },
        "11": {
            "12": {
            }
        },
        "12": {
        },
        "13": {
        },
        "14": {
        },
        "15": {
        },
        "16": {
        },
        "17": {
        },
        "18": {
        },
        "19": {
        },
        "20": {
        },
        "21": {
        },
        "22": {
        },
        "23": {
        },
        "24": {
        },
        "25": {
        },
        "26": {
        },
        "27": {
        },
        "28": {
        },
        "29": {
        },
        "30": {
        },
        "31": {
        },
        "32": {
        },
        "33": {
        },
        "34": {
        },
        "35": {
        },
        "36": {
        },
        "37": {
        },
        "38": {
        },
        "39": {
        },
        "40": {
        },
        "41": {
        },
        "42": {
        },
        "43": {
        },
        "44": {
        },
        "45": {
        },
        "46": {
        },
        "47": {
        },
        "48": {
        },
        "49": {
        },
        "50": {
        },
        "51": {
        },
        "52": {
        },
        "53": {
        },
        "54": {
        },
        "55": {
        },
        "56": {
        },
        "57": {
        },
        "58": {
        },
        "59": {
        },
        "60": {
        },
        "61": {
        },
        "62": {
        },
        "63": {
        },
        "64": {
        },
        "65": {
        },
        "66": {
        },
        "67": {
        },
        "68": {
        },
        "69": {
        },
        "70": {
        },
        "71": {
        },
        "72": {
        },
        "73": {
        },
        "74": {
        },
        "75": {
        },
        "76": {
        },
        "77": {
        },
        "78": {
        },
        "79": {
        },
        "80": {
        },
        "81": {
        },
        "82": {
        },
        "83": {
        },
        "84": {
        },
        "85": {
        },
        "86": {
        },
        "87": {
        },
        "88": {
        },
        "89": {
        },
        "90": {
        },
        "91": {
        },
        "92": {
        },
        "93": {
        },
        "94": {
        },
        "95": {
        },
        "96": {
        },
        "97": {
        },
        "98": {
        },
        "99": {
        }
    },
    "instance": {
        "bitfocus-companion": {
            "instance_type": "bitfocus-companion",
            "label": "internal",
            "id": "bitfocus-companion"
        },
        "r1rBizVwE": {
            "instance_type": "depili-clock-8001",
            "label": "clock-8001",
            "host": "192.168.81.255",
            "port": "1245",
            "localport": "1245"
        }
    },
    "userconfig": {
        "page_direction_flipped": false,
        "artnet_enabled": false,
        "artnet_universe": "1",
        "artnet_channel": "1"
    }
}

(reformatted the json for readibility). Note no actions saved.

Expected behavior I expect that the actions would be saved to disk.

Screenshots before quitting

Desktop (please complete the following information):

Additional context Using headless.js

depili commented 5 years ago

On further testing this seems to only affect the buttons created from the templates, not ones created manually.

So are my presets faulty or is there something wrong with companion saving them?

depili commented 5 years ago

And apparently manually adding a button with a command from the clock-8001 module and both instance feedback options and then dragging the preset buttons gets companion to save all settings successfully.

depili commented 4 years ago

You need to open a issue in the main companion repository, this is nothing that I can fix. The maintainers just moved the ticket into the module issues instead of companion.

A work-around that seems to work is to manually create a button with an action from all used modules in addition to buttons from presets and then companion saves the buttons correctly.

Also be aware that restarting the computer without closing companion first doesn't save the button states

josephdadams commented 4 years ago

I can transfer it back to the core repo.

willosof commented 4 years ago

Still an issue? (on latest builds)

josephdadams commented 4 years ago

@depili still a bug for you?

depili commented 4 years ago

As far as I am aware this isn't happening on the 2.0 branch, haven't touched the legacy branch for a while