diff --git a/ui-ngx/src/app/modules/home/components/profile/device/mqtt-device-profile-transport-configuration.component.ts b/ui-ngx/src/app/modules/home/components/profile/device/mqtt-device-profile-transport-configuration.component.ts
index 4b517a081d..4a81284d5c 100644
--- a/ui-ngx/src/app/modules/home/components/profile/device/mqtt-device-profile-transport-configuration.component.ts
+++ b/ui-ngx/src/app/modules/home/components/profile/device/mqtt-device-profile-transport-configuration.component.ts
@@ -122,11 +122,10 @@ export class MqttDeviceProfileTransportConfigurationComponent implements Control
takeUntil(this.destroy$)
).subscribe((value) => {
if (value) {
- this.mqttDeviceProfileTransportConfigurationFormGroup.get('deviceAttributesTopic').disable({emitEvent: false});
- this.mqttDeviceProfileTransportConfigurationFormGroup.get('deviceTelemetryTopic').disable({emitEvent: false});
+ this.mqttDeviceProfileTransportConfigurationFormGroup.disable({emitEvent: false});
+ this.mqttDeviceProfileTransportConfigurationFormGroup.get('sparkPlug').enable({emitEvent: false});
} else {
- this.mqttDeviceProfileTransportConfigurationFormGroup.get('deviceAttributesTopic').enable({emitEvent: false});
- this.mqttDeviceProfileTransportConfigurationFormGroup.get('deviceTelemetryTopic').enable({emitEvent: false});
+ this.mqttDeviceProfileTransportConfigurationFormGroup.enable({emitEvent: false});
}
});
this.mqttDeviceProfileTransportConfigurationFormGroup.valueChanges.pipe(
@@ -163,8 +162,10 @@ export class MqttDeviceProfileTransportConfigurationComponent implements Control
writeValue(value: MqttDeviceProfileTransportConfiguration | null): void {
if (isDefinedAndNotNull(value)) {
this.mqttDeviceProfileTransportConfigurationFormGroup.patchValue(value, {emitEvent: false});
- this.mqttDeviceProfileTransportConfigurationFormGroup.get('sparkPlug').updateValueAndValidity({onlySelf: true});
this.updateTransportPayloadBasedControls(value.transportPayloadTypeConfiguration?.transportPayloadType);
+ if (!this.disabled) {
+ this.mqttDeviceProfileTransportConfigurationFormGroup.get('sparkPlug').updateValueAndValidity({onlySelf: true});
+ }
}
}