diff --git a/README.md b/README.md index 9da5799..05bd58f 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,9 @@ Home Assistant Addon repository containing ## Eufy Home Assistant MQTT Bridge ([matijse/eufy-ha-mqtt-bridge](https://github.com/matijse/eufy-ha-mqtt-bridge)) Forwards Eufy Security push notifications to Home Assistant via MQTT. +## TooGoodToGo Home Assistant MQTT Bridge ([maxwinterstein/toogoodtogo-ha-mqtt-bridge](https://github.com/maxwinterstein/toogoodtogo-ha-mqtt-bridge)) +Integrate your TooGoodToGo favourites to Home Assistant via MQTT. + ## ioBroker ([iobroker.net](http://iobroker.net)) Run ioBroker as Add-on. diff --git a/toogoodtogo-ha-mqtt-bridge/CHANGELOG.md b/toogoodtogo-ha-mqtt-bridge/CHANGELOG.md new file mode 100644 index 0000000..9a77b7b --- /dev/null +++ b/toogoodtogo-ha-mqtt-bridge/CHANGELOG.md @@ -0,0 +1,4 @@ +# Changelog + +## [0.1.0] - 2020-12-31 +- Initial release \ No newline at end of file diff --git a/toogoodtogo-ha-mqtt-bridge/Dockerfile b/toogoodtogo-ha-mqtt-bridge/Dockerfile new file mode 100644 index 0000000..bfbd528 --- /dev/null +++ b/toogoodtogo-ha-mqtt-bridge/Dockerfile @@ -0,0 +1,3 @@ +# sneaky trick to get around the requirement of {arch}-variabe based docker repositories + +FROM maxwinterstein/homeassistant-addon-toogoodtogo-ha-mqtt-bridge:latest \ No newline at end of file diff --git a/toogoodtogo-ha-mqtt-bridge/Dockerfile-real b/toogoodtogo-ha-mqtt-bridge/Dockerfile-real new file mode 100644 index 0000000..56e3031 --- /dev/null +++ b/toogoodtogo-ha-mqtt-bridge/Dockerfile-real @@ -0,0 +1,23 @@ +FROM hassioaddons/base-python +ENV LANG C.UTF-8 + +# Add poetry # TODO: Get rid of the overhead +RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - +ENV PATH=$HOME/.poetry/bin/:${PATH} +RUN poetry config virtualenvs.create false + +# Calls for a random number to bust the cache +# (https://stackoverflow.com/questions/35134713/disable-cache-for-specific-run-commands/58801213#58801213) +ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache + +# add source and unpack +ADD "https://github.com/MaxWinterstein/toogoodtogo-ha-mqtt-bridge/tarball/main" /src.tar.gz +RUN mkdir /app && tar xvfz /src.tar.gz -C /app --strip-components=1 + +# install +WORKDIR /app +RUN poetry install --no-dev + +COPY run.sh / +RUN chmod a+x /run.sh +CMD [ "/run.sh" ] diff --git a/toogoodtogo-ha-mqtt-bridge/README.md b/toogoodtogo-ha-mqtt-bridge/README.md new file mode 100644 index 0000000..44ea0a2 --- /dev/null +++ b/toogoodtogo-ha-mqtt-bridge/README.md @@ -0,0 +1,8 @@ +# Home Assistant Add-on: TooGoodToGo Home Assistant MQTT Bridge +## Based on https://github.com/MaxWinterstein/toogoodtogo-ha-mqtt-bridge + +--- +## 🚨 This is some experimental release! 🚨 +--- + +**The underlaying docker image will be build every night until there is some kind of versioning available.** \ No newline at end of file diff --git a/toogoodtogo-ha-mqtt-bridge/config.json b/toogoodtogo-ha-mqtt-bridge/config.json new file mode 100644 index 0000000..069d2a7 --- /dev/null +++ b/toogoodtogo-ha-mqtt-bridge/config.json @@ -0,0 +1,42 @@ +{ + "name": "TooGoodToGo Home Assistant MQTT Bridge", + "version": "0.1.0", + "slug": "tgtg-ha-mqtt-bridge", + "description": "Publish TooGoodToGo stock as MQTT messages", + "arch": [ + "armhf", + "armv7", + "aarch64", + "amd64" + ], + "startup": "application", + "boot": "auto", + "options": { + "mqtt": { + "host": "homeassistant", + "port": 1883, + "username": "mqtt", + "password": "mqtt" + }, + "tgtg": { + "email": "me@example.ocm", + "password": "iliketurtles" + } + }, + "schema": { + "mqtt": { + "host": "str", + "port": "int", + "username": "str?", + "password": "str?" + }, + "tgtg": { + "email": "str", + "password": "str" + } + }, + "stage": "experimental", + "url": "https://github.com/MaxWinterstein/toogoodtogo-ha-mqtt-bridge", + "hassio_role": "default", + "hassio_api": true +} \ No newline at end of file diff --git a/toogoodtogo-ha-mqtt-bridge/icon.png b/toogoodtogo-ha-mqtt-bridge/icon.png new file mode 100644 index 0000000..847246b Binary files /dev/null and b/toogoodtogo-ha-mqtt-bridge/icon.png differ diff --git a/toogoodtogo-ha-mqtt-bridge/run.sh b/toogoodtogo-ha-mqtt-bridge/run.sh new file mode 100644 index 0000000..84aa83a --- /dev/null +++ b/toogoodtogo-ha-mqtt-bridge/run.sh @@ -0,0 +1,7 @@ +#!/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 \ No newline at end of file