Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(uat): fix connect bug on windows for python paho client #380

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions uat/custom-components/client-python-paho/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,7 @@ def print_usage(self):

if __name__ == "__main__":
main_object = Main()
if sys.version_info >= (3, 8) and sys.platform.lower().startswith("win"):
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
rc = asyncio.run(main_object.main())
sys.exit(rc)
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def register_connection(self, mqtt_connection: MqttConnection) -> int:
Returns id of connection
"""
while True:
connection_id = self.__connection_id_next
self.__connection_id_next += 1
connection_id = self.__connection_id_next

if connection_id not in self.__connections:
self.__connections[connection_id] = mqtt_connection
Expand Down
Loading