Cliente Python para lava-louças Midea (device_type 0xE1, plugin v5) — codec do frame AA + transporte LAN V3.
Project description
midea-dishwasher-api
Cliente Python para lava-louças Midea (device_type 0xE1, plugin v5).
Implementa o protocolo de aplicação AA … E1 e a camada de transporte LAN V3
(handshake 8370 + AES-128-CBC + SHA-256, com framing V2 5A5A interno).
Instalação
pip install midea-dishwasher-api
Uso rápido
from midea_dishwasher_api import BrightLevel, Client, Mode, V3Transport
with V3Transport(
host="192.168.5.100",
device_id=151732606394621,
token=bytes.fromhex("..."), # 64 bytes
key=bytes.fromhex("..."), # 32 bytes
) as transport:
client = Client(send=transport)
status = client.query_status()
print(status.machine_state) # MachineState.POWER_ON / POWER_OFF
print(status.cycle_state) # CycleState.IDLE / WORK / ORDER / ...
print(status.left_time) # minutos restantes (apenas em WORK)
print(status.door_closed)
print(status.bright_lack) # secante acabou?
client.power_on()
client.start_to_work(mode=Mode.ECO, extra_drying=True)
client.set_bright(BrightLevel.L3)
client.cancel_work()
client.power_off()
Os métodos de controle não retornam estado (a máquina demora alguns segundos
para refletir a mudança). Chame query_status() quando quiser estado fresco.
API
Client
| Método | Efeito |
|---|---|
query_status() -> DishwasherStatus |
Lê o estado atual |
power_on() |
Liga a máquina |
power_off() |
Desliga |
cancel_work() |
Cancela ciclo / volta ao idle |
start_to_work(mode, extra_drying=False) |
Inicia ciclo |
set_bright(level: BrightLevel) |
Ajusta o nível do abrilhantador (1–5) |
DishwasherStatus
Campos decodificados da resposta:
machine_state: MachineState | None—POWER_ON/POWER_OFFcycle_state: CycleState | None—idle,order,work,error, ...wash_stage: WashStage | int | None—IDLE,PRE_WASH,MAIN_WASH,RINSE,DRY,FINISHerror_code: ErrorCode | int—NONE,WATER_SUPPLY,HEATING,OVERFLOW,WATER_VALVEleft_time: int | None— minutos restantes (preenchido apenas quandocycle_state == WORK)door_closed: boolbright_lack: bool— secante (rinse aid) acaboubright: BrightLevel | int | None— nível atual do abrilhantador (1–5)
Modos disponíveis (Mode)
AUTO, INTENSIVE, NORMAL, ECO, GLASS, NINETY_MIN, ONE_HOUR,
RAPID, SOAK, THREE_IN_ONE, HYGIENE, QUIET, PARTY, FRUIT.
Transporte customizado
Client aceita qualquer Callable[[bytes], bytes] como send. Útil para
testes com transporte mock, integração com cloud, ou pipeline próprio:
from midea_dishwasher_api.protocol import assemble_frame
def fake_send(frame: bytes) -> bytes:
return assemble_frame(b"...", 0x02)
client = Client(send=fake_send)
O codec low-level (assemble_frame, parse_frame, build_query,
build_control, make_sum) e o decoder de status (decode_response)
ficam em midea_dishwasher_api.protocol e midea_dishwasher_api.state
respectivamente — fora do __init__.py público.
Como obter token e key
São credenciais por dispositivo emitidas pela cloud da Midea. Use ferramentas
existentes (midea-msmart, midea-beautiful-air, midea-discover) para
extrair a partir da sua conta no app.
Licença
MIT — ver LICENSE.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file midea_dishwasher_api-1.1.0.tar.gz.
File metadata
- Download URL: midea_dishwasher_api-1.1.0.tar.gz
- Upload date:
- Size: 14.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
919cc33390de3d50bb65fe2de04dc13ece7ad713ab8259c3e063f40db6055406
|
|
| MD5 |
a901bfd071a1458bc0d57a00ca32796c
|
|
| BLAKE2b-256 |
b68bbc4bc7246da39e66769d97262336544df5fd7a6e71c063da46cdcd79d752
|
Provenance
The following attestation bundles were made for midea_dishwasher_api-1.1.0.tar.gz:
Publisher:
release.yml on roquerodrigo/midea-dishwasher-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
midea_dishwasher_api-1.1.0.tar.gz -
Subject digest:
919cc33390de3d50bb65fe2de04dc13ece7ad713ab8259c3e063f40db6055406 - Sigstore transparency entry: 1486279076
- Sigstore integration time:
-
Permalink:
roquerodrigo/midea-dishwasher-api@b6d0359b270cd4144f86ede38f8bf7cb3a660bf5 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/roquerodrigo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b6d0359b270cd4144f86ede38f8bf7cb3a660bf5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file midea_dishwasher_api-1.1.0-py3-none-any.whl.
File metadata
- Download URL: midea_dishwasher_api-1.1.0-py3-none-any.whl
- Upload date:
- Size: 20.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83e59948c16573b8807c3257329010fdc30f3ce0351fcd43135f13d54ba600a5
|
|
| MD5 |
56c27ef3708e26ea07bd911c662d3992
|
|
| BLAKE2b-256 |
e4e12dbcd5ede03a099ca8ed602411492558a82b70f4daedc07605b70f406a36
|
Provenance
The following attestation bundles were made for midea_dishwasher_api-1.1.0-py3-none-any.whl:
Publisher:
release.yml on roquerodrigo/midea-dishwasher-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
midea_dishwasher_api-1.1.0-py3-none-any.whl -
Subject digest:
83e59948c16573b8807c3257329010fdc30f3ce0351fcd43135f13d54ba600a5 - Sigstore transparency entry: 1486279109
- Sigstore integration time:
-
Permalink:
roquerodrigo/midea-dishwasher-api@b6d0359b270cd4144f86ede38f8bf7cb3a660bf5 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/roquerodrigo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b6d0359b270cd4144f86ede38f8bf7cb3a660bf5 -
Trigger Event:
push
-
Statement type: