Skip to content

Commit e4d3ac4

Browse files
committed
Validation fixes
1 parent 32bcb03 commit e4d3ac4

10 files changed

Lines changed: 63 additions & 231 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
run: |
2525
python -m pip install --upgrade pip
2626
pip install black isort flake8 mypy
27-
pip install homeassistant aiohttp types-aiofiles
27+
pip install homeassistant aiohttp beautifulsoup4 lxml types-aiofiles
2828
2929
- name: Run Black (Code formatting)
3030
run: |
@@ -57,7 +57,7 @@ jobs:
5757
- name: Install dependencies
5858
run: |
5959
python -m pip install --upgrade pip
60-
pip install homeassistant aiohttp pytest pytest-asyncio pytest-cov
60+
pip install homeassistant aiohttp beautifulsoup4 lxml pytest pytest-asyncio pytest-cov
6161
6262
- name: Validate Python files
6363
run: |
@@ -66,7 +66,7 @@ jobs:
6666
- name: Check imports
6767
run: |
6868
python -c "from custom_components.http_agent import DOMAIN"
69-
python -c "from custom_components.http_agent.const import DOMAIN, CONF_NAME"
69+
python -c "from custom_components.http_agent.const import DOMAIN"
7070
7171
validate-translations:
7272
name: Validate Translations

.github/workflows/hacs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Install dependencies
3737
run: |
3838
python -m pip install --upgrade pip
39-
pip install homeassistant aiohttp
39+
pip install homeassistant aiohttp beautifulsoup4 lxml
4040
4141
- name: Validate Python syntax
4242
run: |

custom_components/http_agent/config_flow.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ async def async_step_sensor_config(
324324
schema_dict[vol.Required(CONF_TRACKER_LONGITUDE)] = str
325325
schema_dict[vol.Optional(CONF_TRACKER_LOCATION_NAME, default="")] = str
326326
schema_dict[vol.Optional(CONF_TRACKER_SOURCE_TYPE, default="gps")] = vol.In(
327-
["gps", "router", "bluetooth", "bluetooth_le"]
327+
["none", "gps", "router", "bluetooth", "bluetooth_le"]
328328
)
329329

330330
schema = vol.Schema(schema_dict)
@@ -756,9 +756,9 @@ async def async_step_modify_sensor(
756756
schema_dict[
757757
vol.Optional(
758758
CONF_TRACKER_SOURCE_TYPE,
759-
default=sensor.get(CONF_TRACKER_SOURCE_TYPE, ""),
759+
default=sensor.get(CONF_TRACKER_SOURCE_TYPE, "none"),
760760
)
761-
] = vol.In(["", "gps", "router", "bluetooth", "bluetooth_le"])
761+
] = vol.In(["none", "gps", "router", "bluetooth", "bluetooth_le"])
762762

763763
schema = vol.Schema(schema_dict)
764764

@@ -852,7 +852,7 @@ async def async_step_sensor_config(
852852
schema_dict[vol.Required(CONF_TRACKER_LONGITUDE)] = str
853853
schema_dict[vol.Optional(CONF_TRACKER_LOCATION_NAME, default="")] = str
854854
schema_dict[vol.Optional(CONF_TRACKER_SOURCE_TYPE, default="gps")] = vol.In(
855-
["gps", "router", "bluetooth", "bluetooth_le"]
855+
["none", "gps", "router", "bluetooth", "bluetooth_le"]
856856
)
857857

858858
schema = vol.Schema(schema_dict)

custom_components/http_agent/strings.json

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
"action": "Action"
2020
},
2121
"data_description": {
22-
"action": {
23-
"add": "Add header",
24-
"done": "Continue to next step"
25-
}
22+
"action": "Select an action to perform"
2623
}
2724
},
2825
"add_header": {
@@ -48,10 +45,7 @@
4845
"action": "Action"
4946
},
5047
"data_description": {
51-
"action": {
52-
"add": "Add sensor",
53-
"done": "Create integration"
54-
}
48+
"action": "Select an action to perform"
5549
}
5650
},
5751
"add_sensor": {
@@ -96,12 +90,7 @@
9690
"action": "Configuration Section"
9791
},
9892
"data_description": {
99-
"action": {
100-
"basic": "Edit basic settings (URL, method, timeout, interval, SSL)",
101-
"headers": "Edit HTTP headers",
102-
"sensors": "Edit sensors configuration",
103-
"payload": "Edit request payload"
104-
}
93+
"action": "Select a configuration section to edit"
10594
}
10695
},
10796
"basic": {
@@ -122,11 +111,7 @@
122111
"action": "Action"
123112
},
124113
"data_description": {
125-
"action": {
126-
"add": "Add new header",
127-
"clear": "Clear all headers",
128-
"done": "Save changes"
129-
}
114+
"action": "Select an action to perform"
130115
}
131116
},
132117
"add_header": {
@@ -152,12 +137,7 @@
152137
"action": "Action"
153138
},
154139
"data_description": {
155-
"action": {
156-
"add": "Add new sensor",
157-
"edit": "Edit/delete existing sensor",
158-
"clear": "Clear all sensors",
159-
"done": "Save changes"
160-
}
140+
"action": "Select an action to perform"
161141
}
162142
},
163143
"select_sensor": {
@@ -174,11 +154,7 @@
174154
"action": "Action"
175155
},
176156
"data_description": {
177-
"action": {
178-
"edit": "Edit sensor settings",
179-
"delete": "Delete this sensor",
180-
"back": "Back to sensors list"
181-
}
157+
"action": "Select an action to perform on this sensor"
182158
}
183159
},
184160
"modify_sensor": {
@@ -258,7 +234,7 @@
258234
},
259235
"tracker_source_type": {
260236
"options": {
261-
"": "None (default)",
237+
"none": "None (default)",
262238
"gps": "GPS",
263239
"router": "Router",
264240
"bluetooth": "Bluetooth",

custom_components/http_agent/translations/da.json

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
"action": "Handling"
2020
},
2121
"data_description": {
22-
"action": {
23-
"add": "Tilføj header",
24-
"done": "Fortsæt til næste trin"
25-
}
22+
"action": "Select an action to perform"
2623
}
2724
},
2825
"add_header": {
@@ -48,10 +45,7 @@
4845
"action": "Handling"
4946
},
5047
"data_description": {
51-
"action": {
52-
"add": "Tilføj sensor",
53-
"done": "Opret integration"
54-
}
48+
"action": "Select an action to perform"
5549
}
5650
},
5751
"add_sensor": {
@@ -96,12 +90,7 @@
9690
"action": "Konfigurationssektion"
9791
},
9892
"data_description": {
99-
"action": {
100-
"basic": "Rediger grundindstillinger (URL, metode, timeout, interval, SSL)",
101-
"headers": "Rediger HTTP-headere",
102-
"sensors": "Rediger sensor-konfiguration",
103-
"payload": "Rediger anmodnings-payload"
104-
}
93+
"action": "Select a configuration section to edit"
10594
}
10695
},
10796
"basic": {
@@ -122,11 +111,7 @@
122111
"action": "Handling"
123112
},
124113
"data_description": {
125-
"action": {
126-
"add": "Tilføj ny header",
127-
"clear": "Ryd alle headere",
128-
"done": "Gem ændringer"
129-
}
114+
"action": "Select an action to perform"
130115
}
131116
},
132117
"add_header": {
@@ -152,12 +137,7 @@
152137
"action": "Handling"
153138
},
154139
"data_description": {
155-
"action": {
156-
"add": "Tilføj ny sensor",
157-
"edit": "Rediger/slet eksisterende sensor",
158-
"clear": "Ryd alle sensorer",
159-
"done": "Gem ændringer"
160-
}
140+
"action": "Select an action to perform"
161141
}
162142
},
163143
"select_sensor": {
@@ -174,11 +154,7 @@
174154
"action": "Handling"
175155
},
176156
"data_description": {
177-
"action": {
178-
"edit": "Rediger sensorindstillinger",
179-
"delete": "Slet denne sensor",
180-
"back": "Tilbage til sensorliste"
181-
}
157+
"action": "Select an action to perform on this sensor"
182158
}
183159
},
184160
"modify_sensor": {
@@ -258,11 +234,11 @@
258234
},
259235
"tracker_source_type": {
260236
"options": {
261-
"": "Ingen (standard)",
262237
"gps": "GPS",
263238
"router": "Router",
264239
"bluetooth": "Bluetooth",
265-
"bluetooth_le": "Bluetooth LE"
240+
"bluetooth_le": "Bluetooth LE",
241+
"none": "Ingen (standard)"
266242
}
267243
}
268244
}

custom_components/http_agent/translations/de.json

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
"action": "Aktion"
2020
},
2121
"data_description": {
22-
"action": {
23-
"add": "Header hinzufügen",
24-
"done": "Weiter zum nächsten Schritt"
25-
}
22+
"action": "Select an action to perform"
2623
}
2724
},
2825
"add_header": {
@@ -48,10 +45,7 @@
4845
"action": "Aktion"
4946
},
5047
"data_description": {
51-
"action": {
52-
"add": "Sensor hinzufügen",
53-
"done": "Integration erstellen"
54-
}
48+
"action": "Select an action to perform"
5549
}
5650
},
5751
"add_sensor": {
@@ -96,12 +90,7 @@
9690
"action": "Konfigurationsbereich"
9791
},
9892
"data_description": {
99-
"action": {
100-
"basic": "Grundeinstellungen bearbeiten (URL, Methode, Timeout, Intervall, SSL)",
101-
"headers": "HTTP-Header bearbeiten",
102-
"sensors": "Sensor-Konfiguration bearbeiten",
103-
"payload": "Anfrage-Nutzlast bearbeiten"
104-
}
93+
"action": "Select a configuration section to edit"
10594
}
10695
},
10796
"basic": {
@@ -122,11 +111,7 @@
122111
"action": "Aktion"
123112
},
124113
"data_description": {
125-
"action": {
126-
"add": "Neuen Header hinzufügen",
127-
"clear": "Alle Header löschen",
128-
"done": "Änderungen speichern"
129-
}
114+
"action": "Select an action to perform"
130115
}
131116
},
132117
"add_header": {
@@ -152,12 +137,7 @@
152137
"action": "Aktion"
153138
},
154139
"data_description": {
155-
"action": {
156-
"add": "Neuen Sensor hinzufügen",
157-
"edit": "Vorhandenen Sensor bearbeiten/löschen",
158-
"clear": "Alle Sensoren löschen",
159-
"done": "Änderungen speichern"
160-
}
140+
"action": "Select an action to perform"
161141
}
162142
},
163143
"select_sensor": {
@@ -174,11 +154,7 @@
174154
"action": "Aktion"
175155
},
176156
"data_description": {
177-
"action": {
178-
"edit": "Sensoreinstellungen bearbeiten",
179-
"delete": "Diesen Sensor löschen",
180-
"back": "Zurück zur Sensorliste"
181-
}
157+
"action": "Select an action to perform on this sensor"
182158
}
183159
},
184160
"modify_sensor": {
@@ -258,11 +234,11 @@
258234
},
259235
"tracker_source_type": {
260236
"options": {
261-
"": "Keine (Standard)",
262237
"gps": "GPS",
263238
"router": "Router",
264239
"bluetooth": "Bluetooth",
265-
"bluetooth_le": "Bluetooth LE"
240+
"bluetooth_le": "Bluetooth LE",
241+
"none": "Keine (Standard)"
266242
}
267243
}
268244
}

0 commit comments

Comments
 (0)