Skip to content

Commit

Permalink
Merge pull request #5 from thopiekar/thopiekar-adding-additional-warn…
Browse files Browse the repository at this point in the history
…ing-message

Adding debug message when type != 'printer'
  • Loading branch information
nallath authored Nov 17, 2016
2 parents bf670d3 + 808417b commit 037e257
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion NetworkPrinterOutputDevicePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,12 @@ def _onServiceChanged(self, zeroconf, service_type, name, state_change):
info = zeroconf.get_service_info(service_type, name)

if info:
if info.properties.get(b"type", None) == b'printer':
type_of_device = info.properties.get(b"type", None).decode("utf-8")
if type_of_device == "printer":
address = '.'.join(map(lambda n: str(n), info.address))
self.addPrinterSignal.emit(str(name), address, info.properties)
else:
Logger.log("w", "The type of the found device is '%s', not 'printer'! Ignoring.." %type_of_device )
else:
Logger.log("w", "Could not get information about %s" % name)

Expand Down

0 comments on commit 037e257

Please sign in to comment.