Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
HomeAssistant
Core
Commits
13dfd27b
Unverified
Commit
13dfd27b
authored
3 weeks ago
by
Martin Hjelmare
Committed by
GitHub
3 weeks ago
Browse files
Options
Downloads
Patches
Plain Diff
Clean Home Connect error handling (#139817)
parent
1fb02944
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
homeassistant/components/home_connect/coordinator.py
+5
-13
5 additions, 13 deletions
homeassistant/components/home_connect/coordinator.py
homeassistant/components/home_connect/utils.py
+2
-6
2 additions, 6 deletions
homeassistant/components/home_connect/utils.py
with
7 additions
and
19 deletions
homeassistant/components/home_connect/coordinator.py
+
5
−
13
View file @
13dfd27b
...
@@ -266,7 +266,7 @@ class HomeConnectCoordinator(
...
@@ -266,7 +266,7 @@ class HomeConnectCoordinator(
_LOGGER
.
debug
(
_LOGGER
.
debug
(
"
Non-breaking error (%s) while listening for events,
"
"
Non-breaking error (%s) while listening for events,
"
"
continuing in %s seconds
"
,
"
continuing in %s seconds
"
,
type
(
error
).
__name__
,
error
,
retry_time
,
retry_time
,
)
)
await
asyncio
.
sleep
(
retry_time
)
await
asyncio
.
sleep
(
retry_time
)
...
@@ -343,9 +343,7 @@ class HomeConnectCoordinator(
...
@@ -343,9 +343,7 @@ class HomeConnectCoordinator(
_LOGGER
.
debug
(
_LOGGER
.
debug
(
"
Error fetching settings for %s: %s
"
,
"
Error fetching settings for %s: %s
"
,
appliance
.
ha_id
,
appliance
.
ha_id
,
error
error
,
if
isinstance
(
error
,
HomeConnectApiError
)
else
type
(
error
).
__name__
,
)
)
settings
=
{}
settings
=
{}
try
:
try
:
...
@@ -357,9 +355,7 @@ class HomeConnectCoordinator(
...
@@ -357,9 +355,7 @@ class HomeConnectCoordinator(
_LOGGER
.
debug
(
_LOGGER
.
debug
(
"
Error fetching status for %s: %s
"
,
"
Error fetching status for %s: %s
"
,
appliance
.
ha_id
,
appliance
.
ha_id
,
error
error
,
if
isinstance
(
error
,
HomeConnectApiError
)
else
type
(
error
).
__name__
,
)
)
status
=
{}
status
=
{}
...
@@ -373,9 +369,7 @@ class HomeConnectCoordinator(
...
@@ -373,9 +369,7 @@ class HomeConnectCoordinator(
_LOGGER
.
debug
(
_LOGGER
.
debug
(
"
Error fetching programs for %s: %s
"
,
"
Error fetching programs for %s: %s
"
,
appliance
.
ha_id
,
appliance
.
ha_id
,
error
error
,
if
isinstance
(
error
,
HomeConnectApiError
)
else
type
(
error
).
__name__
,
)
)
else
:
else
:
programs
.
extend
(
all_programs
.
programs
)
programs
.
extend
(
all_programs
.
programs
)
...
@@ -465,9 +459,7 @@ class HomeConnectCoordinator(
...
@@ -465,9 +459,7 @@ class HomeConnectCoordinator(
_LOGGER
.
debug
(
_LOGGER
.
debug
(
"
Error fetching options for %s: %s
"
,
"
Error fetching options for %s: %s
"
,
ha_id
,
ha_id
,
error
error
,
if
isinstance
(
error
,
HomeConnectApiError
)
else
type
(
error
).
__name__
,
)
)
return
{}
return
{}
...
...
This diff is collapsed.
Click to expand it.
homeassistant/components/home_connect/utils.py
+
2
−
6
View file @
13dfd27b
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
re
import
re
from
aiohomeconnect.model.error
import
HomeConnectApiError
,
HomeConnectError
from
aiohomeconnect.model.error
import
HomeConnectError
RE_CAMEL_CASE
=
re
.
compile
(
r
"
(?<!^)(?=[A-Z])|(?=\d)(?<=\D)
"
)
RE_CAMEL_CASE
=
re
.
compile
(
r
"
(?<!^)(?=[A-Z])|(?=\d)(?<=\D)
"
)
...
@@ -11,11 +11,7 @@ def get_dict_from_home_connect_error(
...
@@ -11,11 +11,7 @@ def get_dict_from_home_connect_error(
err
:
HomeConnectError
,
err
:
HomeConnectError
,
)
->
dict
[
str
,
str
]:
)
->
dict
[
str
,
str
]:
"""
Return a translation string from a Home Connect error.
"""
"""
Return a translation string from a Home Connect error.
"""
return
{
return
{
"
error
"
:
str
(
err
)}
"
error
"
:
str
(
err
)
if
isinstance
(
err
,
HomeConnectApiError
)
else
type
(
err
).
__name__
}
def
bsh_key_to_translation_key
(
bsh_key
:
str
)
->
str
:
def
bsh_key_to_translation_key
(
bsh_key
:
str
)
->
str
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment