소스 검색

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 1 년 전
부모
커밋
221b883e41
4개의 변경된 파일4개의 추가작업 그리고 8개의 파일을 삭제
  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:]))