How to use the rak811.rak811.Mode.LoRaWan function in rak811

To help you get started, we’ve selected a few rak811 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AmedeeBulle / pyrak811 / tests / test_cli.py View on Github external
def test_mode(runner, mock_rak811):
    p = PropertyMock(return_value=Mode.LoRaWan)
    type(mock_rak811.return_value).mode = p
    result = runner.invoke(cli, ['mode'])
    p.assert_called_once_with()
    assert result.output == 'LoRaWan\n'
github AmedeeBulle / pyrak811 / tests / test_rak811.py View on Github external
def test_set_mode(mock_send, lora):
    """Test mode setter."""
    lora.mode = Mode.LoRaWan
    mock_send.assert_called_once_with('mode=0')
github AmedeeBulle / pyrak811 / tests / test_cli.py View on Github external
def test_mode_lora(runner, mock_rak811):
    p = PropertyMock()
    type(mock_rak811.return_value).mode = p
    result = runner.invoke(cli, ['-v', 'mode', 'LoRawan'])
    p.assert_called_once_with(Mode.LoRaWan)
    assert result.output == 'Mode set to LoRaWan.\n'