Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add airx h8 humidifier #2710

Merged
merged 8 commits into from
Jan 11, 2025
Merged

Conversation

City-Zero
Copy link
Contributor

Hello,

This is my first time submitting a PR. Currently, the device I'm using, the "airx Pure Humidifier H8Pro," is not fully compatible. Therefore, I have added a new device configuration file. Based on my tests, all the data points (dp) are working very well. For the specific dp definitions, I have tried to use the standard definition types as much as possible. For the ones that didn't have predefined types, I created custom state values and selected appropriate icons. If there are any issues, please feel free to point them out. Thank you.

Best regards,
李余通
iShot_2024-12-30_10 17 06

@make-all
Copy link
Owner

make-all commented Jan 1, 2025

The use of Chinese throughout this PR makes it difficult for me to review

@City-Zero
Copy link
Contributor Author

The use of Chinese throughout this PR makes it difficult for me to review

This is a product that is manufactured and sold in China. From this perspective, most users come from China and use Chinese. Therefore, I have used Chinese for the device name and some non-universal DP (data points). How should I modify the file for your review? Should I add English comments in the YAML file where there is Chinese, or should I improve the translation file by adding these non-universal functions to the translation file?

@City-Zero
Copy link
Contributor Author

City-Zero commented Jan 2, 2025

{
    "modelId": "emwg7g",
    "services": [
        {
            "actions": [],
            "code": "",
            "description": "",
            "events": [],
            "name": "默认服务",
            "properties": [
                {
                    "abilityId": 1,
                    "accessMode": "rw",
                    "code": "switch",
                    "description": "",
                    "extensions": {
                        "iconName": "icon-dp_power",
                        "attribute": "129"
                    },
                    "name": "总开关",
                    "typeSpec": {
                        "type": "bool"
                    }
                },
                {
                    "abilityId": 2,
                    "accessMode": "rw",
                    "code": "switch_spray",
                    "description": "",
                    "extensions": {
                        "iconName": "icon-power",
                        "attribute": "1024"
                    },
                    "name": "滤芯风干",
                    "typeSpec": {
                        "type": "bool"
                    }
                },
                {
                    "abilityId": 5,
                    "accessMode": "rw",
                    "code": "switch_led",
                    "description": "",
                    "extensions": {
                        "iconName": "icon-dp_light",
                        "attribute": "128"
                    },
                    "name": "灯光",
                    "typeSpec": {
                        "type": "bool"
                    }
                },
                {
                    "abilityId": 8,
                    "accessMode": "rw",
                    "code": "sound",
                    "description": "",
                    "extensions": {
                        "iconName": "icon-dp_voice",
                        "attribute": "128"
                    },
                    "name": "声音",
                    "typeSpec": {
                        "type": "bool"
                    }
                },
                {
                    "abilityId": 13,
                    "accessMode": "rw",
                    "code": "humidity_set",
                    "description": "",
                    "extensions": {
                        "iconName": "icon-a_mode_dry",
                        "attribute": "128"
                    },
                    "name": "湿度设置",
                    "typeSpec": {
                        "type": "value",
                        "max": 80,
                        "min": 30,
                        "scale": 0,
                        "step": 5,
                        "unit": "%RH"
                    }
                },
                {
                    "abilityId": 14,
                    "accessMode": "ro",
                    "code": "humidity_current",
                    "description": "",
                    "extensions": {
                        "iconName": "icon-shidu",
                        "attribute": "128"
                    },
                    "name": "当前湿度",
                    "typeSpec": {
                        "type": "value",
                        "max": 90,
                        "min": 10,
                        "scale": 0,
                        "step": 1,
                        "unit": "%RH"
                    }
                },
                {
                    "abilityId": 21,
                    "accessMode": "rw",
                    "code": "sterilization",
                    "description": "",
                    "extensions": {
                        "iconName": "icon-a_mode_turbo",
                        "attribute": "1152"
                    },
                    "name": "除菌",
                    "typeSpec": {
                        "type": "bool"
                    }
                },
                {
                    "abilityId": 22,
                    "accessMode": "ro",
                    "code": "fault",
                    "description": "",
                    "extensions": {
                        "iconName": "icon-Panic",
                        "scope": "fault",
                        "attribute": "1152"
                    },
                    "name": "机头分离告警",
                    "typeSpec": {
                        "type": "bitmap",
                        "label": [
                            "break_off"
                        ],
                        "maxlen": 1
                    }
                },
                {
                    "abilityId": 24,
                    "accessMode": "rw",
                    "code": "mode",
                    "description": "",
                    "extensions": {
                        "attribute": "128"
                    },
                    "name": "工作模式",
                    "typeSpec": {
                        "type": "enum",
                        "range": [
                            "AUTO",
                            "LOW",
                            "MIDDLE",
                            "HIGH",
                            "SLEEP"
                        ]
                    }
                },
                {
                    "abilityId": 25,
                    "accessMode": "rw",
                    "code": "anion",
                    "description": "",
                    "extensions": {
                        "attribute": "128"
                    },
                    "name": "负离子",
                    "typeSpec": {
                        "type": "bool"
                    }
                },
                {
                    "abilityId": 29,
                    "accessMode": "rw",
                    "code": "child_lock",
                    "description": "",
                    "extensions": {
                        "attribute": "128"
                    },
                    "name": "童锁",
                    "typeSpec": {
                        "type": "bool"
                    }
                },
                {
                    "abilityId": 101,
                    "accessMode": "ro",
                    "code": "water_level",
                    "description": "",
                    "name": "当前水位",
                    "typeSpec": {
                        "type": "enum",
                        "range": [
                            "Low_water",
                            "Middle_water",
                            "High_water",
                            "Full_water",
                            "No_water",
                            "Have_water2"
                        ]
                    }
                },
                {
                    "abilityId": 102,
                    "accessMode": "rw",
                    "code": "uv_light",
                    "description": "",
                    "extensions": {
                        "iconName": "icon-dp_power2",
                        "attribute": "4096"
                    },
                    "name": "UV灯",
                    "typeSpec": {
                        "type": "bool"
                    }
                }
            ]
        }
    ]
}

@make-all
Copy link
Owner

make-all commented Jan 2, 2025

Expanding the translations is always welcome. But where possible try to use what is already there, in HA or tuya-local.

@City-Zero
Copy link
Contributor Author

Expanding the translations is always welcome. But where possible try to use what is already there, in HA or tuya-local.

Translation is quite difficult for me, and I can only use ChatGPT to help me with the translation. However, I cannot guarantee the accuracy of the translation. Is this acceptable?

@make-all
Copy link
Owner

make-all commented Jan 2, 2025

Just English and Chinese is OK for a start. From the English, I can take care of the rest using CoPilot (I'm not sure if the translations are any better than ChatGPT but I do know it understands the format of the translation files).

- replace machine_separation_status with the "opening" class.
- rename water_volume to water_level
- rename electrolysis_sterilization to electrolytic_sterilization
- rename middle water level to medium
- change water_level icons to gauge based

- add docs

PR make-all#2710
@make-all make-all merged commit 29def3a into make-all:main Jan 11, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants