mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-16 13:56:53 +00:00
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
This commit is contained in:
parent
4f6179e2ff
commit
0a0a0a20a2
@ -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.
|
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/
|
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 %}
|
## {% linkable_title OZW Log %}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user