Skip to content

Commit 059dd16

Browse files
author
Russell Green
committed
chore: updates
1 parent d2ac748 commit 059dd16

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/server.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"""
1212
__author__ = "Russell Green"
1313
__license__ = "MIT"
14-
__version__ = "1.0.3"
14+
__version__ = "1.0.4"
1515
__maintainer__ = "Russell.Green"
1616
__email__ = "[email protected]"
1717
__status__ = "Production"
@@ -241,13 +241,21 @@ def set_get_pin_value(pin, value):
241241

242242

243243
def get_pin_history(pin):
244+
"""Gets pin history
245+
246+
Retrieves the pin history record if exists, otherwise creates a new one.
247+
"""
244248
if pin in gpio_pin_history:
245249
return gpio_pin_history[pin]
246250
else:
247-
return {"lastValue": None}
251+
return {"lastChange": None}
248252

249253

250254
def set_pin_history(pin):
255+
"""Sets pin history
256+
257+
Sets a pin history record for a given pin.
258+
"""
251259
history = {"lastChange": datetime.datetime.now()}
252260
record = get_pin_history(pin)
253261
record.update(history)

0 commit comments

Comments
 (0)