-
-
Notifications
You must be signed in to change notification settings - Fork 37.4k
Fix detection of CPU temperature sensor support on olde FRITZ!Box models #169620
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -117,7 +117,12 @@ | |
| @pytest.mark.usefixtures("entity_registry_enabled_by_default") | ||
| @pytest.mark.parametrize( | ||
| ("side_effect", "return_values"), | ||
| [(RequestException("boom"), None), (None, [0, 0, 0]), (None, [])], | ||
| [ | ||
| (RequestException("boom"), None), | ||
| (None, [0, 0, 0]), | ||
| (None, []), | ||
| (FritzConnectionException("boom"), None), | ||
| ], | ||
|
Comment on lines
118
to
+125
|
||
| ) | ||
| async def test_sensor_cpu_temp_not_supported( | ||
| hass: HomeAssistant, | ||
|
|
@@ -145,7 +150,7 @@ | |
| assert await hass.config_entries.async_setup(entry.entry_id) | ||
| await hass.async_block_till_done() | ||
|
|
||
| await snapshot_platform(hass, entity_registry, snapshot, entry.entry_id) | ||
|
Check failure on line 153 in tests/components/fritz/test_sensor.py
|
||
| assert not entity_registry.async_is_registered( | ||
| "sensor.mock_title_cpu_temperature" | ||
| ) | ||
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.
Handle CPU temperature retrieval failures consistently by also catching the same exceptions in
_retrieve_cpu_temperature_state(e.g.,IndexError/FritzConnectionException) that_is_suitable_cpu_temperaturetreats as "not supported", so an empty/unauthorized response during later updates can’t bubble up and break coordinator updates.