mirror of
https://github.com/Dielee/volvo2mqtt.git
synced 2026-08-13 11:19:52 +02:00
Add HomeAssistant add-on
This commit is contained in:
@@ -0,0 +1,20 @@
|
|||||||
|
ARG BUILD_FROM
|
||||||
|
FROM $BUILD_FROM
|
||||||
|
|
||||||
|
# Install requirements for add-on
|
||||||
|
RUN apk add --no-cache python3 bash py3-pip
|
||||||
|
|
||||||
|
# set the working directory in the container
|
||||||
|
WORKDIR /volvoAAOS2mqtt
|
||||||
|
|
||||||
|
# download requirements.txt
|
||||||
|
RUN wget https://raw.githubusercontent.com/Dielee/volvo2mqtt/main/requirements.txt
|
||||||
|
|
||||||
|
# install dependencies
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
|
# copy the content of the local src directory to the working directory
|
||||||
|
COPY / .
|
||||||
|
|
||||||
|
# command to run on container start
|
||||||
|
CMD [ "python", "-u", "./main.py" ]
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
#include <tunables/global>
|
||||||
|
|
||||||
|
profile volvo2mqtt flags=(attach_disconnected,mediate_deleted) {
|
||||||
|
#include <abstractions/base>
|
||||||
|
|
||||||
|
# Capabilities
|
||||||
|
file,
|
||||||
|
signal (send) set=(kill,term,int,hup,cont),
|
||||||
|
|
||||||
|
# S6-Overlay
|
||||||
|
/init ix,
|
||||||
|
/bin/** ix,
|
||||||
|
/usr/bin/** ix,
|
||||||
|
/run/{s6,s6-rc*,service}/** ix,
|
||||||
|
/package/** ix,
|
||||||
|
/command/** ix,
|
||||||
|
/etc/services.d/** rwix,
|
||||||
|
/etc/cont-init.d/** rwix,
|
||||||
|
/etc/cont-finish.d/** rwix,
|
||||||
|
/run/{,**} rwk,
|
||||||
|
/dev/tty rw,
|
||||||
|
|
||||||
|
# Bashio
|
||||||
|
/usr/lib/bashio/** ix,
|
||||||
|
/tmp/** rwk,
|
||||||
|
|
||||||
|
# Access to options.json and other files within your addon
|
||||||
|
/data/** rw,
|
||||||
|
|
||||||
|
# Start new profile for service
|
||||||
|
/usr/bin/myprogram cx -> myprogram,
|
||||||
|
|
||||||
|
profile myprogram flags=(attach_disconnected,mediate_deleted) {
|
||||||
|
#include <abstractions/base>
|
||||||
|
|
||||||
|
# Receive signals from S6-Overlay
|
||||||
|
signal (receive) peer=*_ADDON_SLUG,
|
||||||
|
|
||||||
|
# Access to options.json and other files within your addon
|
||||||
|
/data/** rw,
|
||||||
|
|
||||||
|
# Access to mapped volumes specified in config.json
|
||||||
|
/share/** rw,
|
||||||
|
|
||||||
|
# Access required for service functionality
|
||||||
|
/usr/bin/myprogram r,
|
||||||
|
/bin/bash rix,
|
||||||
|
/bin/echo ix,
|
||||||
|
/etc/passwd r,
|
||||||
|
/dev/tty rw,
|
||||||
|
|
||||||
|
# Allow outbound MQTT communication
|
||||||
|
network tcp,
|
||||||
|
network inet stream,
|
||||||
|
network inet dgram,
|
||||||
|
network inet6 stream,
|
||||||
|
network inet6 dgram,
|
||||||
|
|
||||||
|
# Add any additional MQTT-related rules if needed
|
||||||
|
# For example, if you're using the paho-mqtt library
|
||||||
|
/usr/bin/python3 cx -> paho.mqtt,
|
||||||
|
/usr/lib/python3.11/site-packages/paho/mqtt/** r,
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -2,5 +2,5 @@ from dynaconf import Dynaconf
|
|||||||
|
|
||||||
settings = Dynaconf(
|
settings = Dynaconf(
|
||||||
envvar_prefix="CONF",
|
envvar_prefix="CONF",
|
||||||
settings_files=["settings.json"],
|
settings_files=["settings.json", "/data/options.json"],
|
||||||
)
|
)
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
name: "Volvo2Mqtt"
|
||||||
|
description: "Volvo AAOS MQTT bridge"
|
||||||
|
version: "1.1.0"
|
||||||
|
slug: "volvo2mqtt"
|
||||||
|
init: false
|
||||||
|
url: "https://github.com/Dielee/volvo2mqtt"
|
||||||
|
apparmor: true
|
||||||
|
options:
|
||||||
|
updateInterval: 300
|
||||||
|
babelLocale: null
|
||||||
|
debug: false
|
||||||
|
mqtt:
|
||||||
|
broker: null
|
||||||
|
username: ""
|
||||||
|
password: ""
|
||||||
|
volvoData:
|
||||||
|
username: null
|
||||||
|
password: null
|
||||||
|
vin: ""
|
||||||
|
vccapikey: null
|
||||||
|
schema:
|
||||||
|
updateInterval: int(10,)
|
||||||
|
babelLocale: str
|
||||||
|
debug: bool
|
||||||
|
mqtt:
|
||||||
|
broker: str
|
||||||
|
username: str?
|
||||||
|
password: str?
|
||||||
|
volvoData:
|
||||||
|
username: str
|
||||||
|
password: str
|
||||||
|
vin: str?
|
||||||
|
vccapikey: str
|
||||||
|
arch:
|
||||||
|
- aarch64
|
||||||
|
- amd64
|
||||||
|
- armhf
|
||||||
|
- armv7
|
||||||
|
- i386
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
VERSION = "v1.0.11"
|
VERSION = "v1.1.0"
|
||||||
|
|
||||||
OAUTH_URL = "https://volvoid.eu.volvocars.com/as/token.oauth2"
|
OAUTH_URL = "https://volvoid.eu.volvocars.com/as/token.oauth2"
|
||||||
VEHICLES_URL = "https://api.volvocars.com/connected-vehicle/v1/vehicles"
|
VEHICLES_URL = "https://api.volvocars.com/connected-vehicle/v1/vehicles"
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
Reference in New Issue
Block a user