Skip to content

Commit

Permalink
Moved interval to const
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Lindvig authored Jan 16, 2022
1 parent 8ec6ef1 commit e55b25a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion custom_components/time_date_dk/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"codeowners": ["J-Lindvig"],
"requirements": [],
"iot_class": "local_push",
"version": "1.3"
"version": "1.4"
}
5 changes: 3 additions & 2 deletions custom_components/time_date_dk/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
ATTRIBUTION,
DATE_FORMAT,
TIME_FORMAT,
UPDATE_INTERVAL,
)

_LOGGER: logging.Logger = logging.getLogger(__package__)
Expand Down Expand Up @@ -140,7 +141,7 @@ def _getAdventsDates(self):
@property
def name(self) -> str:
"""Return the name of the sensor."""
return 'time_date_dk'
return 'Time, Date and other attributes in Danish'

@property
def native_value(self):
Expand Down Expand Up @@ -204,7 +205,7 @@ def get_next_interval(self):
now = dt_util.utcnow()

timestamp = dt_util.as_timestamp(now)
interval = 60
interval = UPDATE_INTERVAL

delta = interval - (timestamp % interval)
next_interval = now + timedelta(seconds=delta)
Expand Down

0 comments on commit e55b25a

Please sign in to comment.