public StateHandler(IDevice device, FocusState focusState, PhysicalPresence physicalPresence)
 {
     this.focusState       = focusState;
     this.physicalPresence = physicalPresence;
     this.device           = device ?? throw new ArgumentNullException(nameof(device));
     this.UpdateDeviceLEDs();
 }
        public static Color ComputerRearColor(PhysicalPresence physicalPresence)
        {
            switch (physicalPresence)
            {
            case PhysicalPresence.Present:
                return(Colors.Off);

            default:
                return(Colors.White);
            }
        }
        public static Color ComputeFlagColor(PhysicalPresence physicalPresence, FocusState focusState)
        {
            if (physicalPresence == PhysicalPresence.AFK)
            {
                return(Colors.Yellow);
            }

            switch (focusState)
            {
            case FocusState.High:
                return(Colors.Red);

            case FocusState.Low:
            default:
                return(Colors.Green);
            }
        }
 public bool SetPhysicalPresence(PhysicalPresence physicalPresence)
 {
     this.physicalPresence = physicalPresence;
     return(this.UpdateDeviceLEDs());
 }