Python API for ELV MAX! Cube
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
Johann Schmitz ad1f2aae5d Update Makefile 1 год назад
src/pymax Parse measured temperature data from heater thermostat 3 лет назад
tests -fixed some tabbing issues 3 лет назад
.gitignore Updated .gitignore 4 лет назад
.travis.yml Updated Makefile and travis.yml 4 лет назад
LICENSE.txt Initial commit 4 лет назад
Makefile Update Makefile 1 год назад
README.md Updated readme 4 лет назад
requirements.txt Added more tests 4 лет назад
setup.cfg Added setup.py/setup.cfg 4 лет назад
setup.py Release 0.5 3 лет назад

README.md

pymax

Build Status Coverage Status

Basics

Requirements

Supported Python versions: Python 2.7.9+, 3.3, 3.4, 3.5, 3.6 (nightly) and PyPy 2.5.0.

Installation

If you are on Gentoo Linux, run

emerge dev-python/pymax --ask

otherwise use pip

pip install pymax

Usage

Discovery

To find any cube in your network:

from pymax.cube import Discovery

response = Discovery().discover()
print(response)

To find a specific cube in your network:

from pymax.cube import Discovery
response = Discovery().discover(cube_serial=u'LEQ1154727', discovery_type=Discovery.DISCOVERY_TYPE_NETWORK_CONFIG)
print(response)
>>> LEQ1154727: IP: 10.10.10.153, Netmask: 255.255.255.0, Gateway: 10.10.10.1, DNS1: 10.10.10.1, DNS2: 0.0.0.0

Connecting

from pymax.cube import Cube, Connection

cube = Cube('192.168.1.123')
# or
cube = Cube('192.168.1.123', 62910)
# or
cube = Cube(address='192.168.1.123', port=62910)
# or
cube = Cube(Connection(('192.168.1.123', 62910))

try:
    cube.connect()
    
    # fun code here
finally:
    cube.disconnect()

The Cube object implements a context manager, so it's easier to write:

from pymax.cube import Cube

with Cube('192.168.1.123') as cube:
    # fun code here

or, together with a discovery query:

response = Discovery().discover(cube_serial=u'LEQ1154727', discovery_type=Discovery.DISCOVERY_TYPE_NETWORK_CONFIG)
with Cube(response.ip_address) as cube:
    print(cube)

Basic Usage

with Cube(response.ip_address) as cube:
    for room in cube.rooms:
        print("%s:" % room.name)
        for device in room.devices:
            print("  %s (%s), serial: %s" % (device.name, device.type, device.serial))

Protocol

Resources:

License

See LICENSE.txt