Wrap hc_login module logic to a main function
This commit is contained in:
@@ -20,5 +20,5 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
hc-login = "hcpy:hc_login"
|
hc-login = "hcpy.hc_login:main"
|
||||||
hc2mqtt = "hcpy.hc2mqtt:hc2mqtt"
|
hc2mqtt = "hcpy.hc2mqtt:hc2mqtt"
|
||||||
@@ -31,7 +31,7 @@ from hcpy.HCxml2json import xml2json
|
|||||||
# requests_log.setLevel(logging.DEBUG)
|
# requests_log.setLevel(logging.DEBUG)
|
||||||
# requests_log.propagate = True
|
# requests_log.propagate = True
|
||||||
|
|
||||||
|
def main():
|
||||||
def debug(*args):
|
def debug(*args):
|
||||||
print(*args, file=sys.stderr)
|
print(*args, file=sys.stderr)
|
||||||
|
|
||||||
@@ -323,3 +323,6 @@ print(
|
|||||||
+ devicefile
|
+ devicefile
|
||||||
+ ", if needed, and run hc2mqtt.py or start Home Assistant addon again"
|
+ ", if needed, and run hc2mqtt.py or start Home Assistant addon again"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user