Skip to content

Commit ddb59d8

Browse files
committed
no-mistakes(ci): Repo: ngoviet/lumentreeHA, PR #5 (audit/robustness-and-thread-safety). Both checks fail on the current head with live annotations (confirmed via check-run annotations + job logs, not stale runs). **ci-1 HACS — FIXED (code change).** <Validation hacsjson> failed: extra keys not allowed @ data['domains']. hacs.json carried two keys that are not in HACS_MANIFEST_JSON_SCHEMA (hacs/integration@main custom_components/hacs/utils/validate.py), which is declared extra=vol.PREVENT_EXTRA. Both domains and iot_class are hassfest/manifest concepts, not HACS concepts — the HACS analogue (HacsManifest dataclass) has no such fields. Removed both keys; kept name, content_in_root, homeassistant, render_readme. Verified by validating the file against the real schema reconstructed from upstream (voluptuous 0.16.0) → PASS. **ci-2 Hassfest — 2 of 3 errors FIXED, 1 not fixable in this PR.** (a) FIXED: [TRANSLATIONS] Invalid strings.json: not a valid option at 'translations'. strings.json carried a top-level translations key holding a vi block. hassfest's gen_strings_schema (script/hassfest/translations.py, home-assistant/core@dev) enumerates an explicit optional-key list with no translations entry, and HA has no such component — a locale belongs in translations/<locale>.json. Removed the key (strings.json:76-152) and relocated the Vietnamese block verbatim to the new translations/vi.json (CRLF preserved, content byte-identical; title/config/entity all preserved exactly). Verified fail-before/pass-after against the real schema: base-commit strings.json FAILs with the exact reported wording, current file PASSes. (b) NOT FIXED — not caused by this PR and structurally unsatisfiable. [MANIFEST] Domain does not match dir name: hassfest compares manifest["domain"] (="lumentree") to integration.path.name, and Integration.domain returns self.path.name (script/hassfest/model.py:151). For a root manifest.json the Docker entrypoint passes the repo root as --integration-path, so path.name is the checkout directory ("workspace"), never "lumentree". This is unsatisfiable for the deliberate content_in_root: true flat layout adopted in v5.0.0 (commit 3ab6ae4) and required by hacs.json. Upstream home-assistant/core#152942 reports exactly this and was closed not_planned. hassfest has no content_in_root exemption anywhere. The only "fix" would be relocating the integration to custom_components/lumentree/, abandoning the intentional layout — a large restructure that contradicts the PR's design, not a minimal root-cause fix. **Scope note.** git diff base..HEAD -- hacs.json strings.json manifest.json translations/ was empty: both defects pre-exist at base 602e5a5f. The only file this PR changed among config files is the deliberately-added .github/workflows/ci.yml, which surfaces them. Per the removal-first rule both fixes are pure deletions (80 lines removed, 2 files, +1 relocated file), verified against the real consumer schemas rather than by substring matching. **Local baseline after change:** pytest tests/ -q → 48 passed; ruff check . → All checks passed; all touched JSON parses. Docker is unavailable here, so the hassfest image could not be executed locally; the validators were reconstructed from upstream sources and exercised directly. **Residual:** error (b) will keep the Hassfest check red until the layout question is decided by the owner (either keep the flat layout and accept the known false positive, or restructure to custom_components/lumentree/)
1 parent a73e1ec commit ddb59d8

3 files changed

Lines changed: 156 additions & 80 deletions

File tree

‎hacs.json‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{
22
"name": "Lumentree Inverter",
33
"content_in_root": true,
4-
"domains": ["lumentree"],
5-
"iot_class": "Cloud Polling",
64
"homeassistant": "2023.1.0",
75
"render_readme": true
86
}

‎strings.json‎

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -72,83 +72,5 @@
7272
"online_status": { "name": "Online Status" },
7373
"is_ups_mode": { "name": "UPS Mode" }
7474
}
75-
},
76-
"translations": {
77-
"vi": {
78-
"title": "Lumentree Inverter",
79-
"config": {
80-
"step": {
81-
"user": {
82-
"title": "Xác thực Thiết bị Lumentree",
83-
"description": "Vui lòng nhập **Device ID** của bộ biến tần Lumentree.\n\nBạn thường có thể tìm thấy Device ID trên nhãn của biến tần hoặc trong ứng dụng di động.",
84-
"data": { "device_id": "Device ID" }
85-
},
86-
"confirm_device": {
87-
"title": "Xác nhận Thiết bị",
88-
"description": "Đã tìm thấy thiết bị Lumentree!\n\n**Tên:** {device_name}\n**ID (SN):** {device_sn}\n\nNhấn SUBMIT để hoàn tất thêm thiết bị.",
89-
"data": {}
90-
}
91-
},
92-
"error": {
93-
"cannot_connect": "Không thể kết nối đến API Lumentree. Kiểm tra kết nối mạng.",
94-
"invalid_auth": "Xác thực thất bại. Kiểm tra lại Device ID hoặc API tạm thời không khả dụng. Token có thể đã hết hạn.",
95-
"cannot_connect_deviceinfo": "Không thể lấy thông tin thiết bị sau khi xác thực. Kiểm tra kết nối mạng hoặc trạng thái API.",
96-
"token_missing": "Lỗi nội bộ: Thiếu token xác thực.",
97-
"unknown": "Lỗi không xác định xảy ra."
98-
},
99-
"abort": {
100-
"already_configured": "Thiết bị với ID này (SN: {device_sn}) đã được cấu hình.",
101-
"reauth_successful": "Xác thực lại thành công",
102-
"missing_device_id": "Không thể xác thực lại: Thiếu Device ID trong cấu hình hiện tại.",
103-
"unknown_entry": "Không thể xác thực lại: Không tìm thấy cấu hình.",
104-
"auth_failed_reauth": "Xác thực lại thất bại. Vui lòng kiểm tra Device ID."
105-
}
106-
},
107-
"entity": {
108-
"sensor": {
109-
"pv_power": { "name": "Công suất PV" },
110-
"battery_power": { "name": "Công suất Pin" },
111-
"battery_soc": { "name": "Dung lượng Pin (SOC)" },
112-
"grid_power": { "name": "Công suất Lưới" },
113-
"load_power": { "name": "Công suất Tải" },
114-
"battery_voltage": { "name": "Điện áp Pin" },
115-
"battery_current": { "name": "Dòng điện Pin" },
116-
"ac_output_voltage": { "name": "Điện áp AC Ngõ ra" },
117-
"grid_voltage": { "name": "Điện áp Lưới" },
118-
"ac_output_frequency": { "name": "Tần số AC Ngõ ra" },
119-
"ac_output_power": { "name": "Công suất AC Ngõ ra" },
120-
"ac_output_va": { "name": "Công suất biểu kiến AC Ngõ ra" },
121-
"device_temperature": { "name": "Nhiệt độ Thiết bị" },
122-
"pv1_voltage": { "name": "Điện áp PV1" },
123-
"pv1_power": { "name": "Công suất PV1" },
124-
"pv2_voltage": { "name": "Điện áp PV2" },
125-
"pv2_power": { "name": "Công suất PV2" },
126-
"last_raw_mqtt_hex": { "name": "Dữ liệu MQTT Hex cuối" },
127-
"pv_today": { "name": "Sản lượng PV hôm nay" },
128-
"charge_today": { "name": "Pin đã sạc hôm nay" },
129-
"discharge_today": { "name": "Pin đã xả hôm nay" },
130-
"grid_in_today": { "name": "Điện lưới đã lấy hôm nay" },
131-
"load_today": { "name": "Tải tiêu thụ hôm nay" },
132-
"battery_status": { "name": "Trạng thái Pin" },
133-
"grid_status": { "name": "Trạng thái Lưới" },
134-
"ac_input_voltage": { "name": "Điện áp AC Ngõ vào" },
135-
"ac_input_frequency": { "name": "Tần số AC Ngõ vào" },
136-
"ac_input_power": { "name": "Công suất AC Ngõ vào" },
137-
"battery_type": { "name": "Loại Pin" },
138-
"master_slave_status": { "name": "Trạng thái Master/Slave" },
139-
"mqtt_device_sn": { "name": "SN Thiết bị (MQTT)" },
140-
"battery_cell_info": { "name": "Thông tin Cell Pin" },
141-
"self_consumption_ratio": { "name": "Tỷ lệ Tự tiêu thụ" },
142-
"work_mode": { "name": "Chế độ Làm việc" },
143-
"battery_mode": { "name": "Chế độ Pin" },
144-
"fw_version": { "name": "Phiên bản Firmware" },
145-
"ctrl_version": { "name": "Phiên bản Controller" }
146-
},
147-
"binary_sensor": {
148-
"online_status": { "name": "Trạng thái Online" },
149-
"is_ups_mode": { "name": "Chế độ UPS" }
150-
}
151-
}
152-
}
15375
}
15476
}

‎translations/vi.json‎

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
{
2+
"title": "Lumentree Inverter",
3+
"config": {
4+
"step": {
5+
"user": {
6+
"title": "Xác thực Thiết bị Lumentree",
7+
"description": "Vui lòng nhập **Device ID** của bộ biến tần Lumentree.\n\nBạn thường có thể tìm thấy Device ID trên nhãn của biến tần hoặc trong ứng dụng di động.",
8+
"data": {
9+
"device_id": "Device ID"
10+
}
11+
},
12+
"confirm_device": {
13+
"title": "Xác nhận Thiết bị",
14+
"description": "Đã tìm thấy thiết bị Lumentree!\n\n**Tên:** {device_name}\n**ID (SN):** {device_sn}\n\nNhấn SUBMIT để hoàn tất thêm thiết bị.",
15+
"data": {}
16+
}
17+
},
18+
"error": {
19+
"cannot_connect": "Không thể kết nối đến API Lumentree. Kiểm tra kết nối mạng.",
20+
"invalid_auth": "Xác thực thất bại. Kiểm tra lại Device ID hoặc API tạm thời không khả dụng. Token có thể đã hết hạn.",
21+
"cannot_connect_deviceinfo": "Không thể lấy thông tin thiết bị sau khi xác thực. Kiểm tra kết nối mạng hoặc trạng thái API.",
22+
"token_missing": "Lỗi nội bộ: Thiếu token xác thực.",
23+
"unknown": "Lỗi không xác định xảy ra."
24+
},
25+
"abort": {
26+
"already_configured": "Thiết bị với ID này (SN: {device_sn}) đã được cấu hình.",
27+
"reauth_successful": "Xác thực lại thành công",
28+
"missing_device_id": "Không thể xác thực lại: Thiếu Device ID trong cấu hình hiện tại.",
29+
"unknown_entry": "Không thể xác thực lại: Không tìm thấy cấu hình.",
30+
"auth_failed_reauth": "Xác thực lại thất bại. Vui lòng kiểm tra Device ID."
31+
}
32+
},
33+
"entity": {
34+
"sensor": {
35+
"pv_power": {
36+
"name": "Công suất PV"
37+
},
38+
"battery_power": {
39+
"name": "Công suất Pin"
40+
},
41+
"battery_soc": {
42+
"name": "Dung lượng Pin (SOC)"
43+
},
44+
"grid_power": {
45+
"name": "Công suất Lưới"
46+
},
47+
"load_power": {
48+
"name": "Công suất Tải"
49+
},
50+
"battery_voltage": {
51+
"name": "Điện áp Pin"
52+
},
53+
"battery_current": {
54+
"name": "Dòng điện Pin"
55+
},
56+
"ac_output_voltage": {
57+
"name": "Điện áp AC Ngõ ra"
58+
},
59+
"grid_voltage": {
60+
"name": "Điện áp Lưới"
61+
},
62+
"ac_output_frequency": {
63+
"name": "Tần số AC Ngõ ra"
64+
},
65+
"ac_output_power": {
66+
"name": "Công suất AC Ngõ ra"
67+
},
68+
"ac_output_va": {
69+
"name": "Công suất biểu kiến AC Ngõ ra"
70+
},
71+
"device_temperature": {
72+
"name": "Nhiệt độ Thiết bị"
73+
},
74+
"pv1_voltage": {
75+
"name": "Điện áp PV1"
76+
},
77+
"pv1_power": {
78+
"name": "Công suất PV1"
79+
},
80+
"pv2_voltage": {
81+
"name": "Điện áp PV2"
82+
},
83+
"pv2_power": {
84+
"name": "Công suất PV2"
85+
},
86+
"last_raw_mqtt_hex": {
87+
"name": "Dữ liệu MQTT Hex cuối"
88+
},
89+
"pv_today": {
90+
"name": "Sản lượng PV hôm nay"
91+
},
92+
"charge_today": {
93+
"name": "Pin đã sạc hôm nay"
94+
},
95+
"discharge_today": {
96+
"name": "Pin đã xả hôm nay"
97+
},
98+
"grid_in_today": {
99+
"name": "Điện lưới đã lấy hôm nay"
100+
},
101+
"load_today": {
102+
"name": "Tải tiêu thụ hôm nay"
103+
},
104+
"battery_status": {
105+
"name": "Trạng thái Pin"
106+
},
107+
"grid_status": {
108+
"name": "Trạng thái Lưới"
109+
},
110+
"ac_input_voltage": {
111+
"name": "Điện áp AC Ngõ vào"
112+
},
113+
"ac_input_frequency": {
114+
"name": "Tần số AC Ngõ vào"
115+
},
116+
"ac_input_power": {
117+
"name": "Công suất AC Ngõ vào"
118+
},
119+
"battery_type": {
120+
"name": "Loại Pin"
121+
},
122+
"master_slave_status": {
123+
"name": "Trạng thái Master/Slave"
124+
},
125+
"mqtt_device_sn": {
126+
"name": "SN Thiết bị (MQTT)"
127+
},
128+
"battery_cell_info": {
129+
"name": "Thông tin Cell Pin"
130+
},
131+
"self_consumption_ratio": {
132+
"name": "Tỷ lệ Tự tiêu thụ"
133+
},
134+
"work_mode": {
135+
"name": "Chế độ Làm việc"
136+
},
137+
"battery_mode": {
138+
"name": "Chế độ Pin"
139+
},
140+
"fw_version": {
141+
"name": "Phiên bản Firmware"
142+
},
143+
"ctrl_version": {
144+
"name": "Phiên bản Controller"
145+
}
146+
},
147+
"binary_sensor": {
148+
"online_status": {
149+
"name": "Trạng thái Online"
150+
},
151+
"is_ups_mode": {
152+
"name": "Chế độ UPS"
153+
}
154+
}
155+
}
156+
}

0 commit comments

Comments
 (0)