Merge branch 'XiaoMi:main' into patch-1

This commit is contained in:
Rofl 2024-12-18 17:01:15 +00:00 committed by GitHub
commit 2fb030c52d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 14 additions and 7 deletions

View File

@ -323,7 +323,7 @@ Device information service (urn:miot-spec-v2:service:device-information:00007801
## Multiple Language Support
There are 8 languages available for selection in the config flow language option of Xiaomi Home, including Simplified Chinese, Traditional Chinese, English, Spanish, Russian, French, German, and Japanese. The config flow page in Simplified Chinese and English has been manually reviewed by the developer. Other languages are translated by machine translation. If you want to modify the words and sentences in the config flow page, you need to modify the json file of the certain language in `custom_components/xiaomi_home/translations/` directory.
There are 8 languages available for selection in the config flow language option of Xiaomi Home, including Simplified Chinese, Traditional Chinese, English, Spanish, Russian, French, German, and Japanese. The config flow page in Simplified Chinese and English has been manually reviewed by the developer. Other languages are translated by machine translation. If you want to modify the words and sentences in the config flow page, you need to modify the json file of the certain language in `custom_components/xiaomi_home/translations/` and `custom_components/xiaomi_home/miot/i18n/` directory.
When displaying Home Assistant entity name, Xiaomi Home downloads the multiple language file configured by the device vendor from MIoT Cloud, which contains translations for MIoT-Spec-V2 instances of the device. `multi_lang.json` is a locally maintained multiple language dictionary, which has a higher priority than the multiple language file obtained from the cloud and can be used to supplement or modify the multiple language translation of devices.

View File

@ -110,11 +110,13 @@ INTEGRATION_LANGUAGES = {
'zh-Hans': '简体中文',
'zh-Hant': '繁體中文',
'en': 'English',
'es': 'Español',
'ru': 'Русский',
'fr': 'Français',
'de': 'Deutsch',
'ja': '日本語'
'es': 'Español',
'fr': 'Français',
'ja': '日本語',
'pt': 'Português',
'pt-BR': 'Português (Brasil)',
'ru': 'Русский',
}
DEFAULT_CTRL_MODE: str = 'auto'

View File

@ -325,7 +325,7 @@ event instance name 下的值表示转换后实体所用的 `_attr_device_class`
## 多语言支持
米家集成配置选项中可选择的集成使用的语言有简体中文、繁体中文、英文、西班牙语、俄语、法语、德语、日语这八种语言。目前,米家集成配置页面的简体中文和英文已经过人工校审,其他语言由机器翻译。如果您希望修改配置页面的词句,则需要修改 `custom_components/xiaomi_home/translations/` 目录下相应语言的 json 文件。
米家集成配置选项中可选择的集成使用的语言有简体中文、繁体中文、英文、西班牙语、俄语、法语、德语、日语这八种语言。目前,米家集成配置页面的简体中文和英文已经过人工校审,其他语言由机器翻译。如果您希望修改配置页面的词句,则需要修改 `custom_components/xiaomi_home/translations/` 以及 `custom_components/xiaomi_home/miot/i18n/` 目录下相应语言的 json 文件。
在显示 Home Assistant 实体名称时,米家集成会从小米云下载设备厂商为设备配置的多语言文件,该文件包含设备 MIoT-Spec-V2 实例的多语言翻译。 `multi_lang.json` 是本地维护的多语言配置字典,其优先级高于从云端获取的多语言文件,可用于补充或修改设备的多语言翻译。

View File

@ -20,8 +20,13 @@ rm -rf "$config_path/custom_components/xiaomi_home"
script_path=$(dirname "$0")
# Change to the script path.
cd "$script_path"
# Copy the new version.
cp -r custom_components/xiaomi_home/ "$config_path/custom_components/"
if [ -d "$config_path/custom_components" ]; then
cp -r custom_components/xiaomi_home/ "$config_path/custom_components/"
else
cp -r custom_components/ "$config_path/custom_components/"
fi
# Done.
echo "Xiaomi Home installation is completed. Please restart Home Assistant."