mirror of
https://github.com/mtan93/homeassistant-addons.git
synced 2026-03-08 05:21:51 +00:00
Optimize image
This commit is contained in:
@@ -14,7 +14,4 @@ RUN mkdir /app && tar xvfz /src.tar.gz -C /app --strip-components=1
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN poetry update && poetry install --no-dev
|
RUN poetry update && poetry install --no-dev
|
||||||
|
|
||||||
COPY run.sh /
|
ADD rootfs /
|
||||||
RUN chmod a+x /run.sh
|
|
||||||
ENV DYNACONF_DATA_DIR=/data
|
|
||||||
CMD [ "/run.sh" ]
|
|
||||||
@@ -19,7 +19,8 @@
|
|||||||
Based on https://github.com/MaxWinterstein/toogoodtogo-ha-mqtt-bridge
|
Based on https://github.com/MaxWinterstein/toogoodtogo-ha-mqtt-bridge
|
||||||
|
|
||||||
Since Too Good To Go changed to the new password-less login, you will get a email after startup.
|
Since Too Good To Go changed to the new password-less login, you will get a email after startup.
|
||||||
Just open the mail and hit `Login`.
|
Just open the mail and hit `Login`.
|
||||||
|
⚠️ It is not possible to approve the login on a smartphone were the TGTG app is installed.
|
||||||
|
|
||||||
[aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg
|
[aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg
|
||||||
[amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg
|
[amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "TooGoodToGo Home Assistant MQTT Bridge",
|
|
||||||
"version": "1.9.2",
|
|
||||||
"image": "maxwinterstein/homeassistant-addon-toogoodtogo-ha-mqtt-bridge-{arch}",
|
|
||||||
"slug": "tgtg-ha-mqtt-bridge",
|
|
||||||
"description": "Publish TooGoodToGo stock as MQTT messages",
|
|
||||||
"arch": ["armhf", "armv7", "aarch64", "amd64", "i386"],
|
|
||||||
"startup": "application",
|
|
||||||
"boot": "auto",
|
|
||||||
"options": {
|
|
||||||
"mqtt": {
|
|
||||||
"host": "homeassistant",
|
|
||||||
"port": 1883,
|
|
||||||
"username": "mqtt",
|
|
||||||
"password": "mqtt"
|
|
||||||
},
|
|
||||||
"tgtg": {
|
|
||||||
"email": "me@example.com",
|
|
||||||
"every_n_minutes": 5
|
|
||||||
},
|
|
||||||
"timezone": "Europe/Berlin",
|
|
||||||
"locale": "en_us",
|
|
||||||
"cleanup": true
|
|
||||||
},
|
|
||||||
"schema": {
|
|
||||||
"mqtt": {
|
|
||||||
"host": "str",
|
|
||||||
"port": "int",
|
|
||||||
"username": "str?",
|
|
||||||
"password": "str?"
|
|
||||||
},
|
|
||||||
"tgtg": {
|
|
||||||
"email": "str",
|
|
||||||
"every_n_minutes": "float(0.1,)"
|
|
||||||
},
|
|
||||||
"timezone": "str?",
|
|
||||||
"locale": "str?",
|
|
||||||
"cleanup": "bool"
|
|
||||||
},
|
|
||||||
"stage": "experimental",
|
|
||||||
"url": "https://github.com/MaxWinterstein/toogoodtogo-ha-mqtt-bridge",
|
|
||||||
"hassio_role": "default",
|
|
||||||
"hassio_api": true,
|
|
||||||
"environment": {
|
|
||||||
"DYNACONF_DATA_DIR": "/data/"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
44
toogoodtogo-ha-mqtt-bridge/config.yaml
Normal file
44
toogoodtogo-ha-mqtt-bridge/config.yaml
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
---
|
||||||
|
name: TooGoodToGo Home Assistant MQTT Bridge
|
||||||
|
version: 1.9.2-2
|
||||||
|
image: maxwinterstein/homeassistant-addon-toogoodtogo-ha-mqtt-bridge-{arch}
|
||||||
|
slug: tgtg-ha-mqtt-bridge
|
||||||
|
description: Publish TooGoodToGo stock as MQTT messages
|
||||||
|
arch:
|
||||||
|
- armhf
|
||||||
|
- armv7
|
||||||
|
- aarch64
|
||||||
|
- amd64
|
||||||
|
- i386
|
||||||
|
startup: application
|
||||||
|
boot: auto
|
||||||
|
options:
|
||||||
|
mqtt:
|
||||||
|
host: homeassistant
|
||||||
|
port: 1883
|
||||||
|
username: mqtt
|
||||||
|
password: mqtt
|
||||||
|
tgtg:
|
||||||
|
email: me@example.com
|
||||||
|
every_n_minutes: 5
|
||||||
|
timezone: Europe/Berlin
|
||||||
|
locale: en_us
|
||||||
|
cleanup: true
|
||||||
|
schema:
|
||||||
|
mqtt:
|
||||||
|
host: str
|
||||||
|
port: int
|
||||||
|
username: str?
|
||||||
|
password: str?
|
||||||
|
tgtg:
|
||||||
|
email: str
|
||||||
|
every_n_minutes: float(0.1,)
|
||||||
|
timezone: str?
|
||||||
|
locale: str?
|
||||||
|
cleanup: bool
|
||||||
|
stage: experimental
|
||||||
|
url: https://github.com/MaxWinterstein/toogoodtogo-ha-mqtt-bridge
|
||||||
|
hassio_role: default
|
||||||
|
hassio_api: true
|
||||||
|
environment:
|
||||||
|
DYNACONF_DATA_DIR: "/data/"
|
||||||
@@ -1 +0,0 @@
|
|||||||
../helper-builder.sh
|
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/with-contenv bashio
|
||||||
|
|
||||||
|
bashio::log.info "Copy setings file"
|
||||||
|
cp /data/options.json /app/toogoodtogo_ha_mqtt_bridge/settings.local.json
|
||||||
|
|
||||||
|
if ! bashio::fs.file_exists /data/tokens.json; then
|
||||||
|
bashio::log.magenta "No saved tokens found. "
|
||||||
|
bashio::log.magenta "Please make sure to check your email for the login request and answer quickly."
|
||||||
|
bashio::log.magenta "You can't open it on a mobile phone where the TGTG app itself is installed."
|
||||||
|
else
|
||||||
|
bashio::log.cyan "Saved tokens found."
|
||||||
|
bashio::log.cyan "If you encoure problems reinstalling the add-on might help."
|
||||||
|
fi
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/execlineb -S0
|
||||||
|
if { s6-test ${1} -ne 0 }
|
||||||
|
if { s6-test ${1} -ne 256 }
|
||||||
|
|
||||||
|
s6-svscanctl -t /var/run/s6/services
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/with-contenv bashio
|
||||||
|
|
||||||
|
bashio::log.info "Strating Bridge..."
|
||||||
|
exec python /app/toogoodtogo_ha_mqtt_bridge/main.py
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#!/usr/bin/env bashio
|
|
||||||
|
|
||||||
bashio::log.info "Copy setings file"
|
|
||||||
cp /data/options.json /app/toogoodtogo_ha_mqtt_bridge/settings.local.json
|
|
||||||
|
|
||||||
bashio::log.info "Strating Bridge"
|
|
||||||
python toogoodtogo_ha_mqtt_bridge/main.py
|
|
||||||
Reference in New Issue
Block a user