Skip to content

Commit fe05f51

Browse files
authored
Use zeroconf unicast requests (#138)
1 parent f62e163 commit fe05f51

4 files changed

Lines changed: 8 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Defining the system requirements with exact versions typically is difficult. But
1717
* httpx 0.21.0
1818
* protobuf 3.17.3
1919
* segno 1.5.2
20-
* zeroconf 0.36.8
20+
* zeroconf 0.70.0
2121

2222
Other versions and even other operating systems might work. Feel free to tell us about your experience. If you want to run our unit tests, you also need:
2323

devolo_plc_api/device.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,15 @@ def _state_change(self, zeroconf: Zeroconf, service_type: str, name: str, state_
242242
async def _get_service_info(self, zeroconf: Zeroconf, service_type: str, name: str) -> None:
243243
"""Get service information, if IP matches."""
244244
service_info = AsyncServiceInfo(service_type, name)
245-
question_type = DNSQuestionType.QM if self._multicast else DNSQuestionType.QU
246245
update = {
247246
DEVICEAPI: self._get_device_info,
248247
PLCNETAPI: self._get_plcnet_info,
249248
}
250249
with suppress(RuntimeError):
251-
await service_info.async_request(zeroconf, timeout=1000, question_type=question_type)
250+
if not self._multicast:
251+
await service_info.async_request(zeroconf, timeout=1000, question_type=DNSQuestionType.QU, addr=self.ip)
252+
else:
253+
await service_info.async_request(zeroconf, timeout=1000, question_type=DNSQuestionType.QM)
252254

253255
if not service_info.addresses or self.ip not in service_info.parsed_addresses():
254256
return # No need to continue, if there are no relevant service information

docs/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [Unreleased]
7+
## [v1.4.0] - 2023/07/26
88

99
### Added
1010

1111
- Generate QR codes from wifi guest settings
12+
- Make use of zeroconf unicast requests to be able to respond across subnets
1213

1314
## [v1.3.2] - 2023/07/13
1415

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies = [
1818
"httpx>=0.21.0",
1919
"protobuf>=4.22.0",
2020
"segno>=1.5.2",
21-
"zeroconf>=0.32.0",
21+
"zeroconf>=0.70.0",
2222
]
2323
dynamic = [
2424
"version",

0 commit comments

Comments
 (0)