updated lovelace dashboards and migrate tcp sensors to use serial component with SOCAT
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
"""Register info websocket commands."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from homeassistant.components import websocket_api
|
||||
from homeassistant.core import HomeAssistant
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
import voluptuous as vol
|
||||
|
||||
@@ -15,6 +15,8 @@ from ..const import DOMAIN
|
||||
from ..enums import HacsDispatchEvent
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from ..base import HacsBase
|
||||
|
||||
|
||||
@@ -30,7 +32,7 @@ async def hacs_repositories_list(
|
||||
hass: HomeAssistant,
|
||||
connection: websocket_api.ActiveConnection,
|
||||
msg: dict[str, Any],
|
||||
):
|
||||
) -> None:
|
||||
"""List repositories."""
|
||||
hacs: HacsBase = hass.data.get(DOMAIN)
|
||||
connection.send_message(
|
||||
@@ -68,7 +70,7 @@ async def hacs_repositories_list(
|
||||
for repo in hacs.repositories.list_all
|
||||
if repo.data.category in msg.get("categories", hacs.common.categories)
|
||||
and not repo.ignored_by_country_configuration
|
||||
and (not hacs.configuration.experimental or repo.data.last_fetched)
|
||||
and repo.data.last_fetched
|
||||
],
|
||||
)
|
||||
)
|
||||
@@ -88,7 +90,7 @@ async def hacs_repositories_clear_new(
|
||||
connection: websocket_api.ActiveConnection,
|
||||
msg: dict[str, Any],
|
||||
) -> None:
|
||||
"""Clear new repositories for spesific categories."""
|
||||
"""Clear new repositories for specific categories."""
|
||||
hacs: HacsBase = hass.data.get(DOMAIN)
|
||||
|
||||
if repo := msg.get("repository"):
|
||||
@@ -119,7 +121,7 @@ async def hacs_repositories_removed(
|
||||
hass: HomeAssistant,
|
||||
connection: websocket_api.ActiveConnection,
|
||||
msg: dict[str, Any],
|
||||
):
|
||||
) -> None:
|
||||
"""Get information about removed repositories."""
|
||||
hacs: HacsBase = hass.data.get(DOMAIN)
|
||||
content = []
|
||||
@@ -142,7 +144,7 @@ async def hacs_repositories_add(
|
||||
hass: HomeAssistant,
|
||||
connection: websocket_api.ActiveConnection,
|
||||
msg: dict[str, Any],
|
||||
):
|
||||
) -> None:
|
||||
"""Add custom repositoriy."""
|
||||
hacs: HacsBase = hass.data.get(DOMAIN)
|
||||
repository = regex.extract_repository_from_url(msg["repository"])
|
||||
@@ -203,7 +205,7 @@ async def hacs_repositories_remove(
|
||||
hass: HomeAssistant,
|
||||
connection: websocket_api.ActiveConnection,
|
||||
msg: dict[str, Any],
|
||||
):
|
||||
) -> None:
|
||||
"""Remove custom repositoriy."""
|
||||
hacs: HacsBase = hass.data.get(DOMAIN)
|
||||
repository = hacs.repositories.get_by_id(msg["repository"])
|
||||
|
||||
Reference in New Issue
Block a user