Skip to main content

It is a module to make easier communication with MySensor's network.

Project description

pyMYS

It is a module to make easier communication with MySensor’s network.

Documentation

Currently, all documentation can be accessed in project’s GitHub page.

Dependencies

You can find all dependencies in requirements.txt and install them using pip.

Installation

python setup.py install

or

pip pymys

Support

This project should support all Python 3 versions. However, it was onlye tested with Python 3.4.

Examples

If you just want to print all messages that your Gateway send to you.

from pymys import mysensors as mys


def show_msg(msg):
    print(msg)

gw = mys.SerialGateway("/dev/ttyACM0", message_callback=show_msg)
print("Trying to connect...")
gw.connect()
print("Connected!")

while True:
    gw.process()

Creating an application with threads which allow you write raw messages and send to your network over your Gateway

import threading

from pymys import mysensors as mys


def run_gateway():
    while True:
        gw.process()


def show_msg(msg):
    print("Read: {}".format(msg))

gw = mys.SerialGateway("/dev/ttyACM0", message_callback=show_msg)
print("Trying to connect...")
gw.connect()
print("Connected!")

t = threading.Thread(target=run_gateway)
t.start()

while True:
    data = input("")
    msg = mys.Message(data)
    gw.send(msg)

What’s new

  • Base structure for Gateway

  • Support to Serial Gateway

  • Support to protocol 1.4

  • Support to protocol 1.5

  • Support to protocol 1.6

  • Support to change callback functions

  • Support to get dinamically the protocol version from the Gateway

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

pymys-0.2.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

pymys-0.2-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file pymys-0.2.tar.gz.

File metadata

  • Download URL: pymys-0.2.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pymys-0.2.tar.gz
Algorithm Hash digest
SHA256 b76c48291569ff956197ade99435516c73681fd603e16778372858278dc6f22f
MD5 c046ba67a501cbf3ae4e95c214b51cd2
BLAKE2b-256 d56c9f602f8bb1ce6804bf7a5baeb8889bc7d91ab1521b78000fba65b06990aa

See more details on using hashes here.

File details

Details for the file pymys-0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pymys-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fd7a305882eed73c9a42380dfe8c5b24f758b5faf25c43520f5a45980a090bb8
MD5 733cd9fab8811356a3f5a1a8752a457e
BLAKE2b-256 f1cdc6a7858b6aeef97977435f7745b5cede7edfedb3bdbcbc923cb428c65080

See more details on using hashes here.

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