-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Russell Green
committed
Jun 6, 2023
1 parent
bc70842
commit f9c4767
Showing
1 changed file
with
6 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
""" | ||
__author__ = "Russell Green" | ||
__license__ = "MIT" | ||
__version__ = "1.1.0" | ||
__version__ = "1.0.1" | ||
__maintainer__ = "Russell.Green" | ||
__email__ = "[email protected]" | ||
__status__ = "Production" | ||
|
@@ -241,15 +241,15 @@ def set_get_pin_value(pin, value): | |
|
||
|
||
def get_pin_history(pin): | ||
return gpio_pin_history[pin] or {"lastValue": None} | ||
if pin in gpio_pin_history[pin]: | ||
return gpio_pin_history[pin] | ||
else: | ||
return {"lastValue": None} | ||
|
||
|
||
def set_pin_history(pin): | ||
history = {"lastChange": datetime.datetime.now()} | ||
if not gpio_pin_history[pin]: | ||
gpio_pin_history[pin] = history | ||
|
||
record = gpio_pin_history[pin] | ||
record = get_pin_history(pin) | ||
record.update(history) | ||
|
||
|
||
|