Skip to main content

Python library for Elmo control units

Project description

python-elmoclient

A Python module for communicating with Elmo control units via TCPIP protocol.

Installation

You can install the package via pip:

pip install python-elmoclient

Usage

from elmoclient import ElmoClient

# Initialize the client
client = ElmoClient(
    host="192.168.1.100",  # IP address of your Elmo control unit
    port=10001,            # Default port is 10001
    user="your_username",  # Optional: username for authentication
    password="your_password"  # Optional: password for authentication
)

# Start the client
client.start()

# Login to the system
client.accesso_sistema()

# Subscribe to events
def on_sector_change(sigtype, pos, value):
    print(f"Sector {pos} changed to {value}")

client.subscribe("settore", 1, on_sector_change)

# Arm a sector
client.inserisci_settore(1)

# Disarm a sector
client.disinserisci_settore(1)

# Stop the client when done
client.stop()

License

This project is licensed under the MIT License - see the LICENSE file for details.

Troubleshooting

TimeoutError

If you encounter a TimeoutError: timed out when using the client, it could be due to network issues or the Elmo control unit not responding in time. The client has built-in handling for timeouts, but you may need to adjust the timeout value:

client = ElmoClient(
    host="192.168.1.100",
    port=10001,
    timeout=5,  # Increase timeout to 5 seconds (default is 2)
    user="your_username",
    password="your_password"
)

Changelog

For a list of changes in each version, see the CHANGELOG.md file.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

python_elmoclient-0.0.9.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

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

python_elmoclient-0.0.9-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file python_elmoclient-0.0.9.tar.gz.

File metadata

  • Download URL: python_elmoclient-0.0.9.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for python_elmoclient-0.0.9.tar.gz
Algorithm Hash digest
SHA256 30c2a9fe8d6e95020e3eaeec66511aa661dc3cbade97df17d647b6f61afd25c6
MD5 a9bdd6fc2d9adce2d1f6eef20161f030
BLAKE2b-256 010b4167bc9d905b089fcf5e3321a6c3db8bd7a540fa12659ecd065a7fc2ce99

See more details on using hashes here.

File details

Details for the file python_elmoclient-0.0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for python_elmoclient-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 6e387315bb17c25f67cc3542c2a3812d1281c6d1f9d91c94c56f98ab04bced12
MD5 1d1d5e8a9f89bafb51cfd154216ed7c0
BLAKE2b-256 95bcffc7387e971ac6d0c5874c057fcb4ad73bd3f9eadef38ee1bcdab229c306

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