Control your Midea M-Smart appliances via local area network
Project description
Midea-local python lib
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
Release history Release notifications | RSS feed
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.0.2.tar.gz
(84.8 kB
view details)
Built Distribution
midea_local-6.0.2-py3-none-any.whl
(143.1 kB
view details)
File details
Details for the file midea_local-6.0.2.tar.gz
.
File metadata
- Download URL: midea_local-6.0.2.tar.gz
- Upload date:
- Size: 84.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a70f6e3562e923ae57f2d55dea14a49d0c4d0cb304803999ab897dd78882ea9c |
|
MD5 | df556db96318639ee3531147744799fd |
|
BLAKE2b-256 | e4b9f546456220413995ad358f4fda665afff07a000bb1a22157b2caede65ccd |
Provenance
File details
Details for the file midea_local-6.0.2-py3-none-any.whl
.
File metadata
- Download URL: midea_local-6.0.2-py3-none-any.whl
- Upload date:
- Size: 143.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04ad42ce7f42b64459b925607493e5713c3a7a98a36f646635aad05de6d64109 |
|
MD5 | 3b159674395f4b2500c7fa1321355b25 |
|
BLAKE2b-256 | 86d772fb99d9762a3afd40c0c449ca3ebd9189f0373b4b4eabb846df45af4753 |