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

Fix qmi.plug.psv3 energy and NameError bugs; translations update #1464

Merged
merged 3 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions custom_components/xiaomi_miot/core/device_customizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,39 @@
'cloud_delay_update': 8,
'miot_type': 'urn:miot-spec-v2:device:air-conditioner:0000A004:qdhkl-b23:2',
},
'qmi.plug.psv3': {
'main_miot_services': 'switch-2',
'sensor_attributes': 'power_cost_today,power_cost_month',
'sensor_properties': 'switch.temperature',
'stat_power_cost_key': '3.1',
'exclude_miot_services': 'simulation',
},
'qmi.plug.psv3:electric_current': {
'value_ratio': 0.001,
'unit_of_measurement': 'A',
},
'qmi.plug.psv3:voltage': {
'value_ratio': 0.001,
'unit_of_measurement': 'V',
},
'qmi.plug.psv3:power_consumption': {
'value_ratio': 1,
'state_class': 'total_increasing',
'device_class': 'energy',
'unit_of_measurement': 'kWh',
},
'qmi.plug.psv3:power_cost_today': {
'value_ratio': 1,
'state_class': 'total_increasing',
'device_class': 'energy',
'unit_of_measurement': 'kWh',
},
'qmi.plug.psv3:power_cost_month': {
'value_ratio': 1,
'state_class': 'total_increasing',
'device_class': 'energy',
'unit_of_measurement': 'kWh',
},
'qmi.plug.tw02': {
'main_miot_services': 'switch-2',
'sensor_attributes': 'power_cost_today,power_cost_month',
Expand All @@ -970,9 +1003,9 @@
},
'qmi.plug.tw02:power_consumption': {
'value_ratio': 1,
'state_class': "total_increasing",
'device_class': "energy",
'unit_of_measurement': "kWh",
'state_class': 'total_increasing',
'device_class': 'energy',
'unit_of_measurement': 'kWh',
},
'qmi.plug.tw02:power_cost_today': {
'value_ratio': 1,
Expand Down
9 changes: 9 additions & 0 deletions custom_components/xiaomi_miot/core/translation_languages.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
},

'environment': {
'environment air quality': '空气质量',
'environment temperature': '温度',
'environment relative humidity': '湿度',
'environment pm2.5 density': 'PM2.5 浓度',
Expand All @@ -109,6 +110,12 @@
'circular wind': '循环风',
},

'filter': {
'filter left time': '滤芯剩余时间',
'filter used time': '滤芯已用时间',
'filter life level': '滤芯剩余寿命',
},

'intelligent_speaker': {
'wake up': '唤醒',
'play music': '播放音乐',
Expand Down Expand Up @@ -181,6 +188,7 @@

'magnet_sensor': {
'magnet sensor': '门窗传感器',
'magnet sensor illumination': '光照度',
},

'motion_sensor': {
Expand Down Expand Up @@ -210,6 +218,7 @@
'power consumption electric power': '功率',
'power consumption electric current': '电流',
'power consumption electric voltage': '电压',
'power consumption voltage': '电压',
},

'ptc_bath_heater': {
Expand Down