Skip to content
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
9 changes: 5 additions & 4 deletions homeassistant/components/zeroconf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def update_record(self, zc: "Zeroconf", now: float, record: DNSRecord) -> None:
# To avoid overwhemling the system we pre-filter here and only process
# DNSPointers for the configured record name (type)
#
if record.name != self.type or not isinstance(record, DNSPointer):
if record.name not in self.types or not isinstance(record, DNSPointer):
return
super().update_record(zc, now, record)

Expand Down Expand Up @@ -224,11 +224,12 @@ def service_update(zeroconf, service_type, name, state_change):
)
)

for service in ZEROCONF:
HaServiceBrowser(zeroconf, service, handlers=[service_update])
types = list(ZEROCONF)

if HOMEKIT_TYPE not in ZEROCONF:
HaServiceBrowser(zeroconf, HOMEKIT_TYPE, handlers=[service_update])
types.append(HOMEKIT_TYPE)

HaServiceBrowser(zeroconf, types, handlers=[service_update])

return True

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/zeroconf/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"domain": "zeroconf",
"name": "Zero-configuration networking (zeroconf)",
"documentation": "https://www.home-assistant.io/integrations/zeroconf",
"requirements": ["zeroconf==0.26.1"],
"requirements": ["zeroconf==0.26.2"],
"dependencies": ["api"],
"codeowners": ["@robbiet480", "@Kane610"],
"quality_scale": "internal"
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/package_constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ruamel.yaml==0.15.100
sqlalchemy==1.3.17
voluptuous-serialize==2.3.0
voluptuous==0.11.7
zeroconf==0.26.1
zeroconf==0.26.2

pycryptodome>=3.6.6

Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2239,7 +2239,7 @@ youtube_dl==2020.05.08
zengge==0.2

# homeassistant.components.zeroconf
zeroconf==0.26.1
zeroconf==0.26.2

# homeassistant.components.zha
zha-quirks==0.0.39
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ xmltodict==0.12.0
ya_ma==0.3.8

# homeassistant.components.zeroconf
zeroconf==0.26.1
zeroconf==0.26.2

# homeassistant.components.zha
zha-quirks==0.0.39
Expand Down
7 changes: 4 additions & 3 deletions tests/components/zeroconf/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ def mock_zeroconf():
yield mock_zc.return_value


def service_update_mock(zeroconf, service, handlers):
def service_update_mock(zeroconf, services, handlers):
"""Call service update handler."""
handlers[0](zeroconf, service, f"name.{service}", ServiceStateChange.Added)
for service in services:
handlers[0](zeroconf, service, f"name.{service}", ServiceStateChange.Added)


def get_service_info_mock(service_type, name):
Expand Down Expand Up @@ -76,7 +77,7 @@ async def test_setup(hass, mock_zeroconf):
mock_zeroconf.get_service_info.side_effect = get_service_info_mock
assert await async_setup_component(hass, zeroconf.DOMAIN, {zeroconf.DOMAIN: {}})

assert len(mock_service_browser.mock_calls) == len(zc_gen.ZEROCONF)
assert len(mock_service_browser.mock_calls) == 1
expected_flow_calls = 0
for matching_components in zc_gen.ZEROCONF.values():
expected_flow_calls += len(matching_components)
Expand Down