Skip to main content

Midea-local python lib

Python build codecov

中文版 / Chinese README

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,
    device_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)

command line tool

python3 -m midealocal.cli -h

Development

This project uses uv for its development environment. After installing uv:

git clone https://github.com/midea-lan/midea-local.git
cd midea-local
./scripts/setup.sh          # Linux / macOS / WSL2  (Windows: scripts\setup.ps1)

This creates a .venv, installs all dependencies, and sets up the prek hooks. Run tools with uv run, e.g. uv run python -m pytest ./tests/. See the contributing guide for the full workflow and per-OS uv install instructions.

Contributing Guide

CONTRIBUTING 中文版CONTRIBUTING

Release files for midea-local 11.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for midea-local 11.0.1
File Size Uploaded
midea_local-11.0.1.tar.gz 161.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for midea-local 11.0.1
File Interpreter ABI Platform
midea_local-11.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 376.2 kB

Release files / midea_local-11.0.1.tar.gz

Download URL midea_local-11.0.1.tar.gz
Size 161.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f1280d79988a6d6db68aea0721729aecc8940cda27320370bcc81cab2c200dd6
BLAKE2b-256 checksum
How to use checksums
648b470a94380e8ece69d237cf2c4cfffa5c5bf2148294b30fc4fdb6595bb24b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.

Transparency log

Release files / midea_local-11.0.1-py3-none-any.whl

Download URL midea_local-11.0.1-py3-none-any.whl
Size 215.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f759581cbc8fc7b256c440c7ae016119191833c34a55708e4f3dcc5732bf741a
BLAKE2b-256 checksum
How to use checksums
273e3b2b0b0733bb22d753dc04f56e17c5b00eb1e757c31307c651e9b811702e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.

Transparency log

Release history Release notifications | RSS feed

12.1.0

2 release files

12.0.0

2 release files

This release

11.0.1 This release

2 release files

10.1.0

2 release files

10.0.1

2 release files

10.0.0

2 release files

9.0.0

2 release files

8.0.1

2 release files

8.0.0

2 release files

7.0.0

2 release files

6.11.1

2 release files

6.11.0

2 release files

6.10.0

2 release files

6.9.0

2 release files

6.8.0

2 release files

6.7.2

2 release files

6.6.1

2 release files

6.6.0

2 release files

6.5.0

2 release files

6.4.0

2 release files

6.3.0

2 release files

6.2.0

2 release files

6.1.0

2 release files

6.0.3

2 release files

6.0.2

2 release files

6.0.1

2 release files

6.0.0

2 release files

5.0.0

2 release files

4.0.0

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.7.1

2 release files

2.7.0

2 release files

2.6.3

2 release files

2.6.2

2 release files

2.6.1

2 release files

2.6.0

2 release files

2.5.0

2 release files

2.4.0

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page