Skip to main content

Library for interacting with millheat api

Project description

pymillheat

Python3 wrapper for interacting with millheat api.

Features:

  • Temperature readings.
  • Ability to change set temperature.
  • Turn the device on/off.
  • Device ID, room ID, user ID.

Install

pip3 install pymillheat

Example

import pymillheat
import asyncio

async def main():
    await mill.open_connection()

    mill.access_token
    mill.authorization_code
    mill.refresh_token

    await mill.refresh_access_token()

    await mill.get_home_list()
    mill.homes_information

    await mill.get_room_by_home(home_id)
    mill.rooms_information

    await mill.get_device_by_room(room_id)
    mill.devices_information

    await mill.get_independent_devices(home_id)
    mill.independent_devices_information

    await mill.switch_control_device(device_id, status, retry=1)
    await mill.temperature_control_device(device_id, status, hold_temp=None, retry=1)

if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    mill = Mill(
        access_key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        secret_token="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
        username="example@mail.com",
        password="password123",
        loop=loop,
    )
    try:
        loop.run_until_complete(main())
    except (KeyboardInterrupt, SystemExit):
        pass
    finally:
        loop.run_until_complete(mill.close_connection())

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

pymillheat-1.0.4.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

pymillheat-1.0.4-py3-none-any.whl (5.5 kB view hashes)

Uploaded Python 3

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