Python tooling to control a classic Neptune Apex on your LAN
Project description
neptune_apex_classic
Python module for getting the state of and controlling a classic Neptune Apex from your LAN
Requirements
This module requires the "XML Access" to be set on the Apex in order for the status of probes and outlets to be retrieved. Outlets can be set between OFF, AUTO, and ON if the ApexConnection object is created with a username and password.
HTTP access is governed by an aiohttp.ClientSession
supplied by the caller.
Example Usage
async def do_apex_stuff(clientSession: aiohttp.ClientSession) -> None:
# Create an ApexConnection - one connection per Apex is all that's required
conn = ApexConnection("ip-address", clientSession, "admin", "1234")
# The hardware serial number is an ID unique to each Apex and can be used
# to differentiate between different units on the same network
serial_number = await conn.get_serial_number()
# Fetch probe and outlet data
await conn.refresh()
# Iterate through connected probes
for probe in get_connected_probes(conn):
print(probe.name)
print(probe.value)
# Iterate through connected outlets and print the state
for outlet in get_connected_outlets(conn):
print(outlet.name)
print(outlet.value)
# Probe values and outlet states are cached and are only updated when the ApexConnection is refreshed!
conn.refresh()
outlet = get_connected_outlets(conn)[0]
await outlet.set_state(Outlet.ON)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file neptune_apex_classic-0.1.0.tar.gz
.
File metadata
- Download URL: neptune_apex_classic-0.1.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91117497d47c84d62c6a0b56c4b28443e8c72ef9a8536a7ab44116d326312d62 |
|
MD5 | b94d23e1c22b7dc7f237c498e41a1ef8 |
|
BLAKE2b-256 | 42bfdd8f5b587f375cfb5110992cc107708482ff63419aa798c0069b107acac0 |
File details
Details for the file neptune_apex_classic-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: neptune_apex_classic-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aff90c089cf7bb67ad0b27f956e4f662417deb9d7e44d9639df9a81e6e7edc32 |
|
MD5 | d56d3aef80cff5a5a794688beefbceb9 |
|
BLAKE2b-256 | 1e4df148f38038bba6b2a588f5f0715fbeeec31031203c4208fce74e34a5b2d4 |