Skip to content

Commit 5f2e84e

Browse files
committed
fix: hacs validation
Signed-off-by: Damian Skrzyński <polprog.tech@gmail.com>
1 parent 798d99a commit 5f2e84e

7 files changed

Lines changed: 21 additions & 13 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# WANPulse
22

33
<p align="center">
4-
<img src="images/logo.svg" alt="WANPulse Logo" width="200" height="200">
4+
<img src="custom_components/wanpulse/brand/icon.png" alt="WANPulse Logo" width="200" height="200">
55
</p>
66

77
<p align="center">
3.13 KB
Loading
4.38 KB
Loading

custom_components/wanpulse/config_flow.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,11 @@ async def async_step_user(
177177
) -> ConfigFlowResult:
178178
"""Handle the initial setup step."""
179179
errors: dict[str, str] = {}
180-
description_placeholders: dict[str, str] = {}
180+
description_placeholders: dict[str, str] = {
181+
"example_tcp": "1.1.1.1, Cloudflare DNS, tcp",
182+
"example_http": "https://www.google.com, Google, http",
183+
"example_dns": "www.google.com, Google DNS, dns",
184+
}
181185

182186
if user_input is not None:
183187
targets_text = user_input.get(CONF_TARGETS, "")
@@ -241,7 +245,11 @@ async def async_step_reconfigure(
241245
return self.async_abort(reason="entry_not_found")
242246

243247
errors: dict[str, str] = {}
244-
description_placeholders: dict[str, str] = {}
248+
description_placeholders: dict[str, str] = {
249+
"example_tcp": "1.1.1.1, Cloudflare DNS, tcp",
250+
"example_http": "https://www.google.com, Google, http",
251+
"example_dns": "www.google.com, Google DNS, dns",
252+
}
245253

246254
if user_input is not None:
247255
targets_text = user_input.get(CONF_TARGETS, "")

custom_components/wanpulse/strings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"step": {
44
"user": {
55
"title": "Set up WANPulse — Internet Monitor",
6-
"description": "WANPulse monitors your internet connection by periodically probing external servers. It measures latency, packet loss, jitter and detects outages.\n\n**Probe targets** — enter one target per line in the format:\n`host, label, method`\n\n- **host** — IP address or hostname to probe (e.g. `1.1.1.1`, `google.com`)\n- **label** — a friendly name shown in Home Assistant (e.g. `Cloudflare`)\n- **method** — probe type: `tcp` (default, recommended), `http`, or `dns`\n\n**Examples:**\n- `1.1.1.1, Cloudflare DNS, tcp` — tests TCP connection to Cloudflare\n- `https://www.google.com, Google, http` — tests HTTP response from Google\n- `www.google.com, Google DNS, dns` — tests DNS resolution for Google",
6+
"description": "WANPulse monitors your internet connection by periodically probing external servers. It measures latency, packet loss, jitter and detects outages.\n\n**Probe targets** — enter one target per line in the format:\nhost, label, method\n\n- **host** — IP address or hostname to probe\n- **label** — a friendly name shown in Home Assistant\n- **method** — probe type: tcp (default, recommended), http, or dns\n\n**Examples:**\n- {example_tcp}\n- {example_http}\n- {example_dns}",
77
"data": {
88
"targets": "Probe targets",
99
"scan_interval": "Scan interval (seconds)"
@@ -15,7 +15,7 @@
1515
},
1616
"reconfigure": {
1717
"title": "Reconfigure WANPulse targets",
18-
"description": "Edit your probe targets. One target per line: `host, label, method`\n\n- **TCP** (recommended) — works with any IP or hostname, tests connection to port 443\n- **HTTP** — provide a full URL, tests HTTP HEAD response\n- **DNS** — provide a hostname, tests DNS resolution time",
18+
"description": "Edit your probe targets. One target per line: host, label, method\n\n- **TCP** (recommended) — works with any IP or hostname, tests connection to port 443\n- **HTTP** — provide a full URL, tests HTTP HEAD response\n- **DNS** — provide a hostname, tests DNS resolution time",
1919
"data": {
2020
"targets": "Probe targets"
2121
},
@@ -25,7 +25,7 @@
2525
}
2626
},
2727
"error": {
28-
"no_targets": "At least one target is required. Enter a host like: 1.1.1.1, Cloudflare, tcp",
28+
"no_targets": "At least one target is required.",
2929
"too_many_targets": "Maximum {max_targets} targets allowed. Remove some targets and try again.",
3030
"invalid_host": "One or more targets have an invalid or empty host field.",
3131
"invalid_host_format": "Invalid host format. Use an IP address, hostname, or full URL depending on probe method.",

custom_components/wanpulse/translations/en.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"step": {
44
"user": {
55
"title": "Set up WANPulse — Internet Monitor",
6-
"description": "WANPulse monitors your internet connection by periodically probing external servers. It measures latency, packet loss, jitter and detects outages.\n\n**Probe targets** — enter one target per line in the format:\n`host, label, method`\n\n- **host** — IP address or hostname to probe (e.g. `1.1.1.1`, `google.com`)\n- **label** — a friendly name shown in Home Assistant (e.g. `Cloudflare`)\n- **method** — probe type: `tcp` (default, recommended), `http`, or `dns`\n\n**Examples:**\n- `1.1.1.1, Cloudflare DNS, tcp` — tests TCP connection to Cloudflare\n- `https://www.google.com, Google, http` — tests HTTP response from Google\n- `www.google.com, Google DNS, dns` — tests DNS resolution for Google",
6+
"description": "WANPulse monitors your internet connection by periodically probing external servers. It measures latency, packet loss, jitter and detects outages.\n\n**Probe targets** — enter one target per line in the format:\nhost, label, method\n\n- **host** — IP address or hostname to probe\n- **label** — a friendly name shown in Home Assistant\n- **method** — probe type: tcp (default, recommended), http, or dns\n\n**Examples:**\n- {example_tcp}\n- {example_http}\n- {example_dns}",
77
"data": {
88
"targets": "Probe targets",
99
"scan_interval": "Scan interval (seconds)"
@@ -15,7 +15,7 @@
1515
},
1616
"reconfigure": {
1717
"title": "Reconfigure WANPulse targets",
18-
"description": "Edit your probe targets. One target per line: `host, label, method`\n\n- **TCP** (recommended) — works with any IP or hostname, tests connection to port 443\n- **HTTP** — provide a full URL, tests HTTP HEAD response\n- **DNS** — provide a hostname, tests DNS resolution time",
18+
"description": "Edit your probe targets. One target per line: host, label, method\n\n- **TCP** (recommended) — works with any IP or hostname, tests connection to port 443\n- **HTTP** — provide a full URL, tests HTTP HEAD response\n- **DNS** — provide a hostname, tests DNS resolution time",
1919
"data": {
2020
"targets": "Probe targets"
2121
},
@@ -25,7 +25,7 @@
2525
}
2626
},
2727
"error": {
28-
"no_targets": "At least one target is required. Enter a host like: 1.1.1.1, Cloudflare, tcp",
28+
"no_targets": "At least one target is required.",
2929
"too_many_targets": "Maximum {max_targets} targets allowed. Remove some targets and try again.",
3030
"invalid_host": "One or more targets have an invalid or empty host field.",
3131
"invalid_host_format": "Invalid host format. Use an IP address, hostname, or full URL depending on probe method.",

custom_components/wanpulse/translations/pl.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"step": {
44
"user": {
55
"title": "Konfiguracja WANPulse — Monitor Internetu",
6-
"description": "WANPulse monitoruje połączenie internetowe, okresowo sprawdzając zewnętrzne serwery. Mierzy opóźnienia, utratę pakietów, jitter i wykrywa awarie.\n\n**Cele sondowania** — wpisz jeden cel na linię w formacie:\n`host, etykieta, metoda`\n\n- **host** — adres IP lub nazwa hosta (np. `1.1.1.1`, `google.com`)\n- **etykieta** — przyjazna nazwa wyświetlana w Home Assistant (np. `Cloudflare`)\n- **metoda** — typ sondy: `tcp` (domyślna, zalecana), `http` lub `dns`\n\n**Przykłady:**\n- `1.1.1.1, Cloudflare DNS, tcp` — test połączenia TCP do Cloudflare\n- `https://www.google.com, Google, http` — test odpowiedzi HTTP od Google\n- `www.google.com, Google DNS, dns` — test rozwiązywania DNS dla Google",
6+
"description": "WANPulse monitoruje połączenie internetowe, okresowo sprawdzając zewnętrzne serwery. Mierzy opóźnienia, utratę pakietów, jitter i wykrywa awarie.\n\n**Cele sondowania** — wpisz jeden cel na linię w formacie:\nhost, etykieta, metoda\n\n- **host** — adres IP lub nazwa hosta\n- **etykieta** — przyjazna nazwa wyświetlana w Home Assistant\n- **metoda** — typ sondy: tcp (domyślna, zalecana), http lub dns\n\n**Przykłady:**\n- {example_tcp}\n- {example_http}\n- {example_dns}",
77
"data": {
88
"targets": "Cele sondowania",
99
"scan_interval": "Interwał skanowania (sekundy)"
@@ -15,7 +15,7 @@
1515
},
1616
"reconfigure": {
1717
"title": "Zmiana celów WANPulse",
18-
"description": "Edytuj cele sondowania. Jeden cel na linię: `host, etykieta, metoda`\n\n- **TCP** (zalecana) — działa z każdym IP lub hostem, testuje połączenie na port 443\n- **HTTP** — podaj pełny URL, testuje odpowiedź HTTP HEAD\n- **DNS** — podaj nazwę hosta, testuje czas rozwiązywania DNS",
18+
"description": "Edytuj cele sondowania. Jeden cel na linię: host, etykieta, metoda\n\n- **TCP** (zalecana) — działa z każdym IP lub hostem, testuje połączenie na port 443\n- **HTTP** — podaj pełny URL, testuje odpowiedź HTTP HEAD\n- **DNS** — podaj nazwę hosta, testuje czas rozwiązywania DNS",
1919
"data": {
2020
"targets": "Cele sondowania"
2121
},
@@ -25,10 +25,10 @@
2525
}
2626
},
2727
"error": {
28-
"no_targets": "Wymagany jest co najmniej jeden cel. Wpisz host, np.: 1.1.1.1, Cloudflare, tcp",
28+
"no_targets": "Wymagany jest co najmniej jeden cel.",
2929
"too_many_targets": "Maksymalnie {max_targets} celów. Usuń część i spróbuj ponownie.",
3030
"invalid_host": "Jeden lub więcej celów ma nieprawidłowe lub puste pole hosta.",
31-
"invalid_host_format": "Nieprawidłowy format hosta. Użyj adresu IP (np. 1.1.1.1), nazwy hosta (np. google.com) lub URL (np. https://google.com) w zależności od metody.",
31+
"invalid_host_format": "Nieprawidłowy format hosta. Użyj adresu IP, nazwy hosta lub pełnego URL w zależności od metody.",
3232
"invalid_method": "Nieprawidłowa metoda sondowania. Obsługiwane metody: tcp, http, dns.",
3333
"all_targets_unreachable": "Żaden z celów nie jest osiągalny. Sprawdź połączenie internetowe i adresy celów. Nieosiągalne: {unreachable}"
3434
},

0 commit comments

Comments
 (0)