Skip to content

Commit

Permalink
Add filter for clear_new
Browse files Browse the repository at this point in the history
Closes #1293
  • Loading branch information
ludeeus committed Jun 6, 2020
1 parent 5111301 commit 7439e17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/hacs/ws_api_handlers.py
Expand Up @@ -31,7 +31,7 @@ async def setup_ws_api(hass):
{
vol.Required("type"): "hacs/settings",
vol.Optional("action"): cv.string,
vol.Optional("category"): cv.string,
vol.Optional("categories"): cv.ensure_list,
}
)
async def hacs_settings(hass, connection, msg):
Expand Down Expand Up @@ -70,7 +70,7 @@ async def hacs_settings(hass, connection, msg):

elif action == "clear_new":
for repo in hacs.repositories:
if repo.data.new:
if repo.data.new and repo.category in msg.get("categories", []):
hacs.logger.debug(f"Clearing new flag from '{repo.data.full_name}'")
repo.data.new = False
else:
Expand Down

0 comments on commit 7439e17

Please sign in to comment.