diff --git a/src/main/java/de/ph87/home/device/DeviceService.java b/src/main/java/de/ph87/home/device/DeviceService.java index b8396c2..0d17860 100644 --- a/src/main/java/de/ph87/home/device/DeviceService.java +++ b/src/main/java/de/ph87/home/device/DeviceService.java @@ -87,10 +87,11 @@ public class DeviceService implements IThingService { @EventListener(PropertyDto.class) public void onPropertyChange(@NonNull final PropertyDto dto) { - deviceRepository.findAllByStatePropertyId(dto.getId()).forEach(device -> publish(device, CrudAction.CREATED)); + deviceRepository.findAllByStatePropertyId(dto.getId()).forEach(device -> publish(device, CrudAction.UPDATED)); } @NonNull + @SuppressWarnings("SameParameterValue") private DeviceDto publish(@NonNull final Device device, @NonNull final CrudAction action) { final DeviceDto dto = toDto(device); log.info("Device {}: {}", action, dto); diff --git a/src/main/java/de/ph87/home/tunable/TunableService.java b/src/main/java/de/ph87/home/tunable/TunableService.java index 51d9c2e..22ad3fd 100644 --- a/src/main/java/de/ph87/home/tunable/TunableService.java +++ b/src/main/java/de/ph87/home/tunable/TunableService.java @@ -115,10 +115,11 @@ public class TunableService implements IThingService { @EventListener(PropertyDto.class) public void onPropertyChange(@NonNull final PropertyDto dto) { - tunableRepository.findDistinctByStatePropertyIdOrBrightnessPropertyIdOrColdnessPropertyId(dto.getId(), dto.getId(), dto.getId()).forEach(tunable -> publish(tunable, CrudAction.CREATED)); + tunableRepository.findDistinctByStatePropertyIdOrBrightnessPropertyIdOrColdnessPropertyId(dto.getId(), dto.getId(), dto.getId()).forEach(tunable -> publish(tunable, CrudAction.UPDATED)); } @NonNull + @SuppressWarnings("SameParameterValue") private TunableDto publish(@NonNull final Tunable tunable, @NonNull final CrudAction action) { final TunableDto dto = toDto(tunable); log.info("Tunable {}: {}", action, dto);