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
c8612597
Unverified
Commit
c8612597
authored
2 years ago
by
Erik Montnemery
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Hide inactive repairs issues (#75556)
parent
46551a50
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/repairs/websocket_api.py
+1
-0
1 addition, 0 deletions
homeassistant/components/repairs/websocket_api.py
tests/components/repairs/test_websocket_api.py
+22
-2
22 additions, 2 deletions
tests/components/repairs/test_websocket_api.py
with
23 additions
and
2 deletions
homeassistant/components/repairs/websocket_api.py
+
1
−
0
View file @
c8612597
...
...
@@ -73,6 +73,7 @@ def ws_list_issues(
issues
=
[
dataclasses
.
asdict
(
issue
,
dict_factory
=
ws_dict
)
for
issue
in
issue_registry
.
issues
.
values
()
if
issue
.
active
]
connection
.
send_result
(
msg
[
"
id
"
],
{
"
issues
"
:
issues
})
...
...
This diff is collapsed.
Click to expand it.
tests/components/repairs/test_websocket_api.py
+
22
−
2
View file @
c8612597
...
...
@@ -9,7 +9,11 @@ import pytest
import
voluptuous
as
vol
from
homeassistant
import
data_entry_flow
from
homeassistant.components.repairs
import
RepairsFlow
,
async_create_issue
from
homeassistant.components.repairs
import
(
RepairsFlow
,
async_create_issue
,
issue_registry
,
)
from
homeassistant.components.repairs.const
import
DOMAIN
from
homeassistant.const
import
__version__
as
ha_version
from
homeassistant.core
import
HomeAssistant
...
...
@@ -366,8 +370,24 @@ async def test_step_unauth(
@freeze_time
(
"
2022-07-19 07:53:05
"
)
async
def
test_list_issues
(
hass
:
HomeAssistant
,
hass_ws_client
)
->
None
:
async
def
test_list_issues
(
hass
:
HomeAssistant
,
hass_storage
,
hass_ws_client
)
->
None
:
"""
Test we can list issues.
"""
# Add an inactive issue, this should not be exposed in the list
hass_storage
[
issue_registry
.
STORAGE_KEY
]
=
{
"
version
"
:
issue_registry
.
STORAGE_VERSION
,
"
data
"
:
{
"
issues
"
:
[
{
"
created
"
:
"
2022-07-19T09:41:13.746514+00:00
"
,
"
dismissed_version
"
:
None
,
"
domain
"
:
"
test
"
,
"
issue_id
"
:
"
issue_3_inactive
"
,
},
]
},
}
assert
await
async_setup_component
(
hass
,
DOMAIN
,
{})
client
=
await
hass_ws_client
(
hass
)
...
...
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