Fix Monoprice robustness#33869
Conversation
| state = self._monoprice.zone_status(self._zone_id) | ||
| except SerialException: | ||
| _LOGGER.warning("Could not update zone %d", self._zone_id) | ||
| return False |
There was a problem hiding this comment.
I'm not too happy with this - ideally I would have raised an UpdateFailed here. However, since this is not actually an error for Zones that aren't connected, there are two negative side effects to raising here:
- The logs contain an error
- The entities are never created (instead of created and disabled)
There was a problem hiding this comment.
Nothing is checking the return value of update. Please remove those and just return where needed.
|
Should we tag it for a patch release? |
|
I believe we should |
|
Not sure why codecov is showing a diff hit - I added a test for the new code, and the "Coverage Changes" tab is showing a file from a different integration (Yamaha) |
|
If we add a test for this case, codecov will pass: |
* Silently handle update failures * Limite parallel updates * Remove return values * Remove trailing return * Add test for empty update
Proposed change
A couple of Monoprice robustness fixes:
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.The integration reached or maintains the following Integration Quality Scale: