public override IComponentFeatureStateCollection GetState() { var state = new ComponentFeatureStateCollection() .With(new PowerState(_powerState)); if (_adapter.SupportsColor) { return(state.With(_colorState)); } return(state); }
public override IComponentFeatureStateCollection GetState() { var state = new ComponentFeatureStateCollection().With( new StateMachineFeatureState(_activeState?.Id)); if (this.GetSupportsOffState()) { state.With( new PowerState(_activeState?.Id == StateMachineStateExtensions.OffStateId ? PowerStateValue.Off : PowerStateValue.On)); } return(state); }