File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 22import dataclasses
33import enum
44import json
5+ import logging
56import os
67from typing import Any , MutableMapping , Self
78
89from enapter import mqtt
910
11+ LOGGER = logging .getLogger (__name__ )
12+
1013
1114@dataclasses .dataclass
1215class Config :
@@ -42,7 +45,15 @@ def from_env(
4245 cls , env : MutableMapping [str , str ] = os .environ , namespace : str = "ENAPTER_"
4346 ) -> Self :
4447 prefix = namespace + "STANDALONE_COMMUNICATION_"
45- blob = env [prefix + "CONFIG" ]
48+ try :
49+ blob = env [namespace + "VUCM_BLOB" ]
50+ LOGGER .warn (
51+ "`%s` is deprecated and will be removed soon. Please use `%s`." ,
52+ namespace + "VUCM_BLOB" ,
53+ prefix + "CONFIG" ,
54+ )
55+ except KeyError :
56+ blob = env [prefix + "CONFIG" ]
4657 config = cls .from_blob (blob )
4758 override_mqtt_host = env .get (prefix + "OVERRIDE_MQTT_HOST" )
4859 if override_mqtt_host is not None :
You can’t perform that action at this time.
0 commit comments