fix: agebd
Deploy / deploy (push) Successful in 1s

This commit is contained in:
Benjamin Labrecque
2026-07-15 15:32:10 +02:00
parent c1250639e4
commit bfb817a0d5
+29 -29
View File
@@ -8,35 +8,6 @@ from agebd.enums import AGEBD_ENV
from agebd.utils import get_env
def get_pv_class() -> Type[PVLink]:
"""
PV Factory for LOCAL, DEV, and PROD modes
"""
env = get_env()
if env == AGEBD_ENV.PROD:
return PVLink
elif env == AGEBD_ENV.DEV:
return DevPVLink
else:
return LocalPVLink
# TODO: naming (external?)
def get_pv_external_class() -> Type[PVLink]:
"""
TODO: PV Factory for PV that is read from other services/...
TODO: do we never write to these? maybe name it readonly...
Always read from prod, unless local.
"""
env = get_env()
if env == AGEBD_ENV.LOCAL:
return LocalPVLink
return PVLink
class PVLink:
def __init__(self, pvname, **kwargs):
self.link = self.connect(pvname, **kwargs)
@@ -175,3 +146,32 @@ class LocalPVLink:
def put(self, val, **kwargs):
self.value = val
self.timestamp = time()
def get_pv_class() -> Type[PVLink]:
"""
PV Factory for LOCAL, DEV, and PROD modes
"""
env = get_env()
if env == AGEBD_ENV.PROD:
return PVLink
elif env == AGEBD_ENV.DEV:
return DevPVLink
else:
return LocalPVLink
# TODO: naming (external?)
def get_pv_external_class() -> Type[PVLink]:
"""
TODO: PV Factory for PV that is read from other services/...
TODO: do we never write to these? maybe name it readonly...
Always read from prod, unless local.
"""
env = get_env()
if env == AGEBD_ENV.LOCAL:
return LocalPVLink
return PVLink