roleoroleo / yi-hack_ha_integration

Home Assistant custom integration for Yi cameras: yi-hack-MStar, yi-hack-Allwinner, yi-hack-Allwinner-v2, yi-hack-v5 and sonoff-hack
GNU General Public License v3.0
205 stars 32 forks source link

Error in Home Assitant log #60

Closed McGiverGim closed 2 years ago

McGiverGim commented 2 years ago

I see this error a lot of times:

2021-11-18 22:36:13 ERROR (SyncWorker_3) [homeassistant.util.json] Could not parse JSON content: /config/custom_components/yi_hack/translations/es.json
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/util/json.py", line 33, in load_json
return json.loads(fdesc.read()) # type: ignore
File "/usr/local/lib/python3.9/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf3 in position 166: invalid continuation byte
2021-11-18 22:36:13 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547109082784] Error handling message: 'utf-8' codec can't decode byte 0xf3 in position 166: invalid continuation byte
2021-11-18 22:36:28 ERROR (SyncWorker_5) [homeassistant.util.json] Could not parse JSON content: /config/custom_components/yi_hack/translations/es.json
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/util/json.py", line 33, in load_json
return json.loads(fdesc.read()) # type: ignore
File "/usr/local/lib/python3.9/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf3 in position 166: invalid continuation byte

I suspect of bad encoding in the spanish translation file.

roleoroleo commented 2 years ago

Do you want to try the last commit? It should be ok.

McGiverGim commented 2 years ago

@roleoroleo it seems you made it really wrong, take a look to the es file šŸ¤­

roleoroleo commented 2 years ago

I tested it in spanish. Did you try it?

McGiverGim commented 2 years ago

Really? You don't forget to fix the conflicts? https://github.com/roleoroleo/yi-hack_ha_integration/blob/main/custom_components/yi_hack/translations/es.json

roleoroleo commented 2 years ago

Mmmmh... Maybe... :)

roleoroleo commented 2 years ago

Fixed.

McGiverGim commented 2 years ago

Now all seems ok. I close the issue. Thanks!