forked from home-assistant/core
Default to UTC if invalid timezone specified
This commit is contained in:
@@ -961,12 +961,14 @@ class Config(object):
|
|||||||
|
|
||||||
def as_dict(self):
|
def as_dict(self):
|
||||||
""" Converts config to a dictionary. """
|
""" Converts config to a dictionary. """
|
||||||
|
time_zone = self.time_zone or date_util.UTC
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'latitude': self.latitude,
|
'latitude': self.latitude,
|
||||||
'longitude': self.longitude,
|
'longitude': self.longitude,
|
||||||
'temperature_unit': self.temperature_unit,
|
'temperature_unit': self.temperature_unit,
|
||||||
'location_name': self.location_name,
|
'location_name': self.location_name,
|
||||||
'time_zone': self.time_zone.zone,
|
'time_zone': time_zone.zone,
|
||||||
'components': self.components,
|
'components': self.components,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user