private CameraInfo ConvertCameraToCameraInfo(Camera camera, XProtectHelper xprotect)
        {
            var hardware        = new Hardware(Configuration.Instance.ServerFQID.ServerId, camera.ParentItemPath);
            var recordingServer = new RecordingServer(Configuration.Instance.ServerFQID.ServerId, hardware.ParentItemPath);
            var driver          = HardwareDriverCacheHelper.GetDriver(hardware, recordingServer);

            return(new CameraInfo()
            {
                Enabled = camera.Enabled,
                ReadOnlyId = new Guid(camera.Id),
                Name = camera.DisplayName,
                ReadOnlyResolution = GetDefaultStreamResolution(camera),
                ReadOnlyRecordingServer = recordingServer.DisplayName,
                ReadOnlyChannel = camera.Channel,
                ReadOnlyHardwareName = hardware.DisplayName,
                RecordingEnabled = camera.RecordingEnabled,
                ReadOnlyDriverName = driver?.DisplayName,
                ReadOnlyDriverNumber = driver?.Number ?? -1
            });
        }
        private static async Task <HardwareInfo> ConvertHardwareToHardwareInfo(Hardware hardware, XProtectHelper xprotect)
        {
            var password        = xprotect.GetPasswordAsync(hardware);
            var recordingServer = new RecordingServer(Configuration.Instance.ServerFQID.ServerId, hardware.ParentItemPath);
            var driver          = HardwareDriverCacheHelper.GetDriver(hardware, recordingServer);

            return(new HardwareInfo()
            {
                Address = hardware.Address,
                Enabled = hardware.Enabled,
                ReadOnlyId = new Guid(hardware.Id),
                ReadOnlyMac = xprotect.GetMacAddress(hardware),
                Name = hardware.DisplayName,
                Password = await password,
                UserName = hardware.UserName,
                ReadOnlyRecordingServer = recordingServer.DisplayName,
                ReadOnlyDriverName = driver?.DisplayName,
                ReadOnlyDriverNumber = driver?.Number ?? -1
            });
        }