Essentials icon indicating copy to clipboard operation
Essentials copied to clipboard

[FEATURE]-Create Component Interfaces

Open ndorin opened this issue 5 years ago • 2 comments

UML Class Drawing

The intent here is to create a componentized room structure that is more modular that the existing one and allows us to define interfaces that represent the following:

  • IRoomDeviceComponent : Device Component - a class that represents a device but may also describe specific behaviour of that device in the context of a room (ex: video codec)
  • IRoomBehaviorComponent : Behaviour Component - a class that represents a behavior of a room, not specifically tied to a certain device (ex: occupancy behaviour, microphone privacy)
  • IRoomActivityComponent : Activity Component- a class that represents an activity in a room (ex: Video Call, Audio Call, Presentation, Shortcuts)

This would require the creation of a static RoomFactory to construct rooms as well as a static ComponentFactory to construct the room's components

In this way, to allow creation of new room behaviours via plugins, the plugin never needs to define the room, but just the new components. Components derive from one of the three interface types above.

Room Config Snippet:

{
    "rooms": [
        {
            "key": "room1",
            "name": "Example Room",
            "type": "component",
            "properties": {
                "activities": [
                    {
                        "label": "Video Call",
                        "componentKey": "videoCodec",
                        "order": 5
                    }
                ],
                "components": [
                    {
                        "key": "videoCodec",
                        "type": "videoCall",
                        "properties": {
                            "deviceKey": "ciscoSparkPlusCodec-1"
                        }
                    },
                    {
                        "key": "roomBridge",
                        "type": "roomBridge",
                        "properties": {
                            "roomKey": "room2"
                        }
                    },
                    {
                        "key": "volumes",
                        "type": "volumes",
                        "properties": {
                            "volumes": {
                                "master": {
                                    "deviceKey": "dsp-1.fader01",
                                    "Label": "Master",
                                    "properties": {
                                        "faderKey": "fader01"
                                    }
                                }
                            }
                        }
                    }
                ]
            }
        },
        {
            "key": "room2",
            "name": "Fruit Room",
            "type": "component",
            "properties": {
                "activities": [
                    {
                        "label": "DirectTV 1",
                        "componentKey": "setTopBox-1",
                        "order": 1
                    },
                    {
                        "label": "DirectTV 2",
                        "componentKey": "setTopBox-2",
                        "order": 2
                    },
                    {
                        "label": "DirectTV 3",
                        "componentKey": "setTopBox-3",
                        "order": 3
                    },
                    {
                        "label": "Schedules",
                        "componentKey": "schedule",
                        "order": 3
                    }
                ],
                "components": [
                    {
                        "key": "setTopBox-1",
                        "type": "setTopBox",
                        "properties": {
                            "deviceKey": "directTv-1"
                        }
                    },
                    {
                        "key": "setTopBox-2",
                        "type": "setTopBox",
                        "properties": {
                            "deviceKey": "directTv-2"
                        }
                    },
                    {
                        "key": "setTopBox-3",
                        "type": "setTopBox",
                        "properties": {
                            "deviceKey": "directTv-3"
                        }
                    }
                ]
            }
        }
    ]
}

ndorin avatar Nov 23 '20 22:11 ndorin

This is really good stuff, Neil!

ngenovese11 avatar Nov 24 '20 13:11 ngenovese11

@batourin for your review

ndorin avatar Jan 19 '21 17:01 ndorin