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

Contributing Guide

CONTRIBUTING 中文版CONTRIBUTING

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.10.0.tar.gz (120.6 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.10.0-py3-none-any.whl (179.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: midea_local-6.10.0.tar.gz
  • Upload date:
  • Size: 120.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for midea_local-6.10.0.tar.gz
Algorithm Hash digest
SHA256 09b375c8a61014a6e4c8f7bbece2671c0f06ccfbda7e4728e85d5796d0e55835
MD5 2350e534cb23de91feea780a1508aa31
BLAKE2b-256 ac00423d763aba0deee4a65d01ba406b5bcdbaacf6623091cc35831369e789c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for midea_local-6.10.0.tar.gz:

Publisher: python-build.yml on midea-lan/midea-local

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: midea_local-6.10.0-py3-none-any.whl
  • Upload date:
  • Size: 179.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for midea_local-6.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 178d2bc4cf938b98ec436d077036de930447a1f469064b5fb989bb131b56a7a1
MD5 56b6c73f1c97ef422d157aa1522ddb66
BLAKE2b-256 b3b807f1ec485f6929439001f409ef148b269726b6fce996e06b1e50fa43fe10

See more details on using hashes here.

Provenance

The following attestation bundles were made for midea_local-6.10.0-py3-none-any.whl:

Publisher: python-build.yml on midea-lan/midea-local

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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