public DeviceInstance(DeviceFeatureProvider featureProvider, DeviceDefinition definition) { Definition = definition; Features = definition.Features .Select(x => featureProvider.Create(x.Feature, x.Options)) .ToArray(); Traits = GetSupportedTraits(); FeatureByCommand = Features .SelectMany(x => x.Commands.Select(y => new { Command = y, Feature = x })) .ToDictionary(k => k.Command, v => v.Feature); WillReportState = false; }
public DeviceInstanceProvider(DeviceFeatureProvider featureProvider) { _featureProvider = featureProvider; }