mirror of
https://github.com/sususweet/midea-meiju-codec.git
synced 2026-02-11 06:13:49 +00:00
- Add command field support to MideaNumberEntity and MideaSelectEntity
- Command templates allow defining fixed parameters in configuration
- Options/values are merged with command template before sending to device
- Backward compatible - existing configurations continue to work
Examples in device_mapping:
1. For NUMBER platform - brightness control with protocol template:
```yaml
Platform.NUMBER: {
"lightness": {
"min": 10,
"max": 100,
"step": 5,
"command": {
"electronic_control_version": 2,
"type": "b6",
"b6_action": "setting",
"setting": "light",
"lightness": "{value}" # {value} placeholder for actual number value
}
}
}
2.For SELECT platform - gesture selection with protocol template:
```yaml
Platform.SELECT: {
"gesture": {
"options": {
"off": {"gesture": "off"},
"on": {"gesture": "on"}
},
"command": { # Protocol template for gesture control
"electronic_control_version": 2,
"type": "b6",
"b6_action": "setting",
"setting": "gesture"
# {gesture} value from options will be merged automatically
}
}
}