Skip to main content

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


Download files

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

Source Distribution

melcloudlibasyncio-1.1.1.dev2.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

melcloudlibasyncio-1.1.1.dev2-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file melcloudlibasyncio-1.1.1.dev2.tar.gz.

File metadata

File hashes

Hashes for melcloudlibasyncio-1.1.1.dev2.tar.gz
Algorithm Hash digest
SHA256 4efb599a1bd7a12ba8cc1cfc4ec482bb1eae0b0a5f8f0ddfcdfcc930e57956ed
MD5 d2bb88b451ce81ba91d3367c10f5f744
BLAKE2b-256 3f9eb94173dca4288f69f34fd8f6a03f4d0e67b95f0a606f00aa11287ee5825f

See more details on using hashes here.

File details

Details for the file melcloudlibasyncio-1.1.1.dev2-py3-none-any.whl.

File metadata

File hashes

Hashes for melcloudlibasyncio-1.1.1.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 4ad8c7e4844d538c90b832bb37ebfec546c0db166c1de1fd7b3a6e3530cccaf8
MD5 7aa3837038e14367be0b663d2150379b
BLAKE2b-256 fe12287ff22081a63c28f8eec93853934392822e82ff8eef28687945c93e43ad

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page