project-alice-assistant / ProjectAliceSkills

A repository containing all curated skills made by the community
GNU General Public License v3.0
24 stars 15 forks source link

[BUG] Adding new items in BringShoppingList not working #115

Closed Fe3lApAcUt closed 4 years ago

Fe3lApAcUt commented 4 years ago

Describe the bug Not able to add an item in BringShoppingList.

To Reproduce Steps to reproduce the behavior:

  1. Ask Alice to add an item to the BringShoppingList

Expected behavior The Item should be added to the BringShoppingList

Logs Get your logs at ~/ProjectAlice/var/logs

2020-04-03 16:58:57,883 [Thread-1] - [ERROR] - [SkillManager] Error dispatching message to BringShoppingList: Expecting value: line 1 column 1 (char 0) Traceback (most recent call last): File "/home/pi/ProjectAlice/core/base/SkillManager.py", line 278, in dispatchMessage consumed = skillInstance.onMessageDispatch(session) File "/home/pi/ProjectAlice/core/base/model/AliceSkill.py", line 425, in onMessageDispatch ret = function(session=session) File "/home/pi/ProjectAlice/core/util/Decorators.py", line 147, in exceptionDecorator return func(*args, **kwargs) File "/home/pi/ProjectAlice/core/util/Decorators.py", line 127, in offlineDecorator return func(*args, **kwargs) File "/home/pi/ProjectAlice/skills/BringShoppingList/BringShoppingList.py", line 159, in addItemIntent added, exist = self._addItemInt(items) File "/home/pi/ProjectAlice/skills/BringShoppingList/BringShoppingList.py", line 64, in _addItemInt bringItems = self.bring().get_items(self.LanguageManager.activeLanguageAndCountryCode)['purchase'] File "/home/pi/ProjectAlice/venv/lib/python3.7/site-packages/BringApi/BringApi.py", line 69, in get_items transl = BringApi.loadTranslations(locale) File "/home/pi/ProjectAlice/venv/lib/python3.7/site-packages/BringApi/BringApi.py", line 136, in loadTranslations cls._translations = requests.get(f'https://web.getbring.com/locale/articles.{locale}.json').json() File "/home/pi/ProjectAlice/venv/lib/python3.7/site-packages/requests/models.py", line 897, in json return complexjson.loads(self.text, **kwargs) File "/usr/lib/python3.7/json/__init__.py", line 348, in loads return _default_decoder.decode(s) File "/usr/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.7/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Alice version 1.0.0-b1

Fe3lApAcUt commented 4 years ago

activeCountryCode and activeLanguage together build the locale for this skill (and others), e.g. de-DE, de-CH. In my case it was set to de-US, which was not working.

Fe3lApAcUt commented 4 years ago

Thanks, @philipp2310!

Fe3lApAcUt commented 4 years ago

Only de-DE is working right now.

Psychokiller1888 commented 4 years ago

yeah, but de-US is not a valid combination. de-CH is valid and should work no?

Fe3lApAcUt commented 4 years ago

It should. Unfortunately it's not working, but it did in -a6.

philipp2310 commented 4 years ago

de-CH is not a valid country combination in b1:

from config.py "de": { "default": False, "defaultCountryCode": "DE", "countryCodes": [ "DE" ] },

after adding in , "CH" bring! works for me again.

One more hint for this could be found in the startup logs: "CH not valid, falling back to US"

philipp2310 commented 4 years ago

psycho added de-CH to the accepted languages, should be fixed please reopen if not working for you