Skip to main content

Python client to communicate with Moodo API

Project description

pymoodo

Python client to communicate with Moodo API.

How to use

import asyncio
import sys
import logging
from pymoodo import Controller

async def main(email, password):
    controller = await Controller(email, password)

    # Turn on MoodoBox
    for id in controller.boxes:
        controller.boxes[id].turn_on(100)
        # controller.boxes[id].set_fan_speed(21)

        controller.boxes[id].slots[0].set_fan_speed(100)
        controller.boxes[id].slots[1].set_fan_speed(100)
        controller.boxes[id].slots[2].set_fan_speed(100)
        controller.boxes[id].slots[3].set_fan_speed(100)

        for slot_id in controller.boxes[id].slots:
            slot = controller.boxes[id].slots[slot_id]
            slot.turn_on()
            slot.set_fan_speed(100)

        for slot_id in controller.boxes[id].slots:
            slot = controller.boxes[id].slots[slot_id]
            slot.turn_off()

        controller.boxes[id].turn_off()

        while True:
            pass

if __name__ == "__main__":
    if len(sys.argv) == 3:
        asyncio.get_event_loop().run_until_complete(main(sys.argv[1], sys.argv[2]))
    else:
        print('Run example with arguments <email> <password>')

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

pymoodo-0.0.4.tar.gz (5.7 kB view hashes)

Uploaded source

Built Distribution

pymoodo-0.0.4-py3-none-any.whl (6.6 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page