mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 09:47:52 +00:00
fix if and remove tz
This commit is contained in:
parent
079ec43291
commit
03993cd5fa
@ -84,13 +84,10 @@ class TimeDateSensor(Entity):
|
|||||||
def update(self):
|
def update(self):
|
||||||
""" Gets the latest data and updates the states. """
|
""" Gets the latest data and updates the states. """
|
||||||
if self.type == 'time':
|
if self.type == 'time':
|
||||||
self._state = dt_util.datetime_to_short_time_str(
|
self._state = dt_util.datetime_to_short_time_str(dt_util.now())
|
||||||
dt_util.now(dt_util.DEFAULT_TIME_ZONE))
|
elif self.type == 'date':
|
||||||
if self.type == 'date':
|
self._state = dt_util.datetime_to_short_date_str(dt_util.now())
|
||||||
self._state = dt_util.datetime_to_short_date_str(
|
elif self.type == 'datetime':
|
||||||
dt_util.now(dt_util.DEFAULT_TIME_ZONE))
|
self._state = dt_util.datetime_to_short_date_str(dt_util.now()) + \
|
||||||
if self.type == 'datetime':
|
', ' + \
|
||||||
self._state = dt_util.datetime_to_short_date_str(
|
dt_util.datetime_to_short_time_str(dt_util.now())
|
||||||
dt_util.now(dt_util.DEFAULT_TIME_ZONE)) + ', ' + \
|
|
||||||
dt_util.datetime_to_short_time_str(
|
|
||||||
dt_util.now(dt_util.DEFAULT_TIME_ZONE))
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user