Update Xiaomi_Scale.py
This commit is contained in:
parent
5d44c7f915
commit
3a330324f4
@ -192,9 +192,9 @@ OLD_MEASURE = ''
|
|||||||
|
|
||||||
def discovery():
|
def discovery():
|
||||||
for MQTTUser in (USER1_NAME,USER2_NAME,USER3_NAME):
|
for MQTTUser in (USER1_NAME,USER2_NAME,USER3_NAME):
|
||||||
message = '{"name": "' + MQTTUser + ' 重量",'
|
message = '{"name": "' + MQTTUser + ' Weight",'
|
||||||
message+= '"state_topic": "' + MQTT_PREFIX + '/' + MQTTUser + '/重量","value_template": "{{ value_json.weight }}",'
|
message+= '"state_topic": "' + MQTT_PREFIX + '/' + MQTTUser + '/weight","value_template": "{{ value_json.重量 }}",'
|
||||||
message+= '"json_attributes_topic": "' + MQTT_PREFIX + '/' + MQTTUser + '/重量","icon": "mdi:scale-bathroom"}'
|
message+= '"json_attributes_topic": "' + MQTT_PREFIX + '/' + MQTTUser + '/weight","icon": "mdi:scale-bathroom"}'
|
||||||
publish.single(
|
publish.single(
|
||||||
MQTT_DISCOVERY_PREFIX + '/sensor/' + MQTT_PREFIX + '/' + MQTTUser + '/config',
|
MQTT_DISCOVERY_PREFIX + '/sensor/' + MQTT_PREFIX + '/' + MQTTUser + '/config',
|
||||||
message,
|
message,
|
||||||
|
Loading…
Reference in New Issue
Block a user