Only return valid entries in light mode

This commit is contained in:
Mygod
2020-06-22 10:05:12 +08:00
parent 012f1a1627
commit debbf7a4ce
6 changed files with 38 additions and 37 deletions

View File

@@ -25,7 +25,7 @@ abstract class IpNeighbourMonitoringTileService : KillableTileService(), IpNeigh
protected fun Tile.subtitleDevices(filter: (String) -> Boolean) {
val size = neighbours
.filter { it.ip is Inet4Address && it.state != IpNeighbour.State.FAILED && filter(it.dev) }
.filter { it.ip is Inet4Address && it.state == IpNeighbour.State.VALID && filter(it.dev) }
.distinctBy { it.lladdr }
.size
if (size > 0) subtitle(resources.getQuantityString(