diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md index dbe1ee8..3f1ef73 100644 --- a/src/CHANGELOG.md +++ b/src/CHANGELOG.md @@ -1,3 +1,12 @@ +## v1.8.7 +### 🚀 Features: + +- Add option to disable log completely #96 + +### 🐛 Bug Fixes: + +- Fix regex error for some mailaddresses #97 + ## v1.8.6 ### 🚀 Features: diff --git a/src/config.yaml b/src/config.yaml index 5b8797d..bb81282 100644 --- a/src/config.yaml +++ b/src/config.yaml @@ -1,6 +1,6 @@ name: "Volvo2Mqtt" description: "Volvo AAOS MQTT bridge" -version: "1.8.6" +version: "1.8.7" slug: "volvo2mqtt" init: false url: "https://github.com/Dielee/volvo2mqtt" @@ -15,6 +15,7 @@ options: babelLocale: null TZ: null debug: false + disable_logging: false mqtt: broker: "auto_broker" port: "auto_port" @@ -34,13 +35,14 @@ schema: babelLocale: str TZ: match(^.+/.+$) debug: bool + disable_logging: bool mqtt: broker: str port: str username: str? password: str? volvoData: - username: match(^([\w+\.]+@([\w-]+\.)+[\w-]{2,4})|(\+\d{5,20})$) + username: match(^([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+)|(\+\d{5,20})$) password: str vin: str? vccapikey: diff --git a/src/const.py b/src/const.py index eb458e3..748419e 100644 --- a/src/const.py +++ b/src/const.py @@ -1,6 +1,6 @@ from config import settings -VERSION = "v1.8.6" +VERSION = "v1.8.7" OAUTH_URL = "https://volvoid.eu.volvocars.com/as/token.oauth2" VEHICLES_URL = "https://api.volvocars.com/connected-vehicle/v1/vehicles" diff --git a/src/settings.json b/src/settings.json index 9294890..f5ab748 100644 --- a/src/settings.json +++ b/src/settings.json @@ -2,6 +2,8 @@ "updateInterval": 300, "babelLocale": "de", "TZ": "Europe/Berlin", + "debug": false, + "disable_logging": false, "mqtt": { "broker": "", "port": 1883, diff --git a/src/translations/en.yaml b/src/translations/en.yaml index 80b0629..8a4f6fd 100644 --- a/src/translations/en.yaml +++ b/src/translations/en.yaml @@ -11,6 +11,9 @@ configuration: debug: name: API debug mode description: Enable Volvo API debug, normaly this can stay off. If enabled, the complete log file can be found under \\\addons\volvo2mqtt\log\volvo2mqtt.log. + disable_logging: + name: Disable logging + description: Disable logging completely to reduce IO and SD card access. mqtt: name: MQTT Broker settings description: Leave the settings as they are if you are using the MQTT Mosquitto Addon. If not, take a look at the readme from volvo2mqtt. diff --git a/src/util.py b/src/util.py index 32952da..f20eff6 100644 --- a/src/util.py +++ b/src/util.py @@ -68,6 +68,10 @@ def setup_logging(): if settings["debug"]: logger.setLevel(logging.DEBUG) + if "disable_logging" in settings: + if settings["disable_logging"]: + logger.setLevel(logging.ERROR) + def check_existing_folder(): Path("/addons/volvo2mqtt/log/").mkdir(parents=True, exist_ok=True)