Prepare the repo for automation

This commit is contained in:
Etienne G
2023-10-08 23:15:27 +11:00
parent a11f18e968
commit 5d8fc3d36f
9 changed files with 78 additions and 294 deletions
-10
View File
@@ -1,10 +0,0 @@
# Changelog since v0.1.0
- ⬆️ Update Add-on base image to v14.2.1
- Corrected typo
- Add multiple target for deploy
- Updated base
- Updated deploy configuration
- Updated repository URL
- Add edge
- ⬆️ Update alpine_3_18/python3 to v3.11.6-r0
- Add ref to stable repository
-34
View File
@@ -1,34 +0,0 @@
ARG BUILD_FROM=ghcr.io/hassio-addons/base:14.2.1
# hadolint ignore=DL3006
FROM $BUILD_FROM
ENV LANG C.UTF-8
# Run updates
# RUN apt-get clean && apt-get update && apt-get upgrade -y
# Set the locale
# RUN apt-get install -y locales && locale-gen en_US.UTF-8
# Install python/pip
ENV PYTHONUNBUFFERED=1
RUN apk add --update --no-cache python3=3.11.4-r0 && ln -sf python3 /usr/bin/python && python3 -m ensurepip
#RUN curl -k https://codeload.github.com/johanmeijer/grott/zip/master --output files.zip && unzip files.zip
#RUN unzip files.zip
# Copy data for add-on
COPY script.sh /app/script.sh
RUN chmod a+x /app/script.sh
WORKDIR /app
RUN curl -Lk 'https://github.com/johanmeijer/grott/archive/refs/heads/master.zip' --output files.zip && unzip -o files.zip && rm files.zip && mv grott-*/*.py ./
# Move the addon
RUN mv grott-*/examples/Home\ Assistent/grott_ha.py ./
COPY requirements.txt requirements.txt
#Install required python packages
RUN pip3 install --no-cache-dir -r requirements.txt
CMD [ "./script.sh" ]
-39
View File
@@ -1,39 +0,0 @@
# Grott - Home Assistant native MQTT integration
![Release][release-shield]][release] ![Project Stage][project-stage-shield] ![Project Maintenance][maintenance-shield]
This addon allow you to run a local version of grott with the HA plugin
and auto discovery enabled.
The data is fowarded to the growatt's server.
The grott server decode them and send them to your HA instance.
This addon is based on the 2.7.8
[grott](https://github.com/johanmeijer/grott) code
and current grott_ha extension.
## WARNING! THIS IS AN EDGE VERSION!
This Home Assistant Add-ons repository contains edge builds of add-ons.
Edge builds add-ons are based upon the latest development version.
- They may not work at all.
- They might stop working at any time.
- They could have a negative impact on your system.
This repository was created for:
- Anybody willing to test.
- Anybody interested in trying out upcoming add-ons or add-on features.
- Developers.
If you are more interested in stable releases of our add-ons:
<https://github.com/egguy/ha-addons>
[project-stage-shield]: https://img.shields.io/badge/project%20stage-production%20ready-brightgreen.svg
[release-shield]: https://img.shields.io/badge/version-044729b-blue.svg
[release]: https://github.com/egguy/addon-grott/tree/044729b
-10
View File
@@ -1,10 +0,0 @@
---
build_from:
aarch64: ghcr.io/hassio-addons/base/aarch64:14.2.1
amd64: ghcr.io/hassio-addons/base/amd64:14.2.1
armhf: ghcr.io/hassio-addons/base/armhf:14.2.1
armv7: ghcr.io/hassio-addons/base/armv7:14.2.1
i386: ghcr.io/hassio-addons/base/i386:14.2.1
codenotary:
base_image: codenotary@frenck.dev
signer: etienne.guilluy@gmail.com
+10 -9
View File
@@ -1,19 +1,21 @@
---
name: grott
version: 044729b
slug: grott
description: The Growatt inverter monitor with current HA plugin integrated
url: https://github.com/egguy/addon-grott
arch:
- armhf
- armv7
- aarch64
- amd64
- i386
- armhf
- armv7
- aarch64
- amd64
- i386
services:
- mqtt:need
- mqtt:need
init: false
map:
- config:rw
- config:rw
ports:
5279/tcp: 5279
ports_description:
@@ -23,7 +25,7 @@ options:
gmode: proxy
grott_mqtt: false
ginvtype: default
ginvtypemap: ''
ginvtypemap: ""
retain: false
verbose: false
ha_plugin: true
@@ -83,4 +85,3 @@ schema:
user: str?
password: str?
data_path: str
image: ghcr.io/egguy/grott/{arch}
-3
View File
@@ -1,3 +0,0 @@
paho-mqtt==1.6.1
requests==2.31.0
influxdb==5.3.1
-179
View File
@@ -1,179 +0,0 @@
#!/command/with-contenv bashio
# shellcheck shell=bash
# Follow shellcheck recommendations
if bashio::config.has_value 'verbose'; then
# bug in grott code, see: https://github.com/johanmeijer/grott/pull/304
gverbose="$(bashio::config 'verbose')"
verbose="$(bashio::config 'verbose')"
export gverbose
export verbose
fi
if bashio::config.has_value 'gminrecl'; then
gminrecl="$(bashio::config 'gminrecl')"
export gminrecl
fi
if bashio::config.has_value 'gmode'; then
gmode="$(bashio::config 'gmode')"
export gmode
fi
if bashio::config.has_value 'ggrottip'; then
ggrottip="$(bashio::config 'ggrottip')"
export ggrottip
fi
if bashio::config.has_value 'ggrottport'; then
ggrottport="$(bashio::config 'ggrottport')"
export ggrottport
fi
if bashio::config.has_value 'gblockcmd'; then
gblockcmd="$(bashio::config 'gblockcmd')"
export gblockcmd
fi
if bashio::config.has_value 'gnoipf'; then
gnoipf="$(bashio::config 'gnoipf')"
export gnoipf
fi
if bashio::config.has_value 'gtime'; then
gtime="$(bashio::config 'gtime')"
export gtime
fi
if bashio::config.has_value 'gtimezone'; then
gtimezone="$(bashio::config 'gtimezone')"
export gtimezone
fi
if bashio::config.has_value 'gsendbuf'; then
gsendbuf="$(bashio::config 'gsendbuf')"
export gsendbuf
fi
if bashio::config.has_value 'gcompat'; then
gcompat="$(bashio::config 'gcompat')"
export gcompat
fi
if bashio::config.has_value 'gvalueoffset'; then
gvalueoffset="$(bashio::config 'gvalueoffset')"
export gvalueoffset
fi
if bashio::config.has_value 'ginverterid'; then
ginverterid="$(bashio::config 'ginverterid')"
export ginverterid
fi
if bashio::config.has_value 'gincludeall'; then
gincludeall="$(bashio::config 'gincludeall')"
export gincludeall
fi
if bashio::config.has_value 'ginvtype'; then
ginvtype="$(bashio::config 'ginvtype')"
export ginvtype
fi
if bashio::config.has_value 'gdecrypt'; then
gdecrypt="$(bashio::config 'gdecrypt')"
export gdecrypt
fi
if bashio::config.has_value 'ggrowattip'; then
ggrowattip="$(bashio::config 'ggrowattip')"
export ggrowattip
fi
if bashio::config.has_value 'ggrowattport'; then
ggrowattport="$(bashio::config 'ggrowattport')"
export ggrowattport
fi
if bashio::config.has_value 'gmqttip'; then
gmqttip="$(bashio::config 'gmqttip')"
export gmqttip
fi
if bashio::config.has_value 'gmqttport'; then
gmqttport="$(bashio::config 'gmqttport')"
export gmqttport
fi
if bashio::config.has_value 'gmqtttopic'; then
gmqtttopic="$(bashio::config 'gmqtttopic')"
export gmqtttopic
fi
if bashio::config.has_value 'gmqttauth'; then
gmqttauth="$(bashio::config 'gmqttauth')"
export gmqttauth
fi
if bashio::config.has_value 'gmqttuser'; then
gmqttuser="$(bashio::config 'gmqttuser')"
export gmqttuser
fi
if bashio::config.has_value 'gmqttpassword'; then
gmqttpassword="$(bashio::config 'gmqttpassword')"
export gmqttpassword
fi
if bashio::config.has_value 'gpvoutput'; then
gpvoutput="$(bashio::config 'gpvoutput')"
export gpvoutput
fi
if bashio::config.has_value 'gpvapikey'; then
gpvapikey="$(bashio::config 'gpvapikey')"
export gpvapikey
fi
if bashio::config.has_value 'gpvsystemid'; then
gpvsystemid="$(bashio::config 'gpvsystemid')"
export gpvsystemid
fi
if bashio::config.has_value 'gpvinverters'; then
gpvinverters="$(bashio::config 'gpvinverters')"
export gpvinverters
fi
if bashio::config.has_value 'ginflux'; then
ginflux="$(bashio::config 'ginflux')"
export ginflux
fi
if bashio::config.has_value 'ginflux2'; then
ginflux2="$(bashio::config 'ginflux2')"
export ginflux2
fi
if bashio::config.has_value 'gifdbname'; then
gifdbname="$(bashio::config 'gifdbname')"
export gifdbname
fi
if bashio::config.has_value 'gifip'; then
gifip="$(bashio::config 'gifip')"
export gifip
fi
if bashio::config.has_value 'gifport'; then
gifport="$(bashio::config 'gifport')"
export gifport
fi
if bashio::config.has_value 'gifuser'; then
gifuser="$(bashio::config 'gifuser')"
export gifuser
fi
if bashio::config.has_value 'gifpassword'; then
gifpassword="$(bashio::config 'gifpassword')"
export gifpassword
fi
if bashio::config.has_value 'giforg'; then
giforg="$(bashio::config 'giforg')"
export giforg
fi
if bashio::config.has_value 'gifbucket'; then
gifbucket="$(bashio::config 'gifbucket')"
export gifbucket
fi
if bashio::config.has_value 'giftoken'; then
giftoken="$(bashio::config 'giftoken')"
export giftoken
fi
if bashio::config.has_value 'ginvtypemap'; then
ginvtypemap="$(bashio::config 'ginvtypemap')"
export ginvtypemap
fi
if bashio::config.has_value 'gpvdisv1'; then
gpvdisv1="$(bashio::config 'gpvdisv1')"
export gpvdisv1
fi
gextension="True"
gextname="grott_ha"
# shellcheck disable=SC2089
gextvar="{\"ha_mqtt_host\": \"$(bashio::services mqtt "host")\", \"ha_mqtt_port\": \"$(bashio::services mqtt "port")\", \"ha_mqtt_user\": \"$(bashio::services mqtt "username")\", \"ha_mqtt_password\": \"$(bashio::services mqtt "password")\"}"
export gextension
export gextname
# shellcheck disable=SC2090
export gextvar
python -u grott.py -v