mirror of
https://github.com/home-assistant/android
synced 2024-10-01 13:53:53 +00:00
Hide hidden navigation entities in android auto (#4249)
This commit is contained in:
parent
0e280d727b
commit
3d8bd0151a
|
@ -80,7 +80,8 @@ fun getNavigationGridItem(
|
|||
carContext: CarContext,
|
||||
screenManager: ScreenManager,
|
||||
integrationRepository: IntegrationRepository,
|
||||
allEntities: Flow<Map<String, Entity<*>>>
|
||||
allEntities: Flow<Map<String, Entity<*>>>,
|
||||
entityRegistry: List<EntityRegistryResponse>?
|
||||
): GridItem.Builder {
|
||||
return GridItem.Builder().apply {
|
||||
setTitle(carContext.getString(R.string.aa_navigation))
|
||||
|
@ -102,7 +103,15 @@ fun getNavigationGridItem(
|
|||
MapVehicleScreen(
|
||||
carContext,
|
||||
integrationRepository,
|
||||
allEntities.map { it.values.filter { entity -> entity.domain in MAP_DOMAINS } }
|
||||
allEntities.map {
|
||||
it.values.filter { entity ->
|
||||
entity.domain in MAP_DOMAINS &&
|
||||
RegistriesDataHandler.getHiddenByForEntity(
|
||||
entity.entityId,
|
||||
entityRegistry
|
||||
) == null
|
||||
}
|
||||
}
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
|
@ -107,7 +107,8 @@ class EntityGridVehicleScreen(
|
|||
carContext,
|
||||
screenManager,
|
||||
integrationRepository,
|
||||
allEntities
|
||||
allEntities,
|
||||
entityRegistry
|
||||
).build()
|
||||
)
|
||||
if (domains.isNotEmpty()) {
|
||||
|
|
|
@ -157,7 +157,8 @@ class MainVehicleScreen(
|
|||
carContext,
|
||||
screenManager,
|
||||
serverManager.integrationRepository(serverId.value),
|
||||
allEntities
|
||||
allEntities,
|
||||
entityRegistry
|
||||
).build()
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue