Skip to content

Update google-nest-sdm to 3.0.2#99175

Merged
allenporter merged 3 commits intohome-assistant:devfrom
allenporter:bump
Sep 1, 2023
Merged

Update google-nest-sdm to 3.0.2#99175
allenporter merged 3 commits intohome-assistant:devfrom
allenporter:bump

Conversation

@allenporter
Copy link
Copy Markdown
Contributor

Proposed change

This update is a rewrite to use pydantic for parsing server responses, and contains breaking changes to remove a bunch of older APIs (none of which are used by home assistant). Some tests that used incorrect responses have been updated. This has been manually tested with some camera and thermostat devices.

Changelog: allenporter/python-google-nest-sdm@2.2.5...3.0.2

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)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

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
  • I have followed the perfect PR recommendations
  • 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.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

Copy link
Copy Markdown
Member

@janiversen janiversen left a comment

Choose a reason for hiding this comment

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

Looks good, with one small suggestion.

@home-assistant
Copy link
Copy Markdown

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant bot marked this pull request as draft August 28, 2023 07:25
@joostlek joostlek mentioned this pull request Aug 28, 2023
66 tasks
Co-authored-by: jan iversen <jancasacondor@gmail.com>
Copy link
Copy Markdown
Member

@janiversen janiversen left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@janiversen janiversen marked this pull request as ready for review August 29, 2023 06:44
@home-assistant home-assistant bot requested a review from janiversen August 29, 2023 06:44
@janiversen
Copy link
Copy Markdown
Member

Ahh, just saw it's platinum so I will let you do the merge.

@allenporter allenporter merged commit 1539853 into home-assistant:dev Sep 1, 2023
# devices, instead relying on traits, but we can infer a generic model
# name based on the type
return DEVICE_TYPE_MAP.get(self._device.type)
return DEVICE_TYPE_MAP.get(self._device.type or "", None)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

None is the default value returned if the key is missing in the dict. We can remove the second parameter.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That was the original PR, but it was requested to increase readability to make the intent more clear. Want to look at our comment thread and see if you still think this should be removed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, I read it, please remove the second parameter. There's no confusion since the function can take two different parameters, with different meaning.

Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare Sep 2, 2023

Choose a reason for hiding this comment

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

Alternatively go with the other suggestion:

if self._device.type is None:
    return None
return DEVICE_TYPE_MAP.get(self._device.type)

@github-actions github-actions bot locked and limited conversation to collaborators Sep 3, 2023
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