Explorar el Código

Utils: revert change to use relative imports

Unless the path is not properly set up, relative paths cause error.
Since we don't have HomeAssistant properly setting things up in the
dev environment for command line utils, using absolute paths is more
resilient.
Jason Rumney hace 1 año
padre
commit
221b883e41
Se han modificado 4 ficheros con 4 adiciones y 8 borrados
  1. 1 2
      util/best_match.py
  2. 1 2
      util/config_match.py
  3. 1 2
      util/duplicates.py
  4. 1 2
      util/match_against.py

+ 1 - 2
util/best_match.py

@@ -3,10 +3,9 @@
 import json
 import json
 import sys
 import sys
 
 
+from common_funcs import FakeDevice
 from custom_components.tuya_local.helpers.device_config import possible_matches
 from custom_components.tuya_local.helpers.device_config import possible_matches
 
 
-from .common_funcs import FakeDevice
-
 
 
 def main() -> int:
 def main() -> int:
     dps = json.loads(" ".join(sys.argv[1:]))
     dps = json.loads(" ".join(sys.argv[1:]))

+ 1 - 2
util/config_match.py

@@ -3,10 +3,9 @@
 import json
 import json
 import sys
 import sys
 
 
+from common_funcs import FakeDevice
 from custom_components.tuya_local.helpers.device_config import possible_matches
 from custom_components.tuya_local.helpers.device_config import possible_matches
 
 
-from .common_funcs import FakeDevice
-
 
 
 def main() -> int:
 def main() -> int:
     dps = json.loads(" ".join(sys.argv[1:]))
     dps = json.loads(" ".join(sys.argv[1:]))

+ 1 - 2
util/duplicates.py

@@ -2,10 +2,9 @@
 
 
 import sys
 import sys
 
 
+from common_funcs import load_config, make_sample_dps
 from custom_components.tuya_local.helpers.device_config import possible_matches
 from custom_components.tuya_local.helpers.device_config import possible_matches
 
 
-from .common_funcs import load_config, make_sample_dps
-
 
 
 def main():
 def main():
     for filename in sys.argv[1:]:
     for filename in sys.argv[1:]:

+ 1 - 2
util/match_against.py

@@ -3,10 +3,9 @@
 import json
 import json
 import sys
 import sys
 
 
+from common_funcs import FakeDevice, load_config
 from custom_components.tuya_local.helpers.device_config import _typematch
 from custom_components.tuya_local.helpers.device_config import _typematch
 
 
-from .common_funcs import FakeDevice, load_config
-
 
 
 def main() -> int:
 def main() -> int:
     dps = json.loads(" ".join(sys.argv[2:]))
     dps = json.loads(" ".join(sys.argv[2:]))