feat: add Lua cloud control API for Midea devices#10
Open
knightast wants to merge 4 commits into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.