Skip to content

Commit

Permalink
Update event.py
Browse files Browse the repository at this point in the history
  • Loading branch information
blademckain committed Sep 22, 2020
1 parent ef740a4 commit 8ef01c4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/amcrest/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,15 @@ def event_actions(self, eventcodes, retries=None, timeout_cmd=None):
_LOGGER.debug("%s event info: %r", self, event_info)
payload = dict()
for Key, Value \
in _REG_PARSE_KEY_VALUE.findall(event_info.strip().replace('\n', '')):
in _REG_PARSE_KEY_VALUE.findall(
event_info.strip().replace('\n', '')
):
if Key == 'data':
tmpData = dict()
for DataKey, DataValue \
in _REG_PARSE_MALFORMED_JSON.findall(Value):
tmpData[DataKey.replace('"', '')] = DataValue.replace('"', '')
tmpData[DataKey.replace('"', '')] = \
DataValue.replace('"', '')
Value = tmpData
payload[Key] = Value
_LOGGER.debug(
Expand Down

0 comments on commit 8ef01c4

Please sign in to comment.