How to use the rak811.rak811.Reset.Module 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_rak811.py View on Github external
def test_reset_module(mock_send, mock_hard_reset, lora):
    """Test reset module command."""
    lora.reset(Reset.Module)
    mock_send.assert_called_once_with('reset=0')
    mock_hard_reset.assert_called_once()
github AmedeeBulle / pyrak811 / tests / test_cli.py View on Github external
def test_reset_module(runner, mock_rak811):
    result = runner.invoke(cli, ['-v', 'reset', 'module'])
    mock_rak811.return_value.reset.assert_called_once_with(Reset.Module)
    assert result.output.startswith('Module reset')
github AmedeeBulle / pyrak811 / rak811 / rak811.py View on Github external
def reset(self, mode):
        """Reset Module or LoRaWan stack.

        Note that reset(Reset.Module) will restart the module which will wait
        for an hardware reset to start.
        """
        self._send_command('reset={0}'.format(mode))
        if mode == Reset.Module:
            self.hard_reset()