Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 9f346e0

Browse files
author
bweigel
committed
[alexa-skill-event] be resilient to new properties
1 parent 83e51c1 commit 9f346e0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lawip/alexa_skill_event.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,15 @@ def __init__(self, new: bool,
8484
sessionId: str,
8585
user: Dict[str, str],
8686
application: Dict[str, str],
87-
attributes: Dict = None):
87+
attributes: Dict = None,
88+
**kwargs):
8889
self._new = new
8990
self._session_id = sessionId
9091
self._attributes = attributes
9192
self._user = AlexaSkillUser(**user)
9293
self._application = AlexaSkillApplication(**application)
94+
if len(kwargs) > 0:
95+
LOG.warning(f"Unerwartete keyword-argumente gefunden in {self.__class__} => {kwargs}")
9396

9497
@classmethod
9598
def from_json(cls, session):

lawip/test/resources/alexa-event.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"new": false,
44
"sessionId": "amzn1.echo-api.session.[unique-value-here]",
55
"attributes": {},
6+
"certificationParam2": "test123",
67
"user": {
78
"userId": "amzn1.ask.account.[unique-value-here]"
89
},

0 commit comments

Comments
 (0)