refactoring

This commit is contained in:
Maxim Devaev
2023-03-07 23:54:05 +02:00
parent 002031baf1
commit f652eca9c2
15 changed files with 49 additions and 49 deletions

View File

@@ -44,13 +44,13 @@ def _join_rtc(rtc: int, key: str) -> str:
def _read_int(rtc: int, key: str) -> int:
with open(_join_rtc(rtc, key)) as value_file:
return int(value_file.read().strip() or "0")
with open(_join_rtc(rtc, key)) as file:
return int(file.read().strip() or "0")
def _write_int(rtc: int, key: str, value: int) -> None:
with open(_join_rtc(rtc, key), "w") as value_file:
value_file.write(str(value))
with open(_join_rtc(rtc, key), "w") as file:
file.write(str(value))
def _reset_alarm(rtc: int, timeout: int) -> None: