|
|
@@ -3,13 +3,18 @@
|
|
|
import json
|
|
|
import sys
|
|
|
|
|
|
-from common_funcs import FakeDevice, load_config
|
|
|
+from common_funcs import FakeDevice, load_config, make_sample_dps
|
|
|
|
|
|
from custom_components.tuya_local.helpers.device_config import _typematch
|
|
|
|
|
|
|
|
|
def main() -> int:
|
|
|
- dps = json.loads(" ".join(sys.argv[2:]))
|
|
|
+ rest = " ".join(sys.argv[2:])
|
|
|
+ config = load_config(rest)
|
|
|
+ if config is None:
|
|
|
+ dps = json.loads(rest)
|
|
|
+ else:
|
|
|
+ dps = make_sample_dps(config)
|
|
|
device = FakeDevice(dps)
|
|
|
config = load_config(sys.argv[1])
|
|
|
if config is None:
|