InoDrive API library
Project description
Installation
pip install CK-InoDrive-API
Usage
Import
# Import InoDrive API library
import CkInoDriveAPI
Create InoDrive Object instance over WebSocket connection.
# Connect by Module Name
drive = CkInoDriveAPI.InoDrive(target='Name')
# Connect by Module Serial Number
drive = CkInoDriveAPI.InoDrive(target='SN')
# Connect by IP Address
drive = CkInoDriveAPI.InoDrive(target='IPv4 Address')
# Optional parameter to have Module automatically connect upon creation
drive = CkInoDriveAPI.InoDrive(target='IPv4 Address', autoConnect=True)
Get Discovery Information from Module.
# Connect by Module Name
drive = CkInoDriveAPI.InoDrive(target='Name')
# Get Discovery Information
discoverInfo = drive.get_discover_info()
# Disconnect from the drive
drive.disconnect()
# Drive object cleanup
drive.dispose()
Read variable from the Module and based on condition write a variable back.
# Create InoDrive instance by Module Serial Number and connect
drive = CkInoDriveAPI.InoDrive(target='SN', autoConnect=True)
# Read variable with name 'VariableName'
var1 = drive.read_var('VariableName')
# Write out new value to variable 'VariableName' if it's value equals 1
if var1 == 1:
drive.write_var('VariableName', 2)
# Disconnect from the drive
drive.disconnect()
# Drive object cleanup
drive.dispose()
Read the Module configuration file and change it's Name. Change takes effect after power cycle.
# Create InoDrive instance by Module Serial Number and connect
drive = CkInoDriveAPI.InoDrive(target='SN', autoConnect=True)
# Get Module Configuration File
content = drive.read_module_config()
# Change Module Name
content['name'] = "NewName"
#Write Out to Configuration File
drive.write_module_config(content)
# Disconnect from the drive
drive.disconnect()
# Drive object cleanup
drive.dispose()
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
CK-InoDrive-API-0.2.8b0.tar.gz
(22.0 kB
view hashes)
Built Distribution
Close
Hashes for CK_InoDrive_API-0.2.8b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93a3ce63109bf1a4b29a3d8cb346ac731de973b4364ab9ff424f89664a9216ad |
|
MD5 | 69e68e7da7b01fa7393c5bb7b00c0308 |
|
BLAKE2b-256 | 72f03ee5045a2fd5c64c26ea7de867c627167333f7e6a309c386c4cfade6b7b2 |