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
2599faa6
Unverified
Commit
2599faa6
authored
3 months ago
by
Marc Mueller
Committed by
GitHub
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix method subtyping [helpers] (#134213)
parent
3df91cfb
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/core_config.py
+11
-11
11 additions, 11 deletions
homeassistant/core_config.py
homeassistant/helpers/httpx_client.py
+7
-1
7 additions, 1 deletion
homeassistant/helpers/httpx_client.py
with
18 additions
and
12 deletions
homeassistant/core_config.py
+
11
−
11
View file @
2599faa6
...
@@ -509,25 +509,25 @@ class _ComponentSet(set[str]):
...
@@ -509,25 +509,25 @@ class _ComponentSet(set[str]):
self
.
_top_level_components
=
top_level_components
self
.
_top_level_components
=
top_level_components
self
.
_all_components
=
all_components
self
.
_all_components
=
all_components
def
add
(
self
,
component
:
str
)
->
None
:
def
add
(
self
,
value
:
str
)
->
None
:
"""
Add a component to the store.
"""
"""
Add a component to the store.
"""
if
"
.
"
not
in
component
:
if
"
.
"
not
in
value
:
self
.
_top_level_components
.
add
(
component
)
self
.
_top_level_components
.
add
(
value
)
self
.
_all_components
.
add
(
component
)
self
.
_all_components
.
add
(
value
)
else
:
else
:
platform
,
_
,
domain
=
component
.
partition
(
"
.
"
)
platform
,
_
,
domain
=
value
.
partition
(
"
.
"
)
if
domain
in
BASE_PLATFORMS
:
if
domain
in
BASE_PLATFORMS
:
self
.
_all_components
.
add
(
platform
)
self
.
_all_components
.
add
(
platform
)
return
super
().
add
(
component
)
return
super
().
add
(
value
)
def
remove
(
self
,
component
:
str
)
->
None
:
def
remove
(
self
,
value
:
str
)
->
None
:
"""
Remove a component from the store.
"""
"""
Remove a component from the store.
"""
if
"
.
"
in
component
:
if
"
.
"
in
value
:
raise
ValueError
(
"
_ComponentSet does not support removing sub-components
"
)
raise
ValueError
(
"
_ComponentSet does not support removing sub-components
"
)
self
.
_top_level_components
.
remove
(
component
)
self
.
_top_level_components
.
remove
(
value
)
return
super
().
remove
(
component
)
return
super
().
remove
(
value
)
def
discard
(
self
,
component
:
str
)
->
None
:
def
discard
(
self
,
value
:
str
)
->
None
:
"""
Remove a component from the store.
"""
"""
Remove a component from the store.
"""
raise
NotImplementedError
(
"
_ComponentSet does not support discard, use remove
"
)
raise
NotImplementedError
(
"
_ComponentSet does not support discard, use remove
"
)
...
...
This diff is collapsed.
Click to expand it.
homeassistant/helpers/httpx_client.py
+
7
−
1
View file @
2599faa6
...
@@ -4,6 +4,7 @@ from __future__ import annotations
...
@@ -4,6 +4,7 @@ from __future__ import annotations
from
collections.abc
import
Callable
,
Coroutine
from
collections.abc
import
Callable
,
Coroutine
import
sys
import
sys
from
types
import
TracebackType
from
typing
import
Any
,
Self
from
typing
import
Any
,
Self
import
httpx
import
httpx
...
@@ -58,7 +59,12 @@ class HassHttpXAsyncClient(httpx.AsyncClient):
...
@@ -58,7 +59,12 @@ class HassHttpXAsyncClient(httpx.AsyncClient):
"""
Prevent an integration from reopen of the client via context manager.
"""
"""
Prevent an integration from reopen of the client via context manager.
"""
return
self
return
self
async
def
__aexit__
(
self
,
*
args
:
object
)
->
None
:
async
def
__aexit__
(
self
,
exc_type
:
type
[
BaseException
]
|
None
=
None
,
exc_value
:
BaseException
|
None
=
None
,
traceback
:
TracebackType
|
None
=
None
,
)
->
None
:
"""
Prevent an integration from close of the client via context manager.
"""
"""
Prevent an integration from close of the client via context manager.
"""
...
...
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