@@ -214,42 +214,6 @@ async def async_setup_entry(
214214 return True
215215
216216
217- async def async_migrate_entry (
218- hass : HomeAssistant , config_entry : PDFScrapeConfigEntry
219- ) -> bool :
220- """Check for config migration."""
221-
222- if config_entry .version == 1 and config_entry .minor_version == 1 :
223- new_data : dict [str , Any ] = {** config_entry .data }
224- # Move data to store and remove from config_entry data
225- data : StoredFile = {}
226- for k , v in config_entry .data .items ():
227- if k in [CONF_MODIFIED , CONF_MODIFIED_SOURCE , CONF_MD5_CHECKSUM ]:
228- data [k ] = v
229- del new_data [k ]
230- store : Store [StoredFile ] = get_store (hass , config_entry .entry_id )
231- await store .async_save (data )
232- new_data [CONF_TYPE ] = ConfType .HTTP
233-
234- if config_entry .subentries :
235- for subentry in config_entry .subentries .values ():
236- if pdf_page := subentry .data .get ("pdf_page" ):
237- new_data : dict [str , Any ] = {** subentry .data }
238- new_data [CONF_PDF_PAGES ] = pdf_page
239- del new_data ["pdf_page" ]
240- hass .config_entries .async_update_subentry (
241- config_entry ,
242- subentry ,
243- data = new_data ,
244- )
245-
246- hass .config_entries .async_update_entry (
247- config_entry , data = new_data , version = 1 , minor_version = 2
248- )
249-
250- return True
251-
252-
253217async def _async_update_listener (
254218 hass : HomeAssistant , config_entry : PDFScrapeConfigEntry
255219):
0 commit comments