Python package for controlling MyQ-Enabled Garage Door
Project description
Introduction
This is a Python 3.5+ module aiming to interact with the Chamberlain MyQ API.
Code is licensed under the MIT license.
Getting Started
Installation
pip install pymyq
Usage
pymyq
starts within an aiohttp
ClientSession
:
import asyncio
from aiohttp import ClientSession
async def main() -> None:
"""Create the aiohttp session and run."""
async with ClientSession() as websession:
# YOUR CODE HERE
asyncio.get_event_loop().run_until_complete(main())
To get all MyQ devices associated with an account:
import asyncio
from aiohttp import ClientSession
import pymyq
async def main() -> None:
"""Create the aiohttp session and run."""
async with ClientSession() as websession:
# Valid Brands: 'chamberlain', 'craftsman', 'liftmaster', 'merlin'
myq = await pymyq.login('<EMAIL>', '<PASSWORD>', '<BRAND>', websession)
# Return only cover devices:
devices = await myq.get_devices()
# Return *all* devices:
devices = await myq.get_devices(covers_only=False)
asyncio.get_event_loop().run_until_complete(main())
Device Properties
brand
: the brand of the devicedevice_id
: the device's MyQ IDparent_id
: the device's parent device's MyQ IDname
: the name of the deviceavailable
: if device is onlineserial
: the serial number of the devicestate
: the device's current statetype
: the type of MyQ deviceopen_allowed
: if device can be opened unattendedclose_allowed
: if device can be closed unattended
Methods
All of the routines on the MyQDevice
class are coroutines and need to be
await
ed.
close
: close the deviceopen
: open the deviceupdate
: get the latest device state (which can then be accessed via thestate
property). Retrieval of state from cloud is will only be done if more then 5 seconds has elapsed since last request. State for all devices is retrieved through (1) request.close_connection
: close web session connection, will only close the web session if none was provided initially
Disclaimer
The code here is based off of an unsupported API from Chamberlain and is subject to change without notice. The authors claim no responsibility for damages to your garage door or property by use of the code within.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pymyq-1.2.0.tar.gz
(8.2 kB
view hashes)
Built Distribution
Close
Hashes for pymyq-1.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee830e45f3feb358fa65e4963c23316c9f3f5ef215dac8e47a2b0d700fb31853 |
|
MD5 | 4cdb319b2e8294109348af7023e338a6 |
|
BLAKE2b-256 | ebac1319708e30e15deb0ad8f61b88f9f36b1bc8035524d207251f01ef90026f |