This commit is contained in:
lolouk44 2020-11-26 10:45:35 +00:00
parent d42b9246ab
commit d84a15bc47
4 changed files with 7 additions and 3 deletions

View File

@ -1,3 +1,7 @@
## [0.1.16] - 2020-11-26
### Changed
- Fixed MQTT Discovery Message
## [0.1.15] - 2020-11-26 ## [0.1.15] - 2020-11-26
### Changed ### Changed
- Fixed MQTT Discovery Message - Fixed MQTT Discovery Message

View File

@ -1,5 +1,5 @@
FROM python:3.8-slim FROM python:3.8-slim
LABEL io.hass.version="0.1.15" io.hass.type="addon" io.hass.arch="armhf|aarch64|i386|amd64" LABEL io.hass.version="0.1.16" io.hass.type="addon" io.hass.arch="armhf|aarch64|i386|amd64"
WORKDIR /opt/miscale WORKDIR /opt/miscale
COPY src /opt/miscale COPY src /opt/miscale

View File

@ -1,6 +1,6 @@
{ {
"name": "Xiaomi Mi Scale", "name": "Xiaomi Mi Scale",
"version": "0.1.15", "version": "0.1.16",
"slug": "xiaomi_mi_scale", "slug": "xiaomi_mi_scale",
"description": "Read weight measurements from Xiamomi scale via BLE", "description": "Read weight measurements from Xiamomi scale via BLE",
"url": "https://github.com/lolouk44/xiaomi_mi_scale_ha_add_on", "url": "https://github.com/lolouk44/xiaomi_mi_scale_ha_add_on",

View File

@ -193,7 +193,7 @@ 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 + ' Weight",' message = '{"name": "' + MQTTUser + ' Weight",'
message+= '"state_topic": "' + MQTT_PREFIX + '/' + MQTTUser + '/weight","value_template": "{{ value_json['weight'] }}",' message+= '"state_topic": "' + MQTT_PREFIX + '/' + MQTTUser + '/weight","value_template": "{{ value_json.weight }}",'
message+= '"json_attributes_topic": "' + MQTT_PREFIX + '/' + MQTTUser + '/weight","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',