Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use zeroconf UUID if not available via IPP properties #33991

Merged
merged 1 commit into from
Apr 10, 2020
Merged

Use zeroconf UUID if not available via IPP properties #33991

merged 1 commit into from
Apr 10, 2020

Conversation

ctalkington
Copy link
Contributor

Breaking change

Proposed change

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

# Example configuration.yaml

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

Comment on lines +119 to +120
if info[CONF_UUID] is not None:
self.discovery_info[CONF_UUID] = info[CONF_UUID]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why only do it sometimes? Are they the same? Could it be that we only detect one at some point and not another, so same printer is identified by 2 unique IDs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so printer manufacturer decide what IPP spec and the device id property is recommended in 2.0 and required in 2.1 but that means the bonjour could provide an UUID but it not be available in the actual IPP data

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So why not always use bonjour ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id have to check specs again but im not sure bonjour definition requires it either. Manufacturers like to play fast and loose with specs.

Copy link
Contributor Author

@ctalkington ctalkington Apr 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so according to IPP Anywhere 1.0 specthe values should match (though thats assuming manufacturer follows spec):

4.2.3.8 UUID
The REQUIRED "UUID" key provides the value of the "printer-uuid" Printer Description
attribute [RFC4122] [PWG 5100.13] without the leading "urn:uuid:". For example, if a
Printer reports a "printer-uuid" value of:
urn:uuid:12345678-9ABC-DEF0-1234-56789ABCDEF0
The "UUID" key will have a value of:
12345678-9ABC-DEF0-1234-56789ABCDEF0
Note: The "printer-uuid" value is used instead of "device-uuid" because DNS-SD identifies
services and not devices.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This printer-uuid property also was added as an extension PWG 5100.13 and isnt part if IPP 2.0,2.1 or 2.2 so that complicates the playing field

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fun 😆

@balloob balloob merged commit de3f5e8 into home-assistant:dev Apr 10, 2020
@balloob balloob added this to the 0.108.3 milestone Apr 10, 2020
@ctalkington ctalkington deleted the ipp-zeroconf-uuid branch April 10, 2020 22:39
@lock lock bot locked and limited conversation to collaborators Apr 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants