Skip to content

Commit

Permalink
Fix debug page link on new Hass versions
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Sep 2, 2022
1 parent 93f0ce0 commit fdd68a2
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 19 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ Devices in DIY mode can be used without ewelink credentials because their protoc

### Debug page

A link to the debug page can be found on the [System Health page](https://my.home-assistant.io/redirect/system_health/). Debug page shows only Integration logs and removes all private data. You can filter log and enable auto refresh (in seconds).
Enable debug page in integration options. Reload integrations page. Open: Integraion > Menu > Known issues.

Debug page shows only integration logs and removes some private data. You can filter log and enable auto refresh (in seconds).

```
http://192.168.1.123:8123/api/sonoff/c8503fee-88fb-4a18-84d9-abb782bf0aa7?q=1000xxxxxx&r=2
Expand Down
8 changes: 2 additions & 6 deletions custom_components/sonoff/system_health.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from collections import deque
from datetime import datetime
from logging import Logger
from typing import Any

from aiohttp import web
from homeassistant.components import system_health
Expand Down Expand Up @@ -47,11 +46,6 @@ async def system_health_info(hass: HomeAssistant):
"local_online": f"{local_online} / {local_total}",
}

if DebugView.url:
info["debug"] = {
"type": "failed", "error": "", "more_info": DebugView.url
}

return info


Expand All @@ -64,6 +58,8 @@ async def setup_debug(hass: HomeAssistant, logger: Logger):
info[DOMAIN + "_version"] = f"{integration.version} ({source_hash()})"
logger.debug(f"SysInfo: {info}")

integration.manifest["issue_tracker"] = view.url


class DebugView(logging.Handler, HomeAssistantView):
"""Class generate web page with component debug logs."""
Expand Down
5 changes: 2 additions & 3 deletions custom_components/sonoff/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"data": {
"mode": "Mode (auto is recommended for most users)",
"homes": "Homes (leave unchecked for \"current\" Home)",
"debug": "Debug page (Configuration > System Health)"
"debug": "Debug page (Integration > Menu > Known issues)"
}
}
}
Expand All @@ -29,8 +29,7 @@
"info": {
"version": "Version",
"cloud_online": "Cloud devices online",
"local_online": "Local devices online",
"debug": "Debug page"
"local_online": "Local devices online"
}
}
}
5 changes: 2 additions & 3 deletions custom_components/sonoff/translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"data": {
"mode": "Tryb (auto jest rekomendowany dla większości użytkowników)",
"homes": "Domy (pozostaw nie zaznaczone dla \"obecnego\")",
"debug": "Strona debugowania (Konfiguracja > System > Kondycja systemu"
"debug": "Strona debugowania (Integracja > Menu > Znane problemy)"
}
}
}
Expand All @@ -29,8 +29,7 @@
"info": {
"version": "Wersja",
"cloud_online": "Urządzenie chmurowe online",
"local_online": "Urzadzenia lokalne online",
"debug": "Strona debugowania"
"local_online": "Urzadzenia lokalne online"
}
}
}
5 changes: 2 additions & 3 deletions custom_components/sonoff/translations/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"data": {
"mode": "Modo (automático é recomendado para a maioria dos usuários)",
"homes": "Casas (deixe desmarcado para Casa \"atual\")",
"debug": "Página de depuração (Configuração > Opções > Informações)"
"debug": "Página de depuração (Integração > Menus > Problemas conhecidos)"
}
}
}
Expand All @@ -29,8 +29,7 @@
"info": {
"version": "Versão",
"cloud_online": "Dispositivos de nuvem online",
"local_online": "Dispositivos locais online",
"debug": "Página de depuração"
"local_online": "Dispositivos locais online"
}
}
}
5 changes: 2 additions & 3 deletions custom_components/sonoff/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"data": {
"mode": "Режим (auto рекомендуется для большинства пользователей)",
"homes": "Дома (оставьте невыбранными для \"текущего\" дома)",
"debug": "Debug страница (Конфигурация > Статус системы)"
"debug": "Debug страница (Интеграция > Меню > Известные проблемы)"
}
}
}
Expand All @@ -29,8 +29,7 @@
"info": {
"version": "Версия",
"cloud_online": "Доступные облачные устройства",
"local_online": "Доступные локальные устройства",
"debug": "Debug страница"
"local_online": "Доступные локальные устройства"
}
}
}

0 comments on commit fdd68a2

Please sign in to comment.