Skip to main content

InoDrive API Library

Project description

Installation

Install and Update package via pip

pip install CK-InoDrive-API

Usage

Importing Library

# Import InoDrive API library
import CkInoDriveAPI

Create InoDrive Object using WebSocket

# Create instance to InoDrive module object
# Connect by Name
Drive = CkInoDriveAPI.InoDrive(target='Name')

# Connect by Serial Number
Drive = CkInoDriveAPI.InoDrive(target='SN')

# Connect by IP Address
Drive = CkInoDriveAPI.InoDrive(target='IPv4 Address')

# Auto connect
Drive = CkInoDriveAPI.InoDrive(target='IPv4 Address', autoConnect=True)

Read and Write Variable's

# Connect to the drive
Drive.connect()

# Read variable with name 'VariableName'
Drive.UserApp.read_var('VariableName')

# Write variable with name 'VariableName' and value equal to 1
Drive.UserApp.write_var('VariableName', 1)

# Disconnect from the drive
Drive.disconnect()

# Drive object cleanup
Drive.dispose()

Get and Set Output's

# Connect to the drive
Drive.connect()

# Read Output 2
state = Drive.IO.get_output(2)

# Take control of InoDrive module to override output state
Drive.SysControl.take_control(True)

# Set Output 2 to On state
Drive.IO.set_output(2, True)
state = Drive.IO.get_output(2)

# Disable module override
Drive.SysControl.take_control(False)

# Disconnect from the drive
Drive.disconnect()

# Drive object cleanup
Drive.dispose()

Change Module Name (Power cycle InoDrive for changes to take effect)

# Connect to the drive
Drive.connect()

# Read module configuration file
config_file = Drive.File.read_module_config()

# Set new module name
config_file['name'] = "NewName"

# Write configuration changes out
Drive.File.write_module_config(config_file)

# Disconnect from the drive
Drive.disconnect()

# Drive object cleanup
Drive.dispose()

Links

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-1.0.2.tar.gz (49.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ck_inodrive_api-1.0.2-py3-none-any.whl (53.1 kB view details)

Uploaded Python 3

File details

Details for the file ck_inodrive_api-1.0.2.tar.gz.

File metadata

  • Download URL: ck_inodrive_api-1.0.2.tar.gz
  • Upload date:
  • Size: 49.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for ck_inodrive_api-1.0.2.tar.gz
Algorithm Hash digest
SHA256 23a843bd93164e22c979ee7a22761fd8edba5f1e3ea96a3a2a4218c655ee18b6
MD5 c0e5c80a0be4b9025f300edffa5f15a5
BLAKE2b-256 6a27cd562b60844d7cb3f8c9660ea1f90d0122250a68fbfeed7e7d5556e73dca

See more details on using hashes here.

File details

Details for the file ck_inodrive_api-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ck_inodrive_api-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 848cc910f6686db1c8ea3c3087a17a2e45380d5315db40c3e0b05fe84163c7b3
MD5 25787a56be83caee1e4e39ed60c91189
BLAKE2b-256 7c9f35737b210b1a4f6ad48834264103b3671702e33885b1b60160062e5fb405

See more details on using hashes here.

Supported by

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