Skip to content

changes to iotshadow.py json None handling #297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 25, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions awsiot/iotshadow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1327,16 +1327,14 @@ def __init__(self, *args, **kwargs):
def from_payload(cls, payload):
# type: (typing.Dict[str, typing.Any]) -> ShadowState
new = cls()
val = payload.get('desired')
if val is not None:
new.desired = val
val = payload.get('reported')
if val is not None:
new.reported = val
if new.desired == None:
new.desired_is_nullable = True
if new.reported == None:
new.reported_is_nullable = True
if 'desired' in payload:
new.desired = payload['desired']
new.desired_is_nullable = new.desired is None

if 'reported' in payload:
new.reported = payload['reported']
new.reported_is_nullable = new.reported is None

return new

def to_payload(self):
Expand Down