Fix Bravia TV options flow when device is off (#81644)
* Fix options flow when tv is off * abort with message
This commit is contained in:
parent
df7000f96d
commit
04d01cefb2
3 changed files with 11 additions and 1 deletions
|
@ -262,7 +262,11 @@ class BraviaTVOptionsFlowHandler(config_entries.OptionsFlow):
|
||||||
self.config_entry.entry_id
|
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()
|
sources = coordinator.source_map.values()
|
||||||
self.source_list = [item["title"] for item in sources]
|
self.source_list = [item["title"] for item in sources]
|
||||||
return await self.async_step_user()
|
return await self.async_step_user()
|
||||||
|
|
|
@ -48,6 +48,9 @@
|
||||||
"ignored_sources": "List of ignored sources"
|
"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": {
|
"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": {
|
"step": {
|
||||||
"user": {
|
"user": {
|
||||||
"data": {
|
"data": {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue