This commit is contained in:
lolouk44 2020-11-26 11:42:31 +00:00
parent f303708992
commit c386f97371
2 changed files with 2 additions and 2 deletions

View file

@ -3,7 +3,7 @@ FROM python:3.8-slim
WORKDIR /opt/miscale WORKDIR /opt/miscale
COPY src /opt/miscale COPY src /opt/miscale
RUN apt-get update && apt-get install --no-install-recommends -y \ RUN apt-get update && apt-get install -y \
bluez \ bluez \
python-pip \ python-pip \
libglib2.0-dev && \ libglib2.0-dev && \

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',