Added dynamic platform loader

This commit is contained in:
2021-11-19 02:18:58 +01:00
parent 8f976721ab
commit 6b47c3f555
8 changed files with 28 additions and 10 deletions

18
src/utils/platform.py Normal file
View File

@@ -0,0 +1,18 @@
import config
if config.PLATFORM == 'raspberry':
from birbnetes_iot_platform_raspberry import BirbnetesIoTPlatformStatusDriver, BirbnetesIoTPlatformRecordDriver, \
BirbnetesIoTPlatformPlaybackDriver
elif config.PLATFORM == 'emulator':
from birbnetes_iot_platform_emulator import BirbnetesIoTPlatformStatusDriver, BirbnetesIoTPlatformRecordDriver, \
BirbnetesIoTPlatformPlaybackDriver
else:
raise ModuleNotFoundError(f"Could not load platform driver for {config.PLATFORM}")
__all__ = [
'BirbnetesIoTPlatformStatusDriver',
'BirbnetesIoTPlatformRecordDriver',
'BirbnetesIoTPlatformPlaybackDriver'
]