lightwave
Python library to provide a reliable communication link with LightWaveRF lights, switches and TRVs.
Installation
Either clone this repository and run python setup.py install, or install from pip using pip install lightwave.
API
This library makes use of the public API provided by lightwave that can be found here: https://api.lightwaverf.com/lighting_power.html
Lights and Switches
The library supports the following functions:
turn_on_light(device_id, name)
turn_on_switch(device_id, name)
turn_on_with_brightness(device_id, name, brightness)
turn_off(device_id, name)
Where:
- device_id takes the form R#D# where R# is the room number and D# is the device number.
- name is the text that will be displayed on the hub.
- brightness is a value from 0 (off) to 255 (full on).
Usage
Initialise a link to the hub by passing in the IP address required. Then call a method on the object to modify the device. The first time a switch is turned on or off the device will attempt to pair to the hub. This should then show a message on your WiFi Link asking you to pair the device. You have 12 seconds to push the button on the WiFi Link to accept this.
import asyncio
import time
from lightwave.lightwave import LWLink
async def main():
lwLink = LWLink('192.168.15.226')
print("Off")
### R1D3 is room 1 device 3
lwLink.turn_off('R1D3', "Wall Lights")
lwLink.turn_off('R1D4', "Ceiling Lights")
time.sleep(5)
print("On")
lwLink.turn_on_light('R1D3', "Wall Lights")
lwLink.turn_on_light('R1D4', "Ceiling Lights")
time.sleep(5)
print("Off")
lwLink.turn_off('R1D3', "Wall Lights")
lwLink.turn_off('R1D4', "Ceiling Lights")
time.sleep(5)
print("On")
lwLink.turn_on_with_brightness('R1D3', "Wall Lights", 25)
lwLink.turn_on_with_brightness('R1D4', "Ceiling Lights", 50)
lwLink.turn_on_switch('R1D1', "Sockets one")
lwLink.turn_on_switch('R1D2', "Sockets two")
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()
TRV Support
The library also supports TRVs with the following function:
set_temperature (device_id, temp, name)
Where:
- device_id takes the form R#D# where R# is the room number and D# is the device identifier (normally Dh).
- temp is the target temperature (0.5 increments)
- name is the text that will be displayed on the hub.
TRV Proxy
The Proxy is now optional. A built in listener is now available via the async function LW_listen().
Alternativly, to read the TRV status (current temperature, target_temperature, battery status and current output) a Lightwave TRV Proxy can be used. To use the proxy:
set_trv_proxy (proxy_ip, proxy_port)
(temp, targ, batt, output) = read_trv_status(serial)
Where:
- proxy_ip is the IP address of the proxy
- proxy_port is the IP Port of the proxy
- serial is the serial number of the TRV of interest (NB: This is the serial number, and NOT device_id they are different).
Contributors
- TRV Support by Colin Robbins
Metadata
Release files for lightwave 0.24
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| lightwave-0.24.tar.gz | 5.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lightwave-0.24-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.9 kB
Release files / lightwave-0.24.tar.gz
| Download URL | lightwave-0.24.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
97d8707402aba5d5e3fe992b8328ae85b3da1a04fab637e83b0fd306947e9352
|
|
BLAKE2b-256 checksum How to use checksums |
961a7754f0a3639b3c8c7c05310de7ba67af3bf1e36a20537bde0473bbc91793
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 colorama/0.4.5 importlib-metadata/4.12.0 keyring/23.8.2 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.28.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.11 CPython/3.10.6
|
Release files / lightwave-0.24-py3-none-any.whl
| Download URL | lightwave-0.24-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ed8634bf6477cd68cf66de3ab4405838490b5216f674a02cf450532e965f30b1
|
|
BLAKE2b-256 checksum How to use checksums |
93fe0a3276b6f33af4263a973eeebf1850a74aab4ba0426f0c43c349b0112df6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 colorama/0.4.5 importlib-metadata/4.12.0 keyring/23.8.2 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.28.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.11 CPython/3.10.6
|
Security for lightwave 0.24
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.