Skip to content

Commit

Permalink
Automatically detect dashboard changes (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Jun 2, 2023
1 parent 98ccc0a commit 344f4c4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
from typing import TYPE_CHECKING, Any

from homeassistant.components.lovelace import DOMAIN
from homeassistant.components.lovelace.const import ConfigNotFound
from homeassistant.components.lovelace.const import (
EVENT_LOVELACE_UPDATED,
ConfigNotFound,
)
from homeassistant.config_entries import SIGNAL_CONFIG_ENTRY_CHANGED, ConfigEntry
from homeassistant.const import (
ENTITY_MATCH_ALL,
Expand Down Expand Up @@ -33,6 +36,7 @@ class SpookRepair(AbstractSpookRepair):
repair = "lovelace_unknown_entity_references"
events = {
EVENT_COMPONENT_LOADED,
EVENT_LOVELACE_UPDATED,
er.EVENT_ENTITY_REGISTRY_UPDATED,
"event_counter_reloaded",
"event_derivative_reloaded",
Expand Down Expand Up @@ -132,7 +136,6 @@ async def async_inspect(self) -> None:
"dashboard": title,
"edit": f"/{url_path}/0?edit=1",
},
is_fixable=True,
)
LOGGER.debug(
(
Expand Down
9 changes: 1 addition & 8 deletions custom_components/spook/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,7 @@
},
"lovelace_unknown_entity_references": {
"title": "Unbekannte Entitäten verwendet in: {dashboard}",
"fix_flow": {
"step": {
"confirm": {
"title": "Unbekannte Entitäten verwendet in: {dashboard}",
"description": "Spook hat einen Geist in deinen Dashboards gefunden 👻\n\nBeim Herumschweben begegnete Spook dem folgenden Dashboard:\n\n[{dashboard}]({edit})\n\nDieses Dashboard verweist auf die folgenden Entitäten, die Home Assistant unbekannt sind:\n\n{entities}\n\n\n\nUm diesen Fehler zu beheben, [bearbeite das Dashboard]({edit}) und entferne die Verwendung dieser nicht existierenden Entitäten.\n\nSpook 👻 Nicht dein Kumpel."
}
}
}
"description": "Spook hat einen Geist in deinen Dashboards gefunden 👻\n\nBeim Herumschweben begegnete Spook dem folgenden Dashboard:\n\n[{dashboard}]({edit})\n\nDieses Dashboard verweist auf die folgenden Entitäten, die Home Assistant unbekannt sind:\n\n{entities}\n\n\n\nUm diesen Fehler zu beheben, [bearbeite das Dashboard]({edit}) und entferne die Verwendung dieser nicht existierenden Entitäten.\n\nSpook 👻 Nicht dein Kumpel."
},
"script_unknown_area_references": {
"title": "Unbekannte Bereiche verwendet in: {script}",
Expand Down
9 changes: 1 addition & 8 deletions custom_components/spook/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,7 @@
},
"lovelace_unknown_entity_references": {
"title": "Unknown entities used in: {dashboard}",
"fix_flow": {
"step": {
"confirm": {
"title": "Unknown entities used in: {dashboard}",
"description": "Spook has found a ghost in your dashboards 👻\n\nWhile floating around, Spook crossed path with the following dashboard:\n\n[{dashboard}]({edit})\n\nThis dashboard references the following entities, which are unknown to Home Assistant:\n\n{entities}\n\n\n\nTo fix this error, [edit the dashboard]({edit}) and remove the use of these non-existing entities.\n\nSpook 👻 Not your homie."
}
}
}
"description": "Spook has found a ghost in your dashboards 👻\n\nWhile floating around, Spook crossed path with the following dashboard:\n\n[{dashboard}]({edit})\n\nThis dashboard references the following entities, which are unknown to Home Assistant:\n\n{entities}\n\n\n\nTo fix this error, [edit the dashboard]({edit}) and remove the use of these non-existing entities.\n\nSpook 👻 Not your homie."
},
"script_unknown_area_references": {
"title": "Unknown areas used in: {script}",
Expand Down
9 changes: 1 addition & 8 deletions custom_components/spook/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,7 @@
},
"lovelace_unknown_entity_references": {
"title": "Entités inconnues utilisées dans: {dashboard}",
"fix_flow": {
"step": {
"confirm": {
"title": "Entités inconnues utilisées dans: {dashboard}",
"description": "Spook a trouvé un fantôme dans vos tableaux de bord 👻\n\nEn flottant dans les parages, Spook est tombé sur le tableau de bord suivant :\n\n[{dashboard}]({edit})\n\nCe tableau de bord fait référence aux entitiés suivantes, qui sont inconnues de Home Assistant:\n\n{entities}\n\n\n\nPour résoudre cette erreur, [modifiez le tableau de bord]({edit}) et supprimez l'utilisation de ces entités inexistantes.\n\nSpook 👻 Pas votre ami."
}
}
}
"description": "Spook a trouvé un fantôme dans vos tableaux de bord 👻\n\nEn flottant dans les parages, Spook est tombé sur le tableau de bord suivant :\n\n[{dashboard}]({edit})\n\nCe tableau de bord fait référence aux entitiés suivantes, qui sont inconnues de Home Assistant:\n\n{entities}\n\n\n\nPour résoudre cette erreur, [modifiez le tableau de bord]({edit}) et supprimez l'utilisation de ces entités inexistantes.\n\nSpook 👻 Pas votre ami."
},
"script_unknown_area_references": {
"title": "Pièces inconnues utilisées dans: {script}",
Expand Down

0 comments on commit 344f4c4

Please sign in to comment.