Update google-nest-sdm to 3.0.2#99175
Conversation
janiversen
left a comment
There was a problem hiding this comment.
Looks good, with one small suggestion.
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Co-authored-by: jan iversen <jancasacondor@gmail.com>
|
Ahh, just saw it's platinum so I will let you do the merge. |
| # 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) |
There was a problem hiding this comment.
None is the default value returned if the key is missing in the dict. We can remove the second parameter.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Yes, I read it, please remove the second parameter. There's no confusion since the function can take two different parameters, with different meaning.
There was a problem hiding this comment.
Alternatively go with the other suggestion:
if self._device.type is None:
return None
return DEVICE_TYPE_MAP.get(self._device.type)
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
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.To help with the load of incoming pull requests: