Skip to content

Commit a200d7a

Browse files
authored
Merge pull request #141 from mudape/next
Remove range for consider home
2 parents 087fd0e + f646a79 commit a200d7a

File tree

5 files changed

+111
-14
lines changed

5 files changed

+111
-14
lines changed

custom_components/iphonedetect/config_flow.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
from .const import (
3030
DEFAULT_CONSIDER_HOME,
3131
DOMAIN,
32-
MAX_CONSIDER_HOME,
33-
MIN_CONSIDER_HOME,
3432
)
3533

3634

@@ -39,10 +37,7 @@
3937

4038
OPTIONS_SCHEMA = vol.Schema(
4139
{
42-
vol.Required(CONF_CONSIDER_HOME, default=DEFAULT_CONSIDER_HOME): vol.All(
43-
vol.Coerce(int),
44-
vol.Range(min=MIN_CONSIDER_HOME, max=MAX_CONSIDER_HOME),
45-
)
40+
vol.Required(CONF_CONSIDER_HOME, default=DEFAULT_CONSIDER_HOME): int
4641
}
4742
)
4843

custom_components/iphonedetect/const.py

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
DOMAIN = "iphonedetect"
44

55
DEFAULT_CONSIDER_HOME: int = 24
6-
MAX_CONSIDER_HOME: int = 60
7-
MIN_CONSIDER_HOME: int = 18
86

97
PROBE_INTERVAL: float = 5
108
UPDATE_INTERVAL: float = 8

custom_components/iphonedetect/helpers.py

-6
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
from .const import (
2626
DEFAULT_CONSIDER_HOME,
2727
DOMAIN,
28-
MAX_CONSIDER_HOME,
29-
MIN_CONSIDER_HOME,
3028
)
3129

3230
_LOGGER = logging.getLogger(__name__)
@@ -59,10 +57,6 @@ async def _run_import(hass: HomeAssistant, config: ConfigType) -> None:
5957
con_home = DEFAULT_CONSIDER_HOME
6058
if isinstance(con_home, timedelta):
6159
con_home = con_home.seconds
62-
if con_home < MIN_CONSIDER_HOME:
63-
con_home = MIN_CONSIDER_HOME
64-
elif con_home > MAX_CONSIDER_HOME:
65-
con_home = MAX_CONSIDER_HOME
6660

6761
# run import after everything has been cleaned up
6862
hass.async_create_task(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"issues": {
3+
"deprecated_yaml_import": {
4+
"title": "Nastavení YAML se odebírá",
5+
"description": "Nastavení {integration_title} použité v YAML se odebírá.\n\nVaše existující nastavení v YAML bylo automaticky importováno do UI.\n\nOdeberte nastavení `{domain}` ze souboru configuration.yaml a restartujte Home Assistanta pro opravení tohoto problému."
6+
}
7+
},
8+
"config": {
9+
"step": {
10+
"user": {
11+
"description": "Ujistěte se, že zařízení má pevnou IP adresu.",
12+
"data": {
13+
"name": "Název",
14+
"ip_address": "IP adresa",
15+
"consider_home": "Interval detekce Je doma (sek.)",
16+
"subnet_check": "Zkontrolovat, zda je IP adresa v dosažitelné podsíti"
17+
},
18+
"data_description": {
19+
"name": "Nastaví unikátní název pro entitu.",
20+
"consider_home": "Doba čekání před označením zařízení jako Není doma"
21+
}
22+
},
23+
"reconfigure": {
24+
"description": "Aktualizuje nastavení pro {device_name}.",
25+
"data": {
26+
"ip_address": "IP adresa",
27+
"subnet_check": "Zkontrolovat, zda je IP v dosažitelné podsíti"
28+
}
29+
}
30+
},
31+
"abort": {
32+
"already_configured": "Zařízení je již nastaveno.",
33+
"unknown": "Neočekávaná chyba"
34+
},
35+
"error": {
36+
"name_not_unique": "Název není unikátní, vyberte jiný.",
37+
"ip_already_configured": "IP adresa je již používána jinou entitou.",
38+
"ip_invalid": "Není platná IP adresa.",
39+
"ip_range": "IP adresa není v rozsahu podsítě HASS."
40+
}
41+
},
42+
"options": {
43+
"step": {
44+
"init": {
45+
"description": "Zvýšte dobu, pokud zařízení samo sebe nesprávně hlásí ve stavu Není doma.",
46+
"data": {
47+
"consider_home": "Interval detekce Je doma (sek.)"
48+
},
49+
"data_description": {
50+
"consider_home": "Doba čekání před označením zařízení jako Není doma"
51+
}
52+
}
53+
}
54+
}
55+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"issues": {
3+
"deprecated_yaml_import": {
4+
"title": "Die YAML-Konfiguration wird entfernt",
5+
"description": "Die Konfiguration von {integration_title} unter Verwendung von YAML wird entfernt.\n\nIhre bestehende YAML-Konfiguration wurde automatisch in die Benutzeroberfläche importiert.\n\nEntfernen Sie die Konfiguration `{domain}` aus Ihrer Datei configuration.yaml und starten Sie Home Assistant neu, um dieses Problem zu beheben."
6+
}
7+
},
8+
"config": {
9+
"step": {
10+
"user": {
11+
"description": "Stellen Sie sicher, dass das Gerät eine statische IP hat",
12+
"data": {
13+
"name": "Name",
14+
"ip_address": "IP-Adresse",
15+
"consider_home": "Als zu Hause betrachten (Sek)",
16+
"subnet_check": "Prüfen, ob IP in einem erreichbaren Subnetz liegt"
17+
},
18+
"data_description": {
19+
"name": "Geben Sie einen eindeutigen Namen für die Entität ein",
20+
"consider_home": "Zeit, die gewartet wird, bevor ein Gerät als nicht zu Hause betrachtet wird"
21+
}
22+
},
23+
"reconfigure": {
24+
"description": "Konfiguration für {device_name} aktualisieren.",
25+
"data": {
26+
"ip_address": "IP-Adresse",
27+
"subnet_check": "Prüfen, ob IP in einem erreichbaren Subnetz liegt"
28+
}
29+
}
30+
},
31+
"abort": {
32+
"already_configured": "Gerät ist bereits konfiguriert",
33+
"unknown": "Unerwarteter Fehler"
34+
},
35+
"error": {
36+
"name_not_unique": "Name nicht eindeutig, wählen Sie einen anderen",
37+
"ip_already_configured": "IP-Adresse wird bereits von einer anderen Entität verwendet",
38+
"ip_invalid": "Keine gültige IP-Adresse",
39+
"ip_range": "IP nicht im Bereich der HASS-Subnetze"
40+
}
41+
},
42+
"options": {
43+
"step": {
44+
"init": {
45+
"description": "Erhöhe die Zeit, wenn sich das Gerät fälschlicherweise als nicht zu Hause betrachtet.",
46+
"data": {
47+
"consider_home": "Als zu Hause betrachten (Sek)"
48+
},
49+
"data_description": {
50+
"consider_home": "Zeit, die gewartet wird, bevor ein Gerät als nicht zu Hause betrachtet wird"
51+
}
52+
}
53+
}
54+
}
55+
}

0 commit comments

Comments
 (0)