mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-19 04:37:51 -06:00
Don't use deprecated 'address' property of ServiceInfo
It's been replaced by 'addresses'. In the newest Zeroconf version, 'address' has been removed entirely. Contributes to issue CURA-7501.
This commit is contained in:
parent
ef1952f34c
commit
cfccf94914
1 changed files with 4 additions and 4 deletions
|
@ -129,20 +129,20 @@ class ZeroConfClient:
|
||||||
|
|
||||||
for record in zero_conf.cache.entries_with_name(info.server):
|
for record in zero_conf.cache.entries_with_name(info.server):
|
||||||
info.update_record(zero_conf, time(), record)
|
info.update_record(zero_conf, time(), record)
|
||||||
if info.address:
|
if info.addresses:
|
||||||
break
|
break
|
||||||
|
|
||||||
# Request more data if info is not complete
|
# Request more data if info is not complete
|
||||||
if not info.address:
|
if not info.addresses:
|
||||||
new_info = zero_conf.get_service_info(service_type, name)
|
new_info = zero_conf.get_service_info(service_type, name)
|
||||||
if new_info is not None:
|
if new_info is not None:
|
||||||
info = new_info
|
info = new_info
|
||||||
|
|
||||||
if info and info.address:
|
if info and info.addresses:
|
||||||
type_of_device = info.properties.get(b"type", None)
|
type_of_device = info.properties.get(b"type", None)
|
||||||
if type_of_device:
|
if type_of_device:
|
||||||
if type_of_device == b"printer":
|
if type_of_device == b"printer":
|
||||||
address = '.'.join(map(str, info.address))
|
address = '.'.join(map(str, info.addresses[0]))
|
||||||
self.addedNetworkCluster.emit(str(name), address, info.properties)
|
self.addedNetworkCluster.emit(str(name), address, info.properties)
|
||||||
else:
|
else:
|
||||||
Logger.log("w", "The type of the found device is '%s', not 'printer'." % type_of_device)
|
Logger.log("w", "The type of the found device is '%s', not 'printer'." % type_of_device)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue