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-2.0.0.tar.gz
(75.0 kB
view details)
Built Distribution
midea_local-2.0.0-py3-none-any.whl
(130.4 kB
view details)
File details
Details for the file midea_local-2.0.0.tar.gz
.
File metadata
- Download URL: midea_local-2.0.0.tar.gz
- Upload date:
- Size: 75.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6236ec0b681d1e41e45850fd3f0583995b550f2e46582375dcb04ac49b31657d |
|
MD5 | 0eb92e92ad5c264a6ad65a9ffce07929 |
|
BLAKE2b-256 | 04f8d40d5ae24c8a0a433f5faed195382196ad8adacd2dc9a59ce0e3243e698a |
Provenance
File details
Details for the file midea_local-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: midea_local-2.0.0-py3-none-any.whl
- Upload date:
- Size: 130.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d51a4d9087167b449a95f813324611fde2eddb6f6c4a7601ae66543b2ed1b346 |
|
MD5 | df294c1390797e8956956befe9d1fbe0 |
|
BLAKE2b-256 | 3a6c07cacce31d4f591bfb3613c36f800461ca3c86487cada8f0de8890e71d84 |