1
mirror of https://github.com/home-assistant/core synced 2024-10-04 07:58:43 +02:00

Default to UTC if invalid timezone specified

This commit is contained in:
Paulus Schoutsen 2015-05-15 23:28:11 -07:00
parent f3f2240e4a
commit e0d697d0bc

View File

@ -961,12 +961,14 @@ class Config(object):
def as_dict(self):
""" Converts config to a dictionary. """
time_zone = self.time_zone or date_util.UTC
return {
'latitude': self.latitude,
'longitude': self.longitude,
'temperature_unit': self.temperature_unit,
'location_name': self.location_name,
'time_zone': self.time_zone.zone,
'time_zone': time_zone.zone,
'components': self.components,
}