Closed bdevel closed 2 years ago
would a try/except json.loads()
on data={...}
and fall back to regex; be appropriate?
edit: drop mention
I think something like that seems reasonable. I'm not sure what the original regex is designed to accomplish, it was added in #162 to handle the AD110. As long as there is a good way to handle this while not breaking the doorbell functionality, that would be great. I don't have one to test, though.
I think this is addressed in #212 that makes the change to be able to json.loads
the data in.
It seems the
_build_payload
function in src/amcrest/event.py cannot handle JSON style arrays as provided by my camera event stream.Package:
amcrest==1.9.3
Camera Details:
Event as seen by curl:
Parsed as:
Issue,
'RegionName'
value is parsed as'['
where[ "Driveway" ]
would be expected.Another example event:
Parsed as:
From what I see in my camera, it may be safe to assume
data={
can parse as JSON.