Wrap hc_login module logic to a main function

This commit is contained in:
2024-11-21 14:10:01 +01:00
parent f77d2a6efa
commit e553adc033
2 changed files with 275 additions and 272 deletions

View File

@@ -20,5 +20,5 @@ dependencies = [
]
[project.scripts]
hc-login = "hcpy:hc_login"
hc-login = "hcpy.hc_login:main"
hc2mqtt = "hcpy.hc2mqtt:hc2mqtt"

View File

@@ -31,7 +31,7 @@ from hcpy.HCxml2json import xml2json
# requests_log.setLevel(logging.DEBUG)
# requests_log.propagate = True
def main():
def debug(*args):
print(*args, file=sys.stderr)
@@ -323,3 +323,6 @@ print(
+ devicefile
+ ", if needed, and run hc2mqtt.py or start Home Assistant addon again"
)
if __name__ == "__main__":
main()