diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-05-05 10:20:13 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-05-05 10:20:13 +0000 |
| commit | d43a6f9b35830dca8bd8e006d0e9ea45a9526b5f (patch) | |
| tree | e0cd311e0f4fb85a4ab9d7c96be279a8bed319d5 | |
| parent | c81ec37bc3acd858c2a865037516b0b868b5b747 (diff) | |
automatic import of python-pymyqopeneuler20.03
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-pymyq.spec | 597 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 599 insertions, 0 deletions
@@ -0,0 +1 @@ +/pymyq-3.1.6.tar.gz diff --git a/python-pymyq.spec b/python-pymyq.spec new file mode 100644 index 0000000..f2583ed --- /dev/null +++ b/python-pymyq.spec @@ -0,0 +1,597 @@ +%global _empty_manifest_terminate_build 0 +Name: python-pymyq +Version: 3.1.6 +Release: 1 +Summary: Python package for controlling MyQ-Enabled Garage Door +License: MIT +URL: https://github.com/arraylabs/pymyq +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/67/a5/61a0824d1cd35fb104ae4b4250b94a40b06dc3738577a94cd11e8cff7fd1/pymyq-3.1.6.tar.gz +BuildArch: noarch + +Requires: python3-aiohttp +Requires: python3-beautifulsoup4 +Requires: python3-pkce + +%description + +# Introduction + +This is a Python 3.8+ module aiming to interact with the Chamberlain MyQ API. + +Code is licensed under the MIT license. + +# [Homeassistant](https://home-assistant.io) + +[Homeassistant](https://home-assistant.io) has a [core myQ component](https://www.home-assistant.io/integrations/myq/) leveraging this package. +In addition, there is also a [HACS myQ component](https://github.com/ehendrix23/hass_myq) available that can be added into HACS as a custom repository. + +# Getting Started + +## Installation + +```python +pip install pymyq +``` + +## Usage + +`pymyq` starts within an [aiohttp](https://aiohttp.readthedocs.io/en/stable/) +`ClientSession`: + +```python +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: + +```python +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 only lamps devices: + devices = myq.lamps + # >>> {"serial_number123": <Device>} + + # Return only locks devices: + devices = myq.locks + # >>> {"serial_number123": <Device>} + + # Return only gateway devices: + devices = myq.gateways + # >>> {"serial_number123": <Device>} + + # Return *all* devices: + devices = myq.devices + # >>> {"serial_number123": <Device>, "serial_number456": <Device>} + + +asyncio.get_event_loop().run_until_complete(main()) +``` + +## API Properties + +- `accounts`: dictionary with all accounts (MyQAccount) +- `covers`: dictionary with all covers (MyQGarageDoor) +- `devices`: dictionary with all devices (MyQDevice) +- `gateways`: dictionary with all gateways (MyQDevice) +- `lamps`: dictionary with all lamps (MyQLamp) +- `locks`: dictionary with all locks (MyQLock) +- `last_state_update`: datetime (in UTC) last state update was retrieved for all items +- `password`: password used for authentication. Can only be set, not retrieved +- `username`: username for authentication. + +## Account Properties (MyQAccount) + +- `api`: Associated API object +- `id`: ID for the account +- `name`: Name of the account +- `covers`: dictionary with all covers for account (MyQGarageDoor) +- `devices`: dictionary with all devices for account (MyQDevice) +- `gateways`: dictionary with all gateways for account (MyQDevice) +- `lamps`: dictionary with all lamps for account (MyQLamp) +- `locks`: dictionary with all locks for account (MyQLock) +- `account_json`: Dictionary containing all account information as retrieved from MyQ +- `last_state_update`: datetime (in UTC) last state update was retrieved for all devices within this account + +## Device Properties + +- `account`: Return account associated with device (MyQAccount) +- `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_json`: Dictionary containing all device information as retrieved from MyQ +- `device_platform`: Return the device platform. +- `device_type`: Return the device type. +- `firmware_version`: Return the family in which this device lives. +- `href`: URI for device +- `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. +- `state_update`: Returns datetime when device was last updated +- `low_battery`: Returns if the garage has a low battery or not. + +## API Methods + +These are coroutines and need to be `await`ed – see `example.py` for examples. + +- `authenticate`: Authenticate (or re-authenticate) to MyQ. Call this to + re-authenticate immediately after changing username and/or password otherwise + new username/password will only be used when token has to be refreshed. +- `update_device_info`: Retrieve info and status for all accounts and devices + +## Account Methods + +All of the routines on the `MyQAccount` class are coroutines and need to be +`await`ed – see `example.py` for examples. + +- `update`: get the latest device info (state, etc.) for all devices associated with this account. + +## Device Methods + +All of the routines on the `MyQDevice` class are coroutines and need to be +`await`ed – see `example.py` for examples. + +- `update`: get the latest device info (state, etc.). Note that + this runs MyQAccount.update and thus all devices within account will be updated + +## Cover Methods + +All Device methods in addition to: + +- `close`: close the cover +- `open`: open the cover + +## Lamp Methods + +All Device methods in addition to: + +- `turnon`: turn lamp on +- `turnoff`: turn lamp off + +# Acknowledgement + +Huge thank you to [hjdhjd](https://github.com/hjdhjd) for figuring out the updated V6 API and +sharing his work with us. + +# Disclaimer + +The code here is based off of an unsupported API from +[Chamberlain](http://www.chamberlain.com/) 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. + + + + +%package -n python3-pymyq +Summary: Python package for controlling MyQ-Enabled Garage Door +Provides: python-pymyq +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-pymyq + +# Introduction + +This is a Python 3.8+ module aiming to interact with the Chamberlain MyQ API. + +Code is licensed under the MIT license. + +# [Homeassistant](https://home-assistant.io) + +[Homeassistant](https://home-assistant.io) has a [core myQ component](https://www.home-assistant.io/integrations/myq/) leveraging this package. +In addition, there is also a [HACS myQ component](https://github.com/ehendrix23/hass_myq) available that can be added into HACS as a custom repository. + +# Getting Started + +## Installation + +```python +pip install pymyq +``` + +## Usage + +`pymyq` starts within an [aiohttp](https://aiohttp.readthedocs.io/en/stable/) +`ClientSession`: + +```python +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: + +```python +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 only lamps devices: + devices = myq.lamps + # >>> {"serial_number123": <Device>} + + # Return only locks devices: + devices = myq.locks + # >>> {"serial_number123": <Device>} + + # Return only gateway devices: + devices = myq.gateways + # >>> {"serial_number123": <Device>} + + # Return *all* devices: + devices = myq.devices + # >>> {"serial_number123": <Device>, "serial_number456": <Device>} + + +asyncio.get_event_loop().run_until_complete(main()) +``` + +## API Properties + +- `accounts`: dictionary with all accounts (MyQAccount) +- `covers`: dictionary with all covers (MyQGarageDoor) +- `devices`: dictionary with all devices (MyQDevice) +- `gateways`: dictionary with all gateways (MyQDevice) +- `lamps`: dictionary with all lamps (MyQLamp) +- `locks`: dictionary with all locks (MyQLock) +- `last_state_update`: datetime (in UTC) last state update was retrieved for all items +- `password`: password used for authentication. Can only be set, not retrieved +- `username`: username for authentication. + +## Account Properties (MyQAccount) + +- `api`: Associated API object +- `id`: ID for the account +- `name`: Name of the account +- `covers`: dictionary with all covers for account (MyQGarageDoor) +- `devices`: dictionary with all devices for account (MyQDevice) +- `gateways`: dictionary with all gateways for account (MyQDevice) +- `lamps`: dictionary with all lamps for account (MyQLamp) +- `locks`: dictionary with all locks for account (MyQLock) +- `account_json`: Dictionary containing all account information as retrieved from MyQ +- `last_state_update`: datetime (in UTC) last state update was retrieved for all devices within this account + +## Device Properties + +- `account`: Return account associated with device (MyQAccount) +- `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_json`: Dictionary containing all device information as retrieved from MyQ +- `device_platform`: Return the device platform. +- `device_type`: Return the device type. +- `firmware_version`: Return the family in which this device lives. +- `href`: URI for device +- `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. +- `state_update`: Returns datetime when device was last updated +- `low_battery`: Returns if the garage has a low battery or not. + +## API Methods + +These are coroutines and need to be `await`ed – see `example.py` for examples. + +- `authenticate`: Authenticate (or re-authenticate) to MyQ. Call this to + re-authenticate immediately after changing username and/or password otherwise + new username/password will only be used when token has to be refreshed. +- `update_device_info`: Retrieve info and status for all accounts and devices + +## Account Methods + +All of the routines on the `MyQAccount` class are coroutines and need to be +`await`ed – see `example.py` for examples. + +- `update`: get the latest device info (state, etc.) for all devices associated with this account. + +## Device Methods + +All of the routines on the `MyQDevice` class are coroutines and need to be +`await`ed – see `example.py` for examples. + +- `update`: get the latest device info (state, etc.). Note that + this runs MyQAccount.update and thus all devices within account will be updated + +## Cover Methods + +All Device methods in addition to: + +- `close`: close the cover +- `open`: open the cover + +## Lamp Methods + +All Device methods in addition to: + +- `turnon`: turn lamp on +- `turnoff`: turn lamp off + +# Acknowledgement + +Huge thank you to [hjdhjd](https://github.com/hjdhjd) for figuring out the updated V6 API and +sharing his work with us. + +# Disclaimer + +The code here is based off of an unsupported API from +[Chamberlain](http://www.chamberlain.com/) 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. + + + + +%package help +Summary: Development documents and examples for pymyq +Provides: python3-pymyq-doc +%description help + +# Introduction + +This is a Python 3.8+ module aiming to interact with the Chamberlain MyQ API. + +Code is licensed under the MIT license. + +# [Homeassistant](https://home-assistant.io) + +[Homeassistant](https://home-assistant.io) has a [core myQ component](https://www.home-assistant.io/integrations/myq/) leveraging this package. +In addition, there is also a [HACS myQ component](https://github.com/ehendrix23/hass_myq) available that can be added into HACS as a custom repository. + +# Getting Started + +## Installation + +```python +pip install pymyq +``` + +## Usage + +`pymyq` starts within an [aiohttp](https://aiohttp.readthedocs.io/en/stable/) +`ClientSession`: + +```python +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: + +```python +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 only lamps devices: + devices = myq.lamps + # >>> {"serial_number123": <Device>} + + # Return only locks devices: + devices = myq.locks + # >>> {"serial_number123": <Device>} + + # Return only gateway devices: + devices = myq.gateways + # >>> {"serial_number123": <Device>} + + # Return *all* devices: + devices = myq.devices + # >>> {"serial_number123": <Device>, "serial_number456": <Device>} + + +asyncio.get_event_loop().run_until_complete(main()) +``` + +## API Properties + +- `accounts`: dictionary with all accounts (MyQAccount) +- `covers`: dictionary with all covers (MyQGarageDoor) +- `devices`: dictionary with all devices (MyQDevice) +- `gateways`: dictionary with all gateways (MyQDevice) +- `lamps`: dictionary with all lamps (MyQLamp) +- `locks`: dictionary with all locks (MyQLock) +- `last_state_update`: datetime (in UTC) last state update was retrieved for all items +- `password`: password used for authentication. Can only be set, not retrieved +- `username`: username for authentication. + +## Account Properties (MyQAccount) + +- `api`: Associated API object +- `id`: ID for the account +- `name`: Name of the account +- `covers`: dictionary with all covers for account (MyQGarageDoor) +- `devices`: dictionary with all devices for account (MyQDevice) +- `gateways`: dictionary with all gateways for account (MyQDevice) +- `lamps`: dictionary with all lamps for account (MyQLamp) +- `locks`: dictionary with all locks for account (MyQLock) +- `account_json`: Dictionary containing all account information as retrieved from MyQ +- `last_state_update`: datetime (in UTC) last state update was retrieved for all devices within this account + +## Device Properties + +- `account`: Return account associated with device (MyQAccount) +- `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_json`: Dictionary containing all device information as retrieved from MyQ +- `device_platform`: Return the device platform. +- `device_type`: Return the device type. +- `firmware_version`: Return the family in which this device lives. +- `href`: URI for device +- `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. +- `state_update`: Returns datetime when device was last updated +- `low_battery`: Returns if the garage has a low battery or not. + +## API Methods + +These are coroutines and need to be `await`ed – see `example.py` for examples. + +- `authenticate`: Authenticate (or re-authenticate) to MyQ. Call this to + re-authenticate immediately after changing username and/or password otherwise + new username/password will only be used when token has to be refreshed. +- `update_device_info`: Retrieve info and status for all accounts and devices + +## Account Methods + +All of the routines on the `MyQAccount` class are coroutines and need to be +`await`ed – see `example.py` for examples. + +- `update`: get the latest device info (state, etc.) for all devices associated with this account. + +## Device Methods + +All of the routines on the `MyQDevice` class are coroutines and need to be +`await`ed – see `example.py` for examples. + +- `update`: get the latest device info (state, etc.). Note that + this runs MyQAccount.update and thus all devices within account will be updated + +## Cover Methods + +All Device methods in addition to: + +- `close`: close the cover +- `open`: open the cover + +## Lamp Methods + +All Device methods in addition to: + +- `turnon`: turn lamp on +- `turnoff`: turn lamp off + +# Acknowledgement + +Huge thank you to [hjdhjd](https://github.com/hjdhjd) for figuring out the updated V6 API and +sharing his work with us. + +# Disclaimer + +The code here is based off of an unsupported API from +[Chamberlain](http://www.chamberlain.com/) 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. + + + + +%prep +%autosetup -n pymyq-3.1.6 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-pymyq -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Fri May 05 2023 Python_Bot <Python_Bot@openeuler.org> - 3.1.6-1 +- Package Spec generated @@ -0,0 +1 @@ +d5daa084470616e6767d28b0b2365135 pymyq-3.1.6.tar.gz |
