mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 23:22:02 +01:00
Signed-off-by: clinique <gael@lhopital.org>
This commit is contained in:
parent
0ad8cfbb62
commit
451aeb6b4a
@ -39,14 +39,17 @@ public class HomeData extends NAThing implements NAModule, LocationEx {
|
||||
}
|
||||
|
||||
public class Security extends HomeData {
|
||||
private NAObjectMap<HomeDataPerson> persons = new NAObjectMap<>();
|
||||
private @Nullable NAObjectMap<HomeDataPerson> persons;
|
||||
|
||||
public NAObjectMap<HomeDataPerson> getPersons() {
|
||||
return persons;
|
||||
NAObjectMap<HomeDataPerson> localPersons = persons;
|
||||
return localPersons != null ? localPersons : new NAObjectMap<>();
|
||||
}
|
||||
|
||||
public List<HomeDataPerson> getKnownPersons() {
|
||||
return persons.values().stream().filter(HomeDataPerson::isKnown).toList();
|
||||
NAObjectMap<HomeDataPerson> localPersons = persons;
|
||||
return localPersons != null ? localPersons.values().stream().filter(HomeDataPerson::isKnown).toList()
|
||||
: List.of();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user