File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
homeassistant/components/webdav Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 3030
3131METADATA_VERSION = "1"
3232BACKUP_TIMEOUT = ClientTimeout (connect = 10 , total = 43200 )
33+ NAMESPACE = "https://home-assistant.io"
3334
3435
3536async def async_get_backup_agents (
@@ -100,14 +101,14 @@ def _is_current_metadata_version(properties: list[Property]) -> bool:
100101 return any (
101102 prop .value == METADATA_VERSION
102103 for prop in properties
103- if prop .namespace == "homeassistant" and prop .name == "metadata_version"
104+ if prop .namespace == NAMESPACE and prop .name == "metadata_version"
104105 )
105106
106107
107108def _backup_id_from_properties (properties : list [Property ]) -> str | None :
108109 """Return the backup ID from properties."""
109110 for prop in properties :
110- if prop .namespace == "homeassistant" and prop .name == "backup_id" :
111+ if prop .namespace == NAMESPACE and prop .name == "backup_id" :
111112 return prop .value
112113 return None
113114
@@ -186,12 +187,12 @@ async def async_upload_backup(
186187 f"{ self ._backup_path } /{ filename_meta } " ,
187188 [
188189 Property (
189- namespace = "homeassistant" ,
190+ namespace = NAMESPACE ,
190191 name = "backup_id" ,
191192 value = backup .backup_id ,
192193 ),
193194 Property (
194- namespace = "homeassistant" ,
195+ namespace = NAMESPACE ,
195196 name = "metadata_version" ,
196197 value = METADATA_VERSION ,
197198 ),
@@ -252,11 +253,11 @@ async def _list_metadata_files(self) -> dict[str, str]:
252253 self ._backup_path ,
253254 [
254255 PropertyRequest (
255- namespace = "homeassistant" ,
256+ namespace = NAMESPACE ,
256257 name = "metadata_version" ,
257258 ),
258259 PropertyRequest (
259- namespace = "homeassistant" ,
260+ namespace = NAMESPACE ,
260261 name = "backup_id" ,
261262 ),
262263 ],
Original file line number Diff line number Diff line change 2020 "/Automatic_backup_2025.2.1_2025-02-10_18.31_30202686.tar" : [],
2121 "/Automatic_backup_2025.2.1_2025-02-10_18.31_30202686.metadata.json" : [
2222 Property (
23- namespace = "homeassistant " ,
23+ namespace = "https://home-assistant.io " ,
2424 name = "backup_id" ,
2525 value = "23e64aec" ,
2626 ),
2727 Property (
28- namespace = "homeassistant " ,
28+ namespace = "https://home-assistant.io " ,
2929 name = "metadata_version" ,
3030 value = "1" ,
3131 ),
You can’t perform that action at this time.
0 commit comments