public void SetState(AdapterRollerShutterState state, params IHardwareParameter[] parameters)
 {
     if (state == AdapterRollerShutterState.Stop)
     {
         StopCalledCount++;
     }
     if (state == AdapterRollerShutterState.MoveUp)
     {
         StartMoveUpCalledCount++;
     }
     if (state == AdapterRollerShutterState.MoveDown)
     {
         StartMoveDownCalledCount++;
     }
 }
        public Task SetState(AdapterRollerShutterState state, params IHardwareParameter[] parameters)
        {
            if (state == AdapterRollerShutterState.Stop)
            {
                StopCalledCount++;
            }
            if (state == AdapterRollerShutterState.MoveUp)
            {
                StartMoveUpCalledCount++;
            }
            if (state == AdapterRollerShutterState.MoveDown)
            {
                StartMoveDownCalledCount++;
            }

            return(Task.FromResult(0));
        }
        public void SetState(AdapterRollerShutterState state, params IHardwareParameter[] parameters)
        {
            if (state == AdapterRollerShutterState.MoveUp)
            {
                StopAndWait();
                _directionOutput.Write(BinaryState.Low);
                Start();
            }
            else if (state == AdapterRollerShutterState.MoveDown)
            {
                StopAndWait();
                _directionOutput.Write(BinaryState.High);
                Start();
            }
            else
            {
                _powerOutput.Write(BinaryState.Low);

                // Ensure that the direction relay is not wasting energy.
                _directionOutput.Write(BinaryState.Low);
            }
        }