Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

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:
      myq = await pymyq.login('<EMAIL>', '<PASSWORD>', websession)

      # Return only cover devices:
      devices = myq.covers
      # >>> {"serial_number123": <Device>}

      # Return *all* devices:
      devices = myq.devices
      # >>> {"serial_number123": <Device>, "serial_number456": <Device>}


asyncio.get_event_loop().run_until_complete(main())

Device Properties

  • close_allowed: Return whether the device can be closed unattended.
  • device_family: Return the family in which this device lives.
  • device_id: Return the device ID (serial number).
  • device_platform: Return the device platform.
  • device_type: Return the device type.
  • firmware_version: Return the family in which this device lives.
  • name: Return the device name.
  • online: Return whether the device is online.
  • open_allowed: Return whether the device can be opened unattended.
  • parent_device_id: Return the device ID (serial number) of this device's parent.
  • state: Return the current state of the device.

Methods

All of the routines on the MyQDevice class are coroutines and need to be awaited – see example.py for examples.

  • close: close the device
  • open: open the device
  • update: get the latest device info (state, etc.)

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pymyq, version 2.0.8
Filename, size File type Python version Upload date Hashes
Filename, size pymyq-2.0.8-py2.py3-none-any.whl (8.2 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size pymyq-2.0.8.tar.gz (8.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page