Skip to content
This repository has been archived by the owner on Apr 24, 2022. It is now read-only.

Commit

Permalink
Repeat flowing all watches
Browse files Browse the repository at this point in the history
  • Loading branch information
boswelja committed Jun 18, 2021
1 parent ef122b4 commit 46473b2
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,17 @@ class WearOSDiscoveryPlatform(
override val platformIdentifier: String = WEAROS_PLATFORM

override fun allWatches(): Flow<List<Watch>> = flow {
emit(
nodeClient.connectedNodes.await().map { node ->
Watch(
node.displayName,
node.id,
platformIdentifier
)
}
)
repeating(interval = scanRepeatInterval) {
emit(
nodeClient.connectedNodes.await().map { node ->
Watch(
node.displayName,
node.id,
platformIdentifier
)
}
)
}
}

@ExperimentalCoroutinesApi
Expand Down

0 comments on commit 46473b2

Please sign in to comment.