|
@@ -46,7 +46,7 @@ class App:
|
|
|
self._battery_status_text_box = None
|
|
|
|
|
|
@property
|
|
|
- def _now_time(self) -> int:
|
|
|
+ def _now_daytime(self) -> int:
|
|
|
# > [contradictory to] official micropython documentation, to set RTC,
|
|
|
# > use particular tuple (year , month, day, week=0, hour, minute, second, timestamp=0)
|
|
|
# https://community.m5stack.com/topic/3108/m5stack-core2-micropython-rtc-example
|
|
@@ -54,7 +54,7 @@ class App:
|
|
|
return (hour * 60 + minute) * 60 + seconds
|
|
|
|
|
|
@property
|
|
|
- def _alarm_time(self) -> int:
|
|
|
+ def _alarm_daytime(self) -> int:
|
|
|
return (self._alarm_hour * 60 + self._alarm_minute) * 60 # type: ignore
|
|
|
|
|
|
def _load_alarm_time(self) -> None:
|
|
@@ -107,7 +107,7 @@ class App:
|
|
|
micropython.schedule(lambda n: self._configure_alarm_timer(), None)
|
|
|
|
|
|
def _configure_alarm_timer(self) -> None:
|
|
|
- seconds_until_alarm = (self._alarm_time - self._now_time - 1) % (
|
|
|
+ seconds_until_alarm = (self._alarm_daytime - self._now_daytime - 1) % (
|
|
|
24 * 60 * 60
|
|
|
) + 1
|
|
|
print("alarm in ", seconds_until_alarm / 60, " min")
|