-
Notifications
You must be signed in to change notification settings - Fork 671
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
misc: remove tev dependency for lan control & fixs #333
base: main
Are you sure you want to change the base?
Conversation
continue | ||
lan_device.on_delete() | ||
|
||
def __on_network_info_chnage(self, data: _MIoTLanNetworkUpdateData) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spelling mistakes
_LOGGER.info('no central service, init miot lan') | ||
await self.init_async() | ||
|
||
# The folowing methods SHOULD ONLY be called in the internal loop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spelling mistakes: folowing
return self.__lan_send_cmd( | ||
cmd=MIoTLanCmdType.UNREG_BROADCAST, | ||
data=MIoTLanUnregisterBroadcastData(key=key)) | ||
self._internal_loop.call_soon_threadsafe( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After deinit_async called, the program will stop internal loop and call the lan state change callback. When other services judge that the lan state changed, functions such as unsub_prop may be called, which may lead to RuntimeError.
Why is this change made
Lan and mips uses a python version of tev. Since asyncio is already used in the project, it is better to align the event loop to the same solution.
Changes
Tests
Please help test this in a more complex environment.