Fix Bravia TV options flow when device is off (#81644)
* Fix options flow when tv is off * abort with messagepull/81784/head
parent
f861137de4
commit
63afb30f57
|
@ -262,7 +262,11 @@ class BraviaTVOptionsFlowHandler(config_entries.OptionsFlow):
|
|||
self.config_entry.entry_id
|
||||
]
|
||||
|
||||
await coordinator.async_update_sources()
|
||||
try:
|
||||
await coordinator.async_update_sources()
|
||||
except BraviaTVError:
|
||||
return self.async_abort(reason="failed_update")
|
||||
|
||||
sources = coordinator.source_map.values()
|
||||
self.source_list = [item["title"] for item in sources]
|
||||
return await self.async_step_user()
|
||||
|
|
|
@ -48,6 +48,9 @@
|
|||
"ignored_sources": "List of ignored sources"
|
||||
}
|
||||
}
|
||||
},
|
||||
"abort": {
|
||||
"failed_update": "An error occurred while updating the list of sources.\n\n Ensure that your TV is turned on before trying to set it up."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,6 +41,9 @@
|
|||
}
|
||||
},
|
||||
"options": {
|
||||
"abort": {
|
||||
"failed_update": "An error occurred while updating the list of sources.\n\n Ensure that your TV is turned on before trying to set it up."
|
||||
},
|
||||
"step": {
|
||||
"user": {
|
||||
"data": {
|
||||
|
|
Loading…
Reference in New Issue