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-6.5.0.tar.gz (104.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

midea_local-6.5.0-py3-none-any.whl (164.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: midea_local-6.5.0.tar.gz
  • Upload date:
  • Size: 104.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for midea_local-6.5.0.tar.gz
Algorithm Hash digest
SHA256 0cffb43c997e73fe27568fdb75cc9c3cbb095c29c872c611bac4f194124c164a
MD5 8c4cbf2a71c49f5ceb085cb4db6e315d
BLAKE2b-256 ac0df7b23724b4f127f5114eeabe923a2b21f1df2eba9b8f7965dd5f029b9005

See more details on using hashes here.

File details

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

File metadata

  • Download URL: midea_local-6.5.0-py3-none-any.whl
  • Upload date:
  • Size: 164.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for midea_local-6.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a63eee8dc9062ffd20c05cd55ed45d563b2ed88a03e0d529bba6b190fff61ce
MD5 68371a4c01a6552dc681bf8e91a0a76a
BLAKE2b-256 a1dd8ef77aea86428f834c18f1dc2c6df5f60e1be41ba5cedf697518920eb5d2

See more details on using hashes here.

Supported by

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