From e5ece2116b82dcb07580c4f3d80c54743c335703 Mon Sep 17 00:00:00 2001 From: Linus Dietz <45101649+Dielee@users.noreply.github.com> Date: Mon, 28 Aug 2023 15:09:01 +0200 Subject: [PATCH] Add option to use multiple docker containers (with different logins) #93 --- src/CHANGELOG.md | 5 +++++ src/config.yaml | 2 +- src/const.py | 2 +- src/mqtt.py | 5 ++++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md index ba30889..dbe1ee8 100644 --- a/src/CHANGELOG.md +++ b/src/CHANGELOG.md @@ -1,3 +1,8 @@ +## v1.8.6 +### 🚀 Features: + +- Add option to use multiple docker containers (with different logins) #93 + ## v1.8.5 ### 🚀 Features: diff --git a/src/config.yaml b/src/config.yaml index 96a7e72..5b8797d 100644 --- a/src/config.yaml +++ b/src/config.yaml @@ -1,6 +1,6 @@ name: "Volvo2Mqtt" description: "Volvo AAOS MQTT bridge" -version: "1.8.5" +version: "1.8.6" slug: "volvo2mqtt" init: false url: "https://github.com/Dielee/volvo2mqtt" diff --git a/src/const.py b/src/const.py index f524b70..eb458e3 100644 --- a/src/const.py +++ b/src/const.py @@ -1,6 +1,6 @@ from config import settings -VERSION = "v1.8.5" +VERSION = "v1.8.6" OAUTH_URL = "https://volvoid.eu.volvocars.com/as/token.oauth2" VEHICLES_URL = "https://api.volvocars.com/connected-vehicle/v1/vehicles" diff --git a/src/mqtt.py b/src/mqtt.py index 7d17f4d..0c0b3c2 100644 --- a/src/mqtt.py +++ b/src/mqtt.py @@ -4,6 +4,7 @@ import paho.mqtt.client as mqtt import json import volvo import util +import os from threading import Thread, Timer from datetime import datetime from babel.dates import format_datetime @@ -23,7 +24,9 @@ active_schedules = {} def connect(): - client = mqtt.Client("volvoAAOS2mqtt") + client = mqtt.Client("volvoAAOS2mqtt") if os.environ.get("IS_HA_ADDON") \ + else mqtt.Client("volvoAAOS2mqtt_" + settings.volvoData["username"]) + client.will_set(availability_topic, "offline", 0, False) if settings["mqtt"]["username"] and settings["mqtt"]["password"]: client.username_pw_set(settings["mqtt"]["username"], settings["mqtt"]["password"])