Skip to content

Add option to disable/enable devices and device sources in config #70

Description

@heavyrubberslave

There should be an option to disable or enable a configured device source in the config JSON file. If it's not explicitly enabled or disabled it's always implicitly enabled. When a device source is disabled, it should not be loaded. If the config JSON is updated it should trigger a reload of the device sources and deactivate/activate the ones that were active/inactive before the change of the config has happened.

Like this:

    "deviceSources": {
        "b6a0f45e-c3d0-4dca-ab81-7daac0764291": {
            "id": "b6a0f45e-c3d0-4dca-ab81-7daac0764291",
            "type": "slvCtrlPlusSerial",
            "enabled": false,
            "config": {
            }
        },

Also devices should be disable-able. If the config JSON is updated it should trigger a check of the devices and deactivate/activate the ones that were active/inactive before the change of the config has happened.
If a new device is detected by a device provider, it should be checked if it's enabled (or enabled is missing, in that case it's implicitly true) and if it's not enabled, it should not be initiated and ignored. If there is a device config change and suddenly a device is enabled that was disabled before, it should be checked if it's connected and be initiated.

Like this:

    "knownDevices": {
        "ceea37f1-419a-44f4-973c-b51502aa4176": {
            "id": "ceea37f1-419a-44f4-973c-b51502aa4176",
            "name": "Random Generator",
            "type": "randomGenerator",
            "source": "virtual",
            "enabled": false,
            "config": {
                "min": 1,
                "max": 100
            }
        },
     }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions