A package for NRC devices
Project description
Nrcpy
Nrcpy is a Python package for working with NRC devices. It provides a convenient interface to connect to an NRC device, send commands, and retrieve information from the device.
🔥 Installation
You can install nrcpy
using pip:
pip install nrcpy
🪧 Usage
Here is an example of how to use nrcpy to connect to an NRC device and control the relays:
from nrcpy import NrcDevice
# Configure the device
ip = '192.168.1.200'
port = 23
username = 'admin'
password = 'admin'
# Create an instance of NrcDevice
nrc = NrcDevice((ip, port, username, password))
# Open connection
nrc.connect()
# Login
if nrc.login():
# Control the relays
nrc.relayContact(1, 500)
nrc.relayContact(2, 1000)
nrc.relayOff(1)
nrc.relayOn(2)
# Get relays status
relays_status = nrc.getRelaysValues()
relay_1_status = nrc.getRelayValue(1)
relay_2_status = nrc.getRelayValue(2)
print(f'Relays Status (hex): {relays_status}')
print(f'Relay 1 Status: {relay_1_status}')
print(f'Relay 2 Status: {relay_2_status}')
else:
print('Error in login')
# Close connection
nrc.disconnect()
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
nrcpy-1.2.3.tar.gz
(2.2 kB
view details)
Built Distribution
nrcpy-1.2.3-py3-none-any.whl
(2.4 kB
view details)
File details
Details for the file nrcpy-1.2.3.tar.gz
.
File metadata
- Download URL: nrcpy-1.2.3.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf193f683189bd51f28e87946f3546f95d8983c0babe635b3513d5565c0e817f |
|
MD5 | 05b9c6cb92c8ef735109696ff7e6884d |
|
BLAKE2b-256 | 76b88ea15b8d3b410690037cb59543c4fec43f9d706ecb1bfb4333cca1aebe05 |
File details
Details for the file nrcpy-1.2.3-py3-none-any.whl
.
File metadata
- Download URL: nrcpy-1.2.3-py3-none-any.whl
- Upload date:
- Size: 2.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb3badfa88f24faf7c5117cc90a0c8a41b2a6162b959da585d5e6a177e533b5b |
|
MD5 | 6383263eceb365650de11174fbdc512e |
|
BLAKE2b-256 | 2f01f27b24912080b03bb71e2bd3f210d69159434f48297919ddc75b26bbfd65 |