Пример #1
0
 public void SetState(AdapterRollerShutterState state, params IHardwareParameter[] parameters)
 {
     if (state == AdapterRollerShutterState.Stop)
     {
         StopCalledCount++;
     }
     if (state == AdapterRollerShutterState.MoveUp)
     {
         StartMoveUpCalledCount++;
     }
     if (state == AdapterRollerShutterState.MoveDown)
     {
         StartMoveDownCalledCount++;
     }
 }
Пример #2
0
        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);
            }
        }