This repository has been archived by the owner on Aug 15, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
This is the second part of my proposal to reduce HA log cluttering.
This PR is rather 'intensive' on the code and I'll try to explain the rationale and the coding choices:
async_setup_entry
) has received a different approach (the logic was a bit remanaged) so to return more specific exceptions to HA core in order to let it manage the problem (by either signaling an auth error or in general telling the core to try reload the configuration entry at a later stage)'ViCareEntity'
) in order to use a single point of entry for theentity->update()
call and put the exception logic there. It was straightful enough since the exceptions blocks in all the implementations were the same. Then, the need to trap exceptions in other parts of the code suggested me a different approach based off context managers and that became the solution but the common super class was a nice idea (in my opinion - very personal declination). Now it still implements the single point of entry for the update() call in every entity even if rather simple but can provide other common behaviors (just theentity->device_info()
right now)