Skip to content

Commit

Permalink
Merge pull request #8 from tijsverkoyen/7-ignore-missing-fields
Browse files Browse the repository at this point in the history
7 ignore missing fields
  • Loading branch information
tijsverkoyen authored Apr 12, 2023
2 parents 6e30b93 + f336c0d commit 30fd3ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions custom_components/energy_id/energy_id/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ def from_json(cls, json):
address = None
if 'address' in json:
address = EnergyIDAddress(
json['address']['streetAddress'],
json['address']['postalCode'],
json['address']['city'],
json['address']['country']
json['address']['streetAddress'] if 'streetAddress' in json['address'] else "",
json['address']['postalCode'] if 'postalCode' in json['address'] else "",
json['address']['city'] if 'city' in json['address'] else "",
json['address']['country'] if 'country' in json['address'] else "",
)

created = None
Expand Down
2 changes: 1 addition & 1 deletion custom_components/energy_id/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"requirements": [
],
"iot_class": "cloud_polling",
"version": "1.2.0"
"version": "1.2.1"
}

0 comments on commit 30fd3ab

Please sign in to comment.