FIX: used wrong CrudAction.CREATE for update
This commit is contained in:
parent
9023f57c37
commit
3da3dea353
@ -87,10 +87,11 @@ public class DeviceService implements IThingService<DeviceDto> {
|
||||
|
||||
@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);
|
||||
|
||||
@ -115,10 +115,11 @@ public class TunableService implements IThingService<TunableDto> {
|
||||
|
||||
@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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user