From 0a0a0a20a29ed76bfe38ce38310e83dbd65af9c7 Mon Sep 17 00:00:00 2001 From: Omen Wild Date: Thu, 15 Feb 2018 10:13:53 -0800 Subject: [PATCH] Add a Python program to print the correct code sequence for compliant devices (#4619) * Add a Python program to print the correct code sequence for compliant devices * Remove blank lines --- source/_docs/z-wave/control-panel.markdown | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source/_docs/z-wave/control-panel.markdown b/source/_docs/z-wave/control-panel.markdown index 06c9bd741b4..5d89b164ce5 100644 --- a/source/_docs/z-wave/control-panel.markdown +++ b/source/_docs/z-wave/control-panel.markdown @@ -130,6 +130,20 @@ If your node has user codes, you can set and delete them. The format is raw hex Some non compliant device like tag readers, have implemented to use raw hex code. Please refer to a hex ascii table to set your code. Example: http://www.asciitable.com/ +Here is a small Python program than will take numbers on the command line and print the correct sequence for compliant devices: + +```python +#! /usr/bin/python3 +import sys + +translations = {} + +for x in range(0, 10): + translations["%s" % x] = "\\x3%s" % x + +for c in sys.argv[1]: + print(translations[c], end='') +``` ## {% linkable_title OZW Log %}