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

Uploaded Source

Built Distribution

midea_local-3.0.1-py3-none-any.whl (141.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: midea_local-3.0.1.tar.gz
  • Upload date:
  • Size: 84.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for midea_local-3.0.1.tar.gz
Algorithm Hash digest
SHA256 6d0e73067cdba7ab36edf8f0e4b37b021d15dff46c63f6593c71143a1ed62230
MD5 f95bc785c3f51930b54a9cce6de2e179
BLAKE2b-256 0d69a1e8d05846c2dba1febf7f34c5206ff405ca5e182af9c51bc1b351d2b60a

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: midea_local-3.0.1-py3-none-any.whl
  • Upload date:
  • Size: 141.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for midea_local-3.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d5e0f77bd4b0f81abe3110c89fc9f4068691cdf21f49bf74574dae81f28abe1f
MD5 74e473640657bd7675aafdcef51cfc03
BLAKE2b-256 ccd3fbc08e826131e45f53701a99d63ec6f10fe9e401a3b7a33b3c66bf933f30

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