Skip to main content

Control your Midea M-Smart appliances via local area network

Project description

Midea-local python lib

Python build Python tests Python coverage Python fake8

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 responsabilities.

⭐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 and 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()
ac.authenticate()

# 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.0.2.tar.gz (61.3 kB view details)

Uploaded Source

Built Distribution

midea_local-1.0.2-py3-none-any.whl (108.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for midea_local-1.0.2.tar.gz
Algorithm Hash digest
SHA256 372af3231b4cd93dc618d88649cf3525d29cb460e0529cfab02c6d6acd202edb
MD5 6a794cf61698be7b59561fb83a2b37eb
BLAKE2b-256 a2ea0ea9a25fa96972559ef0c7ca93e6c983cfb84eafd21391999a6b76dd168b

See more details on using hashes here.

Provenance

File details

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

File metadata

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

File hashes

Hashes for midea_local-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7470d858fa41662bd1982799f31ce9f7f3fd68a7394125300d4b4000fe0f14b5
MD5 b3b96d269fcd427731e03453ab09e172
BLAKE2b-256 7c241b7c8e1f1fd2c0577e8d1e6ca1478ea21b214c26514218c7cd649d10c307

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