-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Started splitting out components and standardising modules
- Loading branch information
Showing
8 changed files
with
71 additions
and
5 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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
# Template Module |
Empty file.
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from standalone_modules.shed_pi_module_utils.base_protocol import BaseProtocol | ||
from standalone_modules.shed_pi_module_utils.data_submission import ( | ||
ReadingSubmissionService, | ||
) | ||
from standalone_modules.shed_pi_module_utils.utils import logger | ||
|
||
|
||
class DeviceProtocol(BaseProtocol): | ||
def __init__(self, submission_service: ReadingSubmissionService): | ||
... | ||
|
||
def stop(self): | ||
logger.info("Stopping device protocol") | ||
|
||
def start(self): | ||
logger.info("Starting device protocol") | ||
|
||
|
||
def main(): | ||
# The Submission service is used to record any module data | ||
submission_service = ReadingSubmissionService() | ||
device = DeviceProtocol(submission_service=submission_service) | ||
|
||
try: | ||
device.startup() | ||
device.start() | ||
finally: | ||
device.shutdown() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Empty file.
Empty file.
Empty file.
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