When controlling some devices, complete parameters need to be passed in - #40
When controlling some devices, complete parameters need to be passed in#40yang605256182 wants to merge 1 commit into
Conversation
yang605256182
commented
Jul 11, 2026
- add support for new device 5706671E、57066708;
- Corrected the fan mode for special equipment 5706671E
There was a problem hiding this comment.
规范问题:
1、不要修改default默认配置内容;
2、已经存在翻译的属性,不需要translation_key;
3、注释应尽量使用英文,便于阅读;
4、sn8设备配置应放在最后面。
代码问题:
问题1: async_set_fan_mode else分支逻辑错误: 特殊浴霸需要三参数,但else分支只发送单参数(风速),会导致设备控制失败
问题2: None值处理不完整:位置: climate.py:558-559
问题3: 硬编码默认值(30, 90)建议从配置读取
问题4: 重复代码建议抽取为辅助方法
另外,由于climate是温控器实体,而"5706671E"的两个模式都是与吹风有关,建议使用fan实体,这样也不用把climate改的这么复杂了。
|
climate核心修改合进去了:aa1b178 至于两个特定sn8的配置,需要自己修改重新提交,此外新属性需要同步增加翻译和图标。 |
|
已经重新提交,有需要修改的麻烦通知我一下 |
请上传凉霸设备的所有属性数据,在「设备状态」-「详情」里面,将所有属性复制粘贴出来 |
|
所有属性数据: |
| "entities": { | ||
| Platform.CLIMATE: { | ||
| "bath_heater": { | ||
| "translation_key": "cooling_fan", |
There was a problem hiding this comment.
直接使用cooling_fan,取消translation_key
| }, | ||
| "fan_mode": { | ||
| "state": { | ||
| "20": "Silent", |
| "smelly_level": { | ||
| "state": "smelly_level", | ||
| "state_class": SensorStateClass.MEASUREMENT, | ||
| "translation_key": "smelly_level" |
| "state_class": SensorStateClass.MEASUREMENT, | ||
| "translation_key": "smelly_level" | ||
| }, | ||
| "smelly_threshold": { |
| "translation_key": "smelly_threshold" | ||
| } | ||
| }, | ||
| Platform.SWITCH: { |
| Platform.SWITCH: { | ||
| "smelly_enable": { | ||
| "device_class": SwitchDeviceClass.SWITCH, | ||
| "power": "smelly_enable" |
| "state_class": SensorStateClass.MEASUREMENT, | ||
| "translation_key": "cur_temperature" | ||
| }, | ||
| "smelly_level": { |
| "smelly_trigger": { | ||
| "device_class": BinarySensorDeviceClass.PROBLEM, | ||
| "translation_key": "smelly_trigger", | ||
| "state": "smelly_trigger" |
| "fan_mode": { | ||
| "state": { | ||
| "30": "Soft wind", | ||
| "100": "Strong" |
| } | ||
| } | ||
| } | ||
| } |
|
十分感谢指正问题。新属性的图标如果获取?
…---Original---
From: "Yang ***@***.***>
Date: Sun, Jul 12, 2026 09:03 AM
To: ***@***.***>;
Cc: ***@***.******@***.***>;
Subject: Re: [Cyborg2017/midea_smart_home] When controlling some devices, complete parameters need to be passed in (PR #40)
@Cyborg2017 commented on this pull request.
In custom_components/midea_smart_home/translations/zh-Hans.json:
> @@ -2659,4 +2699,4 @@ } } } -} +}
需要按照上述修改,另外新属性缺失图标,需要补充。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
在custom_components/midea_smart_home/icons.json定义一个合适得图标,可以让ai协助填充,然后在ha里面验证。 |
|
已经按照建议进行了修改,推了新的分支 |
|
还是有一些没修改好,我调整了一下,看看更新后有无问题:711b78c |
|
好的。十分感谢~ |
测试没问题的话,可以关闭这个PR |
|
经过测试,存在两个问题,一个原有问题,一个新问题。 |
可以尝试在现有的基础上改进一下:711b78c |
突然想起一个问题,你这个测试,是操作浴霸线控器看ha吗? |
65b37b1 to
36554e0
Compare
|
长时间未回复,PR关闭 |