LonHand client library
Project description
LonHand client library
LonHand protocol implementation for USR-WP1 smart socket (one-channel relay) by USR IOT.
Usage:
from lonhand import device
# create switch
switch = WifiRelay('192.168.1.23')
# turn on
switch.turn_on()
# get state
state = switch.is_on()
# turn off
switch.turn_off()
Protocol
Command:
55 AA - distinguishes a command, unlike for example the password which
should be sent as is (with suffix 0D 0A)
00 03 - represents the length in bytes of the command (real) that follows,
including the byte 00 (see below)
00 - fixed, reserved and not usable. However, it contributes to forming
the length in bytes of the command, for example in case of a device
renaming command (which will contain the new name assigned): the
length byte (and the checksum) will be recalculated also according
to the length of the new name
02 - the actual command (ON)
01 - command parameter; in this case we are giving the ON command (02)
and as a parameter the channel number to be switched on (01).
06 - checksum, and represents the sum (in HEX) of the parts:
(0x00 + 0x03 + 0x00 + 0x02 + 0x01) = 0x06
Response:
AA 55 - marks the message as a response
00 04 - response length
00 - reserved
82 01 - is the confirmation response to the ON command
01 - channel/port that was affected
88 - checksum: (0x00 + 0x04 + 0x00 + 0x82 + 0x01 + 0x01) = 0x88
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lonhand-0.4.tar.gz
(2.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
lonhand-0.4-py3-none-any.whl
(4.3 kB
view details)
File details
Details for the file lonhand-0.4.tar.gz.
File metadata
- Download URL: lonhand-0.4.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4768b79cb20e59f9dff1ac2600c3e629c764016e1e0fc66bfa0c3c51aa79366
|
|
| MD5 |
b9ee9d70186d7d237e0dd4c7dd8deffc
|
|
| BLAKE2b-256 |
65b40a4d2e32de5e186f666c67e44fcd9f3790a0d0db2eccac102c20bb134226
|
File details
Details for the file lonhand-0.4-py3-none-any.whl.
File metadata
- Download URL: lonhand-0.4-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af9b19d506cc791e17bf59d979dafc66c9cec40f1fc8642da027a7e58c15239a
|
|
| MD5 |
29054440df18e34e8660e354c1b1c392
|
|
| BLAKE2b-256 |
61cdbf4248399d2a341fb211aff8f3c757d9fd04b977870757246d428abbd722
|