Dielee / volvo2mqtt

Home Assistant addon for connecting AAOS Volvos
MIT License
162 stars 38 forks source link

TypeError: <lambda>() got an unexpected keyword argument 'box_settings' #132

Closed mickemartinsson closed 1 year ago

mickemartinsson commented 1 year ago

New car (XC40 MY24) so I made a new installation in Docker (separated machine) with :latest Same setup as the old car (XC40 MY21) that worked perfectly.

Docker container stops directly with the following error:

Traceback (most recent call last):

File "/usr/local/lib/python3.9/site-packages/dynaconf/utils/parse_conf.py", line 273, in get_converter

converted_value = converter(value, box_settings=box_settings)

TypeError: () got an unexpected keyword argument 'box_settings'

Dielee commented 1 year ago

This is a config error. The issue comes from dynaconf. Please recheck everything.

mickemartinsson commented 1 year ago

Tried both with and without VIN and also to set locale as se and sv_se. Everything else is like before and is the same way as the example. Here is the latest error.

Traceback (most recent call last):

File "/usr/local/lib/python3.9/site-packages/dynaconf/utils/parse_conf.py", line 273, in get_converter

converted_value = converter(value, box_settings=box_settings)

TypeError: () got an unexpected keyword argument 'box_settings'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/volvoAAOS2mqtt/./main.py", line 2, in

from volvo import authorize

File "/volvoAAOS2mqtt/volvo.py", line 3, in

import mqtt

File "/volvoAAOS2mqtt/mqtt.py", line 6, in

import util

File "/volvoAAOS2mqtt/util.py", line 9, in

from const import units

File "/volvoAAOS2mqtt/const.py", line 82, in

{"name": "Electric Range", "domain": "sensor", "id": "electric_range", "unit": "km" if not units.get(settings["babelLocale"]) else units[settings["babelLocale"]]["electric_range"]["unit"], "icon": "map-marker-distance", "url": RECHARGE_STATE_URL, "state_class": "measurement"},

File "/usr/local/lib/python3.9/site-packages/dynaconf/utils/functional.py", line 18, in inner

self._setup()

File "/usr/local/lib/python3.9/site-packages/dynaconf/base.py", line 174, in _setup

self._wrapped = Settings(

File "/usr/local/lib/python3.9/site-packages/dynaconf/base.py", line 253, in init

self.execute_loaders()

File "/usr/local/lib/python3.9/site-packages/dynaconf/base.py", line 1035, in execute_loaders

core_loader.load(self, env, silent=silent, key=key)

File "/usr/local/lib/python3.9/site-packages/dynaconf/loaders/env_loader.py", line 33, in load

load_from_env(obj, global_prefix, key, silent, IDENTIFIER + "_global")

File "/usr/local/lib/python3.9/site-packages/dynaconf/loaders/env_loader.py", line 73, in load_from_env

data = {

File "/usr/local/lib/python3.9/site-packages/dynaconf/loaders/env_loader.py", line 74, in

key[trim_len:]: parse_conf_data(

File "/usr/local/lib/python3.9/site-packages/dynaconf/utils/parse_conf.py", line 379, in parse_conf_data

return _parse_conf_data(data, tomlfy=tomlfy, box_settings=box_settings)

File "/usr/local/lib/python3.9/site-packages/dynaconf/utils/parse_conf.py", line 343, in _parse_conf_data

value = get_converter(converter_key, value, box_settings)

File "/usr/local/lib/python3.9/site-packages/dynaconf/utils/parse_conf.py", line 275, in get_converter

converted_value = converter(value)

File "/usr/local/lib/python3.9/site-packages/dynaconf/utils/parse_conf.py", line 250, in

else json.loads(value),

File "/usr/local/lib/python3.9/json/init.py", line 346, in loads

return _default_decoder.decode(s)

File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode

obj, end = self.raw_decode(s, idx=_w(s, 0).end())

File "/usr/local/lib/python3.9/json/decoder.py", line 353, in raw_decode

obj, end = self.scan_once(s, idx)

json.decoder.JSONDecodeError: Expecting ':' delimiter: line 1 column 93 (char 92)

Dielee commented 1 year ago

The error doesn't say anything. Please share me you docker startup command.

mickemartinsson commented 1 year ago

docker run -d --pull=always -e CONF_updateInterval=300 -e CONF_babelLocale=’sv_SE’ -e CONF_mqtt='@json {"broker": ”xxxxxx”, "username": "mqttuser", "password": "xxxxxx", "port": 1883}' -e CONF_volvoData='@json {"username": "mikael@xxxxxx", "password": "xxxxxx", "vin”: "xxxxxx”, "vccapikey": ["xxxxxx", "xxxxxx"]}' -e TZ='Europe/Stockholm' --name volvo2mqtt ghcr.io/dielee/volvo2mqtt:latest

The xxxxx is changed for security.

Dielee commented 1 year ago

This: CONF_babelLocale=’sv_SE’ looks suspicious. Please correct this to CONF_babelLocale='sv_SE'. Also, @json have to be lower and those are wrong. Please use ":

docker run -d --pull=always -e CONF_updateInterval=300 -e CONF_babelLocale='sv_SE' -e CONF_mqtt='@json {"broker": "xxxxxx", "username": "mqttuser", "password": "xxxxxx", "port": 1883}' -e CONF_volvoData='@json {"username": "mikael@xxxxxx", "password": "xxxxxx", "vin": "xxxxxx", "vccapikey": ["xxxxxx", "xxxxxx"]}' -e TZ='Europe/Stockholm' --name volvo2mqtt ghcr.io/dielee/volvo2mqtt:latest
mickemartinsson commented 1 year ago

On my side it is lower @json and with correct ". Must be the web editor that changes it. The change in locale was no change from my code and made the same error.

mickemartinsson commented 1 year ago

CleanShot 2023-11-21 at 16 27 33

Dielee commented 1 year ago

CleanShot 2023-11-21 at 16 27 33

This contains also the wrong quotes

mickemartinsson commented 1 year ago

It is the correct ones in Swedish - the docker container starts and I use it on other docker containers. Here is a more correct image from terminal. CleanShot 2023-11-21 at 16 35 23

Dielee commented 1 year ago

Yeah, maybe in swedish, but not in JSON and shell.. Your screen can't work.

mickemartinsson commented 1 year ago

It is the same as the example. What other “ are there.

Med vänliga hälsningar /Mikael Martinsson Frösön On 21 Nov 2023 at 16:38 +0100, Linus Dietz @.***>, wrote:

Yeah, maybe in swedish, but not in JSON and shell.. Your screen can't work. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

mickemartinsson commented 1 year ago

It was a typo-error