-
-
Notifications
You must be signed in to change notification settings - Fork 28.9k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve nest setup error handling #44385
Improve nest setup error handling #44385
Conversation
4db359b
to
b1a2f87
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Very new here, just submitted my first PR, so bear with me if I suggest pointless changes.
I just have two minor suggestions, the rest looks good to me.
Ready for another look. |
121bfd3
to
a03159b
Compare
@@ -183,19 +190,40 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): | |||
data=entry.data, | |||
) | |||
) | |||
except ConfigurationException as err: | |||
persistent_notification.async_create( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We prefer to not add integration specific notifications. We can consider adding a common default notification on entry setup failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I will update this to just log errors for now then. My real goal here is to move up the integration quality scale and meet the criteria of "Log a warning once when unavailable, log once when reconnected" from https://developers.home-assistant.io/docs/integration_quality_scale_index/#silver-%F0%9F%A5%88
(1) I will think more about default notifications. I imagine that will take more thought and feedback to work through to understand the existing preferences. What is the best forum for getting feedback on a "design" for that? Wasn't clear if this rises to the level of ADR, or just a PR, and my assumption is that discussing over code review may be too low level.
(2) What is the recommended way to handle logging once? The approach i've commonly seen is to store global state in hass.data to track this (or via some wrapper class stored in hass.data), but wanted to ask before adding that, as it is not super satisfying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- We can open an architecture issue and/or post the question on discord.
- Yeah, store a boolean somewhere and use it to check if we've already logged.
This is meant to make the nest integration quieter. Exceptions are handled by showing notifications to the user with additional error detail.
Co-authored-by: j-stienstra <65826735+j-stienstra@users.noreply.github.com>
e5812f4
to
df17e3b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Maybe update the PR description? |
Done. |
* 'dev' of https://github.com/home-assistant/core: Fix Tasmota device triggers (home-assistant#44574) Improve nest setup error handling (home-assistant#44385) Tado: add full list of devices (home-assistant#44475) Simplify nest event handling (home-assistant#44367) Add explicit support for Luxembourg Smarty meter in dsmr integration (home-assistant#43975) Fully remove Avri integration (home-assistant#44478) Add Olivia voice to Amazon Polly TTS (home-assistant#44513) Bump pydeconz to version 77 (home-assistant#44514) Add album art support in the mpd component (home-assistant#44527) Fix falsey comparisons in NWS weather (home-assistant#44486) Upgrade huawei-lte-api to 1.4.17 (home-assistant#44499) Update README.rst to avoid redirects (home-assistant#44519) Handle missing Somfy devices during update (home-assistant#44425) Convert mpd component to use the async MPDClient (home-assistant#44384) Bump pywemo to 0.5.6 (home-assistant#44440) Support auto as Dyson fan on device state (home-assistant#44472) [ci skip] Translation update Remove useless async_add_executor_job (home-assistant#44496) Fix the docstring in type_fans.py (home-assistant#44511)
Proposed change
Make the nest integration handle errors a bit cleaner by logging once to error logs. This is meant to make the nest integration quieter, as one of the last remaining items on the silver integration quality scale.
Type of change
Additional information
allenporter/python-google-nest-sdm@v0.2.1...v0.2.2
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:
To help with the load of incoming pull requests: