A async client for interacting with the MELCloud API
Project description
Project Name: asyncio-melcloud-lib
Description:
This project is a Python library that provides an asynchronous interface for interacting with the MelCloud API. It allows users to control and monitor Mitsubishi Electric air conditioning units remotely using asyncio.
Features:
- Asynchronous API calls for improved performance and responsiveness.
- Support for authentication and authorization with the MelCloud API.
- Ability to control and monitor multiple air conditioning units.
- Comprehensive documentation and examples for easy integration.
Installation:
To install the asyncio-melcloud-lib library, simply run the following command:
pip install melcloudlibasyncio
Usage:
To get started with the asyncio-melcloud-lib library, import it into your Python project:
import melcloudlibasyncio
Then, create an instance of the MelCloudClient
class and authenticate with your MelCloud credentials:
client = melcloudlibasyncio.MelCloudClient(username='your_username', password='your_password')
await client.login()
Once authenticated, you can use the various methods provided by the library to control and monitor your air conditioning units.
Examples:
Here are a few examples to help you get started:
- Get a list of all available devices:
devices = await client.get_devices()
- Set the temperature of a specific device:
await client.set_temp(device_id='device_id', temperature=22)
- Example of complete code (Login and turns off the device):
import asyncio
from lib.melcloud.devices import Device
from lib.melcloud.melcloudclient import MelcloudClient
from lib.melcloud.jsongenerator import OperationMode
import logging
basicConfig = logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
client = MelcloudClient("your_undername", "your_password")
async def main():
logging.debug(await client.login())
await client.get_devices()
await client.set_device_settings()
for device in client.devices:
await client.change_power_state(device.device_id, "true") # <---- set this to false to turn off the device
await client.close()
if __name__ == "__main__":
asyncio.run(main())
For more examples and detailed documentation, please refer to the official documentation.
Contributing:
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request on the GitHub repository.
License:
This project is licensed under the MIT License. See the LICENSE file for more information.
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
Built Distribution
File details
Details for the file melcloudlibasyncio-1.1.1.tar.gz
.
File metadata
- Download URL: melcloudlibasyncio-1.1.1.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84c00d5ca8cbda05c0bc3f43bc4a7f685a99d5d0fe329d965b84dc6e32b917f7 |
|
MD5 | 6808590db1bc474bf3ae36c743563f20 |
|
BLAKE2b-256 | d149f31520f7cac44e05fe6d0175b6c6c8c03db5a8e17cf8fd2a9639cd5b386d |
File details
Details for the file melcloudlibasyncio-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: melcloudlibasyncio-1.1.1-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d08cf2adbc6ab663d80659b54c09a0bfa75891e315fed8cfefd830a705c4580 |
|
MD5 | 822168028cbcfde3443c5ea3f3d241e1 |
|
BLAKE2b-256 | 9625d607db8bd0661e2b5e414eef3bf68a6b730f2435b29c472727e98ea0ba59 |