Skip to content

Commit fd10c47

Browse files
committed
vucm: run: add config_prefix kwarg
1 parent b17ac35 commit fd10c47

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

enapter/vucm/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
from .ucm import UCM
77

88

9-
async def run(device_factory):
9+
async def run(device_factory, config_prefix=None):
1010
enapter.log.configure(level=enapter.log.LEVEL or "info")
1111

12-
config = Config.from_env()
12+
config = Config.from_env(prefix=config_prefix)
1313

1414
async with App(config=config, device_factory=device_factory) as app:
1515
await app.join()

enapter/vucm/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77

88
class Config:
99
@classmethod
10-
def from_env(cls, prefix="ENAPTER_VUCM_", env=os.environ):
10+
def from_env(cls, prefix=None, env=os.environ):
11+
if prefix is None:
12+
prefix = "ENAPTER_VUCM_"
1113
try:
1214
blob = os.environ[prefix + "BLOB"]
1315
except KeyError:

0 commit comments

Comments
 (0)