1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Use standardised datetime format

This commit is contained in:
Paulus Schoutsen
2016-04-16 00:55:35 -07:00
parent e7520ef401
commit 68d92c3196
29 changed files with 154 additions and 162 deletions

View File

@@ -12,6 +12,7 @@ from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = "Worldclock Sensor"
ICON = 'mdi:clock'
TIME_STR_FORMAT = "%H:%M"
def setup_platform(hass, config, add_devices, discovery_info=None):
@@ -59,5 +60,5 @@ class WorldClockSensor(Entity):
def update(self):
"""Get the time and updates the states."""
self._state = dt_util.datetime_to_time_str(
dt_util.now(time_zone=self._time_zone))
self._state = dt_util.now(time_zone=self._time_zone).strftime(
TIME_STR_FORMAT)