mirror of
https://github.com/home-assistant/android
synced 2024-10-15 12:32:54 +00:00
Check if there are any widgets before connecting to websocket (#2079)
This commit is contained in:
parent
99a7ca1e56
commit
b7d0ae7b2a
|
@ -13,7 +13,6 @@ import kotlinx.coroutines.Dispatchers
|
|||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.cancel
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.collect
|
||||
import kotlinx.coroutines.launch
|
||||
import javax.inject.Inject
|
||||
|
||||
|
@ -75,9 +74,11 @@ abstract class BaseWidgetProvider : AppWidgetProvider() {
|
|||
return@launch
|
||||
}
|
||||
updateAllWidgets(context)
|
||||
entityUpdates = integrationUseCase.getEntityUpdates()
|
||||
entityUpdates!!.collect {
|
||||
updateAllWidgets(context)
|
||||
if (getAllWidgetIds(context).isNotEmpty()) {
|
||||
entityUpdates = integrationUseCase.getEntityUpdates()
|
||||
entityUpdates!!.collect {
|
||||
updateAllWidgets(context)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue