Example #1
0
        private static async Task toggleAllRelays(EthRlyDevice device)
        {
            for (int address = 0; address < 8; address++)
            {
                var beforeState = await device.GetRelayStateAsync(address);

                await device.ToggleRelayStateAsync(address);

                var afterState = await device.GetRelayStateAsync(address);

                Assert.False(beforeState == afterState);
            }
        }
Example #2
0
        private static async Task switchAllRelaysOneByOne(EthRlyDevice device, bool newState)
        {
            for (int address = 0; address < 8; address++)
            {
                device.SetRelayState(address, newState);
                var state = await device.GetRelayStateAsync(address);

                Assert.False(state);
            }
        }