예제 #1
0
        public void TurnOff(Light.Color color)
        {
            var userSource = new User
            {
                Build = new Build {
                    IsBuilding = false, State = Build.BuildState.Unknown
                }
            };

            _manager.BuildSource = userSource;
        }
예제 #2
0
        public void TurnOnFlash(Light.Color color)
        {
            var userSource = new User
            {
                Build = new Build {
                    IsBuilding = true, State = MapState(color)
                }
            };

            _manager.BuildSource = userSource;
        }
예제 #3
0
        private static Build.BuildState MapState(Light.Color color)
        {
            var state = Build.BuildState.Unknown;

            switch (color)
            {
            case Light.Color.Green:
                state = Build.BuildState.Success;
                break;

            case Light.Color.Yellow:
                state = Build.BuildState.Unstable;
                break;

            case Light.Color.Red:
                state = Build.BuildState.Failure;
                break;
            }
            return(state);
        }
 public void SetDeviceColor(Light.Color color)
 {
     _ledPin = LightColors[color];
 }