Fix PEPE257 issues
This commit is contained in:
1 parent
49ebc6d0b0
commit
8bff97083c
49 files changed
+429
-363
No files matched your search
@@ -15,7 +15,7 @@ ICON = 'mdi:clock'
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Get the Worldclock sensor."""
|
||||
"""Setup the Worldclock sensor."""
|
||||
try:
|
||||
time_zone = dt_util.get_time_zone(config.get('time_zone'))
|
||||
except AttributeError:
|
||||
@@ -33,9 +33,10 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
|
||||
|
||||
class WorldClockSensor(Entity):
|
||||
"""Implements a Worldclock sensor."""
|
||||
"""Represenatation of a Worldclock sensor."""
|
||||
|
||||
def __init__(self, time_zone, name):
|
||||
"""Initialize the sensor."""
|
||||
self._name = name
|
||||
self._time_zone = time_zone
|
||||
self._state = None
|
||||
@@ -43,12 +44,12 @@ class WorldClockSensor(Entity):
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Returns the name of the device."""
|
||||
"""Return the name of the device."""
|
||||
return self._name
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
"""Returns the state of the device."""
|
||||
"""Return the state of the device."""
|
||||
return self._state
|
||||
|
||||
@property
|
||||
@@ -57,6 +58,6 @@ class WorldClockSensor(Entity):
|
||||
return ICON
|
||||
|
||||
def update(self):
|
||||
"""Gets the time and updates the states."""
|
||||
"""Get the time and updates the states."""
|
||||
self._state = dt_util.datetime_to_time_str(
|
||||
dt_util.now(time_zone=self._time_zone))
|
||||
Reference in new issue
Block a user