Skip to main content

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


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)

Uploaded Source

Built Distribution

CK_InoDrive_API-0.2.8b0-py3-none-any.whl (26.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page