Skip to content

Commit

Permalink
fix(location): Ensure that location recognizes autocalculate
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey authored and Chris Mackey committed Jan 26, 2024
1 parent a4181e6 commit 87ac0cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ladybug/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ def from_dict(cls, data):
"""
optional_keys = ('city', 'state', 'country', 'latitude', 'longitude',
'time_zone', 'elevation', 'station_id', 'source')
auto_dict = {'type': 'Autocalculate'}
for key in optional_keys:
if key not in data:
if key not in data or data[key] == auto_dict:
data[key] = None

return cls(data['city'], data['state'], data['country'], data['latitude'],
Expand Down

0 comments on commit 87ac0cd

Please sign in to comment.