Skip to content

Commit 5508d48

Browse files
committed
[#18] Add type annotations
1 parent 97fae39 commit 5508d48

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

adafruit_ntp.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"""
2222
import time
2323
import rtc
24+
from adafruit_esp32spi.adafruit_esp32spi import ESP_SPIcontrol
2425

2526
__version__ = "0.0.0-auto.0"
2627
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_NTP.git"
@@ -34,7 +35,7 @@ class NTP:
3435
:param bool debug: Set to True to output set_time() failures to console
3536
"""
3637

37-
def __init__(self, esp, debug=False):
38+
def __init__(self, esp: ESP_SPIcontrol, debug: bool = False) -> None:
3839
# Verify ESP32SPI module
3940
if "ESP_SPIcontrol" in str(type(esp)):
4041
self._esp = esp
@@ -43,7 +44,7 @@ def __init__(self, esp, debug=False):
4344
self.valid_time = False
4445
self.debug = debug
4546

46-
def set_time(self, tz_offset=0):
47+
def set_time(self, tz_offset: int = 0) -> None:
4748
"""Fetches and sets the microcontroller's current time
4849
in seconds since since Jan 1, 1970.
4950

0 commit comments

Comments
 (0)