mirror of
https://github.com/hexbabe/python-appimage-module.git
synced 2026-01-26 22:04:38 +01:00
Add boilerplate derived from OAK-D module
This commit is contained in:
22
src/main.py
Normal file
22
src/main.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import asyncio
|
||||
|
||||
from viam.components.camera import Camera
|
||||
from viam.logging import getLogger
|
||||
from viam.module.module import Module
|
||||
from src.module import MyModule
|
||||
|
||||
|
||||
LOGGER = getLogger(__name__)
|
||||
|
||||
|
||||
async def main():
|
||||
"""This function creates and starts a new module, after adding all desired resources.
|
||||
Resources must be pre-registered. For an example, see the `__init__.py` file.
|
||||
"""
|
||||
module = Module.from_args()
|
||||
module.add_model_from_registry(Camera.SUBTYPE, MyModule.MODEL)
|
||||
await module.start()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user