Add TooGoodToGo Bridge

This commit is contained in:
Max Winterstein
2021-01-08 21:14:17 +01:00
parent 6aae107ad9
commit a25a7aafc6
8 changed files with 90 additions and 0 deletions

View File

@@ -7,6 +7,9 @@ Home Assistant Addon repository containing
## <img src="eufy-ha-mqtt-bridge/icon.png" width="40px"> Eufy Home Assistant MQTT Bridge ([matijse/eufy-ha-mqtt-bridge](https://github.com/matijse/eufy-ha-mqtt-bridge)) ## <img src="eufy-ha-mqtt-bridge/icon.png" width="40px"> 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. Forwards Eufy Security push notifications to Home Assistant via MQTT.
## <img src="toogoodtogo-ha-mqtt-bridge/icon.png" width="40px"> 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.
## <img src="ioBroker/icon.png" width="40px"> ioBroker ([iobroker.net](http://iobroker.net)) ## <img src="ioBroker/icon.png" width="40px"> ioBroker ([iobroker.net](http://iobroker.net))
Run ioBroker as Add-on. Run ioBroker as Add-on.

View File

@@ -0,0 +1,4 @@
# Changelog
## [0.1.0] - 2020-12-31
- Initial release

View File

@@ -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

View File

@@ -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" ]

View File

@@ -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.**

View File

@@ -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
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

@@ -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