mirror of
https://github.com/aljazceru/addons.git
synced 2025-12-18 05:34:20 +01:00
Fix encoder error on gassistant (#299)
* Update hassio_gassistant.py * Update config.json * Update CHANGELOG.md
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2.1
|
||||||
|
- Add error handling for decoding UTF-8
|
||||||
|
|
||||||
## 2.0
|
## 2.0
|
||||||
- Update Google Assistant SDK 0.5.0
|
- Update Google Assistant SDK 0.5.0
|
||||||
- Update Google Assistant Library 1.0.0
|
- Update Google Assistant Library 1.0.0
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Google Assistant SDK",
|
"name": "Google Assistant SDK",
|
||||||
"version": "2.0",
|
"version": "2.1",
|
||||||
"slug": "google_assistant",
|
"slug": "google_assistant",
|
||||||
"description": "A virtual personal assistant developed by Google",
|
"description": "A virtual personal assistant developed by Google",
|
||||||
"url": "https://home-assistant.io/addons/google_assistant/",
|
"url": "https://home-assistant.io/addons/google_assistant/",
|
||||||
|
|||||||
@@ -16,7 +16,10 @@ def process_event(event):
|
|||||||
if event.type == EventType.ON_CONVERSATION_TURN_STARTED:
|
if event.type == EventType.ON_CONVERSATION_TURN_STARTED:
|
||||||
print()
|
print()
|
||||||
|
|
||||||
print(event)
|
try:
|
||||||
|
print(event)
|
||||||
|
except UnicodeEncodeError as err:
|
||||||
|
print("Can't print event: {}".format(err))
|
||||||
|
|
||||||
if (event.type == EventType.ON_CONVERSATION_TURN_FINISHED and event.args and not event.args['with_follow_on_turn']):
|
if (event.type == EventType.ON_CONVERSATION_TURN_FINISHED and event.args and not event.args['with_follow_on_turn']):
|
||||||
print()
|
print()
|
||||||
@@ -42,7 +45,7 @@ if __name__ == '__main__':
|
|||||||
else:
|
else:
|
||||||
device_model_id = sys.argv[3]
|
device_model_id = sys.argv[3]
|
||||||
last_device_id = None
|
last_device_id = None
|
||||||
|
|
||||||
# run assistant
|
# run assistant
|
||||||
print("Run Google Assistant SDK")
|
print("Run Google Assistant SDK")
|
||||||
with Assistant(credentials, device_model_id) as assistant:
|
with Assistant(credentials, device_model_id) as assistant:
|
||||||
|
|||||||
Reference in New Issue
Block a user