Compare commits
8 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a5ddd5d334 | ||
![]() |
6542a02525 | ||
![]() |
dcaedf1cfd | ||
![]() |
441084f574 | ||
![]() |
589d4ceafc | ||
![]() |
c386f97371 | ||
![]() |
f303708992 | ||
![]() |
9b6519f299 |
9
.github/workflows/main.yml
vendored
9
.github/workflows/main.yml
vendored
|
@ -2,7 +2,7 @@ name: Publish Docker image
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
push_to_registry:
|
push_to_registry:
|
||||||
name: Push Docker image to Docker Hub
|
name: Push Docker image to Docker Hub
|
||||||
|
@ -14,7 +14,7 @@ jobs:
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1
|
uses: docker/setup-qemu-action@v1
|
||||||
|
|
||||||
|
@ -29,4 +29,7 @@ jobs:
|
||||||
docker buildx build --no-cache --push \
|
docker buildx build --no-cache --push \
|
||||||
--tag lolouk44/xiaomi-mi-scale:${{ github.event.release.tag_name }} \
|
--tag lolouk44/xiaomi-mi-scale:${{ github.event.release.tag_name }} \
|
||||||
--tag lolouk44/xiaomi-mi-scale:latest \
|
--tag lolouk44/xiaomi-mi-scale:latest \
|
||||||
--platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8 .
|
--platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8 .
|
||||||
|
|
||||||
|
- name: Image digest
|
||||||
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
## [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
|
## [0.1.12] - 2020-11-23
|
||||||
### Changed
|
### Changed
|
||||||
- Updated workflow to automatically build docker images on new releases with version and latest tags
|
- Updated workflow to automatically build docker images on new releases with version and latest tags
|
||||||
|
|
|
@ -3,7 +3,8 @@ 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 -y \
|
RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||||
|
build-essential \
|
||||||
bluez \
|
bluez \
|
||||||
python-pip \
|
python-pip \
|
||||||
libglib2.0-dev && \
|
libglib2.0-dev && \
|
||||||
|
@ -14,5 +15,6 @@ RUN pip install -r requirements.txt
|
||||||
# Copy in docker scripts to root of container...
|
# Copy in docker scripts to root of container...
|
||||||
COPY dockerscripts/ /
|
COPY dockerscripts/ /
|
||||||
|
|
||||||
|
RUN chmod +x /entrypoint.sh && chmod +x /cmd.sh
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
CMD ["/cmd.sh"]
|
CMD ["/cmd.sh"]
|
|
@ -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,
|
||||||
|
|
|
@ -2,7 +2,15 @@
|
||||||
|
|
||||||
sleep 60 # Give the system time after a reboot to connect to WiFi before continuing
|
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 MISCALE_MAC=00:00:00:00:00:00 # Mac address of your scale
|
||||||
export MQTT_PREFIX=miScale
|
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 USER1_GT=70 # If the weight is greater than this number, we'll assume that we're weighing User #1
|
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
|
export USER1_SEX=male
|
||||||
|
|
Loading…
Reference in a new issue