mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Default to UTC if invalid timezone specified
This commit is contained in:
parent
f3f2240e4a
commit
e0d697d0bc
@ -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,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user