Exemple #1
0
        public Guid AddDeviceToSite(ControlledDevice device)
        {
            Guid deviceId = Guid.NewGuid();

            Devices.Add(deviceId, device);
            Log.Debug("Device {@device} added successfully to site: {@site}", device.GetType().Name, SiteName);
            return(deviceId);
        }
        public Guid AddDevice(ControlledDevice device, bool autoInit = false)
        {
            if (autoInit)
            {
                device?.Init();
            }
            Guid deviceId = Guid.NewGuid();

            Devices.Add(deviceId, device);
            Log.Debug("Added new device: {@device}", device);
            return(deviceId);
        }