This commit is contained in:
lolouk44 2020-11-26 09:34:38 +00:00
parent 8aec9d6c75
commit 840c2244bd
4 changed files with 9 additions and 5 deletions

View File

@ -1,3 +1,7 @@
## [0.1.15] - 2020-11-26
### Changed
- Fixed MQTT Discovery Message
## [0.1.14] - 2020-11-24 ## [0.1.14] - 2020-11-24
### Changed ### Changed
- 2nd attempt to fix executable files (fixes https://github.com/lolouk44/hassio-addons/issues/23) - 2nd attempt to fix executable files (fixes https://github.com/lolouk44/hassio-addons/issues/23)

View File

@ -1,9 +1,9 @@
FROM python:3.8-slim FROM python:3.8-slim
LABEL io.hass.version="0.1.14" io.hass.type="addon" io.hass.arch="armhf|aarch64|i386|amd64" LABEL io.hass.version="0.1.15" 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
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install no-install-recommends -y \
bluez \ bluez \
python-pip \ python-pip \
libglib2.0-dev && \ libglib2.0-dev && \

View File

@ -1,6 +1,6 @@
{ {
"name": "Xiaomi Mi Scale", "name": "Xiaomi Mi Scale",
"version": "0.1.14", "version": "0.1.15",
"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,8 +193,8 @@ 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": "miscale/' + 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',
message, message,