diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4b06265..78c0368 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,7 +28,6 @@ jobs: run: | docker buildx build --no-cache --push \ --tag lolouk44/xiaomi-mi-scale:${{ github.event.release.tag_name }} \ - --tag lolouk44/xiaomi-mi-scale:latest \ --platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8 . - name: Image digest diff --git a/CHANGELOG.md b/CHANGELOG.md index abca157..ad884c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,3 @@ -## [0.1.14] - 2020-11-26 -### Changed -- Reduced docker image size - -## [0.1.13] - 2020-11-26 -### Changed -- Fixed MQTT Discovery Message - ## [0.1.12] - 2020-11-23 ### Changed - Updated workflow to automatically build docker images on new releases with version and latest tags diff --git a/Dockerfile b/Dockerfile index 9e137cb..3c615a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,6 @@ WORKDIR /opt/miscale COPY src /opt/miscale RUN apt-get update && apt-get install --no-install-recommends -y \ - build-essential \ bluez \ python-pip \ libglib2.0-dev && \ diff --git a/src/Xiaomi_Scale.py b/src/Xiaomi_Scale.py index 58cf233..398e512 100644 --- a/src/Xiaomi_Scale.py +++ b/src/Xiaomi_Scale.py @@ -193,7 +193,7 @@ OLD_MEASURE = '' def discovery(): for MQTTUser in (USER1_NAME,USER2_NAME,USER3_NAME): 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"}' publish.single( MQTT_DISCOVERY_PREFIX + '/sensor/' + MQTT_PREFIX + '/' + MQTTUser + '/config', diff --git a/src/wrapper.sh b/src/wrapper.sh index c8f556d..a0d2002 100644 --- a/src/wrapper.sh +++ b/src/wrapper.sh @@ -2,15 +2,7 @@ sleep 60 # Give the system time after a reboot to connect to WiFi before continuing export MISCALE_MAC=00:00:00:00:00:00 # Mac address of your scale -export HCI_DEV=hci0 # Bluetooth hci device to use -export MQTT_HOST=127.0.0.1 # MQTT Server (defaults to 127.0.0.1) -export MQTT_PREFIX=miscale # MQTT Topic Prefix. Defaults to miscale -export MQTT_USERNAME= # Username for MQTT server (comment out if not required) -export MQTT_PASSWORD= # Password for MQTT (comment out if not required) -export MQTT_PORT=1883 # Defaults to 1883 -export TIME_INTERVAL=30 # Time in sec between each query to the scale, to allow other applications to use the Bluetooth module. Defaults to 30 -export MQTT_DISCOVERY=true # Home Assistant Discovery (true/false), defaults to true -export MQTT_DISCOVERY_PREFIX= # Home Assistant Discovery Prefix, defaults to homeassistant +export MQTT_PREFIX=miScale export USER1_GT=70 # If the weight is greater than this number, we'll assume that we're weighing User #1 export USER1_SEX=male