Skip to content

Commit

Permalink
Skip mDNS messages from iHost device
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Apr 16, 2024
1 parent 4f02ea2 commit b238cee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion custom_components/sonoff/core/ewelink/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
decode such messages by itself because it does not manage the list of known
devices and their devicekey.
"""

import asyncio
import base64
import errno
Expand Down Expand Up @@ -97,7 +98,9 @@ def _handler1(
state_change: ServiceStateChange,
):
"""Step 1. Receive change event from zeroconf."""
if state_change == ServiceStateChange.Removed:
# accept: eWeLink_1000xxxxxx.local.
# skip: ihost-1001xxxxxx.local.
if state_change == ServiceStateChange.Removed or not name.startswith("eWeLink"):
return

asyncio.create_task(self._handler2(zeroconf, service_type, name))
Expand Down

0 comments on commit b238cee

Please sign in to comment.