mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-16 17:35:55 +08:00
Fixed small isue where no type was found in zeroconf object
This commit is contained in:
parent
f5ac357824
commit
28a3858bc2
@ -196,12 +196,13 @@ class NetworkPrinterOutputDevicePlugin(OutputDevicePlugin):
|
|||||||
info = zeroconf.get_service_info(service_type, name)
|
info = zeroconf.get_service_info(service_type, name)
|
||||||
|
|
||||||
if info:
|
if info:
|
||||||
type_of_device = info.properties.get(b"type", None).decode("utf-8")
|
type_of_device = info.properties.get(b"type", None)
|
||||||
if type_of_device == "printer":
|
if type_of_device:
|
||||||
address = '.'.join(map(lambda n: str(n), info.address))
|
if type_of_device == b"printer":
|
||||||
self.addPrinterSignal.emit(str(name), address, info.properties)
|
address = '.'.join(map(lambda n: str(n), info.address))
|
||||||
else:
|
self.addPrinterSignal.emit(str(name), address, info.properties)
|
||||||
Logger.log("w", "The type of the found device is '%s', not 'printer'! Ignoring.." %type_of_device )
|
else:
|
||||||
|
Logger.log("w", "The type of the found device is '%s', not 'printer'! Ignoring.." % type_of_device )
|
||||||
else:
|
else:
|
||||||
Logger.log("w", "Could not get information about %s" % name)
|
Logger.log("w", "Could not get information about %s" % name)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user