Skip to content

feat: add Lua cloud control API for Midea devices#10

Open
knightast wants to merge 4 commits into
hasscc:mainfrom
knightast:main
Open

feat: add Lua cloud control API for Midea devices#10
knightast wants to merge 4 commits into
hasscc:mainfrom
knightast:main

Conversation

@knightast

Copy link
Copy Markdown

The transparent send API (/v1/appliance/transparent/send) returns 1006
"order value is illegal" for all encoding formats on consumer accounts.
This PR adds Lua-based cloud control as the primary method, falling back
to transparent send when Lua is unavailable.

It works today.

knightast and others added 4 commits April 28, 2026 19:51
The transparent send API (/v1/appliance/transparent/send) returns 1006
"order value is illegal" for all encoding formats on consumer accounts.
This PR adds Lua-based cloud control as the primary method, falling back
to transparent send when Lua is unavailable.

Changes:
- cloud.py: add lua_control() and lua_status() methods to MeijuCloud
- __init__.py: add async_lua_control/async_lua_status wrappers,
  modify async_control() to try Lua API first, add
  _update_status_from_lua() for AC status conversion
- switch.py: pass on_lua/off_lua commands from YAML config
- select.py: pass lua field from select options
- number.py: pass lua_key mapping for number entities
- device_customizes.yaml: add Lua command mappings for AC devices
  (power, mode, fan_speed, swing_mode, temperature)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: add Lua cloud control API for Midea devices
… control

- Add Thing Model API (/v1/thing/properties/entire) for device status queries
  (supports 净水机/软水机/洗碗机/空调 with thing_model_property in YAML)
- Add Lua Control API (/mjl/v1/device/lua/control) for AC cloud control
  (power on/off, mode, temperature, fan speed, swing via lua commands)
- Support thing_model_property as list for fallback across device variants
- Add Lua command mappings in YAML (on_lua, off_lua, lua, lua_key)
- Fix HA template syntax: use bitwise_and filter + integer division instead
  of Python >> and & operators
- Map Thing Model property names (centralAirConditioner.*, waterPurifier.*,
  dishwasher.*) to entity configurations
- Clean up excessive warning-level logs to info/debug
- Remove duplicate entity registry entries

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Enhance _update_status_from_lua to support Thing Model API format
  (workMode integer, targetTemperature, windSpeed, currentTemperature, etc.)
- Add THING_MODEL_WORK_MODE_TO_BYTE and WIND_GEAR_MAP class attributes
- Fix temperature parsing to handle float values
- Improve swing mode handling for Thing Model format
- Fix select entity to handle dict-style options
- Add config_flow.py for UI-based account configuration
- Add strings.json for internationalization

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant