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-1.1.1.tar.gz
(70.4 kB
view hashes)
Built Distribution
midea_local-1.1.1-py3-none-any.whl
(125.1 kB
view hashes)
Close
Hashes for midea_local-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e7db98acd7ce0e06b2d60ab14904bc51d43f0d4b103881cdeeba03134f43efe |
|
MD5 | 3ff17fb51fef46160458e3f0c1c715d8 |
|
BLAKE2b-256 | 25ec6140fcff92be8cafbd1165fb9f6a64600b43b02d75c43e445eb3191079ea |