From 3a330324f433d0c0fc4bc1e2f5d6ea238830c544 Mon Sep 17 00:00:00 2001 From: 5high <5high.net@gmail.com> Date: Sun, 10 Jan 2021 17:34:29 +0800 Subject: [PATCH] Update Xiaomi_Scale.py --- mi-scale/src/Xiaomi_Scale.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mi-scale/src/Xiaomi_Scale.py b/mi-scale/src/Xiaomi_Scale.py index aab55a6..6bbbe44 100644 --- a/mi-scale/src/Xiaomi_Scale.py +++ b/mi-scale/src/Xiaomi_Scale.py @@ -192,9 +192,9 @@ OLD_MEASURE = '' def discovery(): for MQTTUser in (USER1_NAME,USER2_NAME,USER3_NAME): - message = '{"name": "' + MQTTUser + ' 重量",' - message+= '"state_topic": "' + MQTT_PREFIX + '/' + MQTTUser + '/重量","value_template": "{{ value_json.weight }}",' - message+= '"json_attributes_topic": "' + MQTT_PREFIX + '/' + MQTTUser + '/重量","icon": "mdi:scale-bathroom"}' + message = '{"name": "' + MQTTUser + ' Weight",' + message+= '"state_topic": "' + MQTT_PREFIX + '/' + MQTTUser + '/weight","value_template": "{{ value_json.重量 }}",' + message+= '"json_attributes_topic": "' + MQTT_PREFIX + '/' + MQTTUser + '/weight","icon": "mdi:scale-bathroom"}' publish.single( MQTT_DISCOVERY_PREFIX + '/sensor/' + MQTT_PREFIX + '/' + MQTTUser + '/config', message,