Commit e796e3d
committed
fix(backup): strip /api/ prefix from REST paths (double-prefix 404s)
``HomeAssistantClient.httpx_client`` is constructed with
``base_url=f"{self.base_url}/api"`` (rest_client.py:144-145), so
``_request(method, endpoint)`` already routes through ``/api/``. Six
backup_manager call sites were passing endpoints with a leading
``/api/`` — causing the actual URLs to become ``/api/api/states/...``
which HA serves as 404.
Visible in the b8709ab CI log:
GET http://localhost:.../api/api/states/group.e2e_bk_grp_d2489f4b
"HTTP/1.1 404 Not Found"
Fixed sites:
- ``_fetch_group`` — ``states/{eid}`` instead of ``/api/states/{eid}``
- ``_restore_group`` — ``services/group/set``
- ``_restore_calendar_event`` — ``services/calendar/create_event``
- ``_restore_todo_item`` — ``services/todo/add_item``
- ``_fetch_entity_state`` — ``states/{entity_id}``
- ``_restore_entity_state`` — ``states/{entity_id}``
Closes the last real e2e failure (group). category/area passed on
the previous run after the ``_backups_for`` sanitization fix —
b8709ab was down to just group.1 parent b8709ab commit e796e3d
1 file changed
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
829 | 829 | | |
830 | 830 | | |
831 | 831 | | |
832 | | - | |
| 832 | + | |
833 | 833 | | |
834 | 834 | | |
835 | 835 | | |
| |||
850 | 850 | | |
851 | 851 | | |
852 | 852 | | |
853 | | - | |
| 853 | + | |
854 | 854 | | |
855 | 855 | | |
856 | 856 | | |
| |||
907 | 907 | | |
908 | 908 | | |
909 | 909 | | |
910 | | - | |
| 910 | + | |
911 | 911 | | |
912 | 912 | | |
913 | 913 | | |
| |||
1007 | 1007 | | |
1008 | 1008 | | |
1009 | 1009 | | |
1010 | | - | |
| 1010 | + | |
1011 | 1011 | | |
1012 | 1012 | | |
1013 | 1013 | | |
| |||
1016 | 1016 | | |
1017 | 1017 | | |
1018 | 1018 | | |
1019 | | - | |
| 1019 | + | |
1020 | 1020 | | |
1021 | 1021 | | |
1022 | 1022 | | |
| |||
1028 | 1028 | | |
1029 | 1029 | | |
1030 | 1030 | | |
1031 | | - | |
| 1031 | + | |
1032 | 1032 | | |
1033 | 1033 | | |
1034 | 1034 | | |
| |||
0 commit comments