removed updating Property by update via 'write' Knx-Address

This commit is contained in:
Patrick Haßel 2024-11-21 16:25:14 +01:00
parent b14c8d63d2
commit 6ebe41c8d2
2 changed files with 5 additions and 5 deletions

View File

@ -8,6 +8,6 @@ import java.util.List;
public interface KnxPropertyRepository extends ListCrudRepository<KnxProperty, String> {
List<KnxProperty> findDistinctByReadOrWrite(@NonNull GroupAddress read, @NonNull GroupAddress write);
List<KnxProperty> findAllByRead(@NonNull GroupAddress read);
}

View File

@ -49,7 +49,7 @@ public class KnxPropertyService {
@EventListener(GroupLoaded.class)
public void onGroupLoad(@NonNull final GroupLoaded groupLoaded) {
findAllByAddress(groupLoaded.getGroup().getAddress()).forEach(this::read);
findAllByReadAddress(groupLoaded.getGroup().getAddress()).forEach(this::read);
}
public void create(@NonNull final String id, @NonNull final KnxPropertyType type, @Nullable final GroupAddress read, @Nullable final GroupAddress write) {
@ -68,7 +68,7 @@ public class KnxPropertyService {
@EventListener(ProcessEvent.class)
public void onProcessEvent(@NonNull final ProcessEvent event) {
findAllByAddress(event.getDestination()).forEach(knxProperty -> onProcessEvent(knxProperty, event));
findAllByReadAddress(event.getDestination()).forEach(knxProperty -> onProcessEvent(knxProperty, event));
}
private void onProcessEvent(@NonNull final KnxProperty knxProperty, @NonNull final ProcessEvent event) {
@ -134,8 +134,8 @@ public class KnxPropertyService {
}
@NonNull
private List<KnxProperty> findAllByAddress(@NonNull final GroupAddress address) {
return knxPropertyRepository.findDistinctByReadOrWrite(address, address);
private List<KnxProperty> findAllByReadAddress(@NonNull final GroupAddress address) {
return knxPropertyRepository.findAllByRead(address);
}
}