Skip to main content

Control your Midea M-Smart appliances via local area network

Project description

Midea-local python lib

Python build codecov

Control your Midea M-Smart appliances via local area network.

This library is part of https://github.com/georgezhao2010/midea_ac_lan code. It was separated to segregate responsibilities.

⭐If this component is helpful for you, please star it, it encourages me a lot.

Getting started

Finding your device

from midealocal.discover import discover
# Without knowing the ip address
discover()
# If you know the ip address
discover(ip_address="203.0.113.11")
# The device type is in hexadecimal as in midealocal/devices/TYPE
type_code = hex(list(discover().values())[0]['type'])[2:]

Getting data from device

from midealocal.discover import discover
from midealocal.devices import device_selector

token = '...'
key = '...'

# Get the first device
d = list(discover().values())[0]
# Select the device
ac = device_selector(
  name="AC",
  device_id=d['device_id'],
  device_type=d['type'],
  ip_address=d['ip_address'],
  port=d['port'],
  token=token,
  key=key,
  protocol=d['protocol'],
  model=d['model'],
  subtype=0,
  customize="",
)

# Connect and authenticate
ac.connect()

# Getting the attributes
print(ac.attributes)
# Setting the temperature
ac.set_target_temperature(23.0, None)
# Setting the swing
ac.set_swing(False, False)

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

midea_local-1.3.1.tar.gz (74.2 kB view details)

Uploaded Source

Built Distribution

midea_local-1.3.1-py3-none-any.whl (129.5 kB view details)

Uploaded Python 3

File details

Details for the file midea_local-1.3.1.tar.gz.

File metadata

  • Download URL: midea_local-1.3.1.tar.gz
  • Upload date:
  • Size: 74.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for midea_local-1.3.1.tar.gz
Algorithm Hash digest
SHA256 dec256e92af441170e33d7db5434313f224bb7e88c0f42a9170b783dbc54217f
MD5 5c5ec83f26ee5957e72e50bba07fdf74
BLAKE2b-256 04c88ea5eaaa2e366ddef03370c6c27b4363ca9d6a321b8705349f2e69dd9340

See more details on using hashes here.

Provenance

File details

Details for the file midea_local-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: midea_local-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 129.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for midea_local-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4aec7a71d68a4c41573a4cba28fe2ae65a748a93d043ccd4c88a0eb4f88fae94
MD5 1906c281809f974b5c6cb5bc6401eb82
BLAKE2b-256 420867558e7f708598468e4a8610cfedb7669618c8086e4a5b8275025a9a421e

See more details on using hashes here.

Provenance

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