diff --git a/ui-ngx/src/app/core/services/unit.service.ts b/ui-ngx/src/app/core/services/unit.service.ts
index 9e656907f3..026ac0f3fe 100644
--- a/ui-ngx/src/app/core/services/unit.service.ts
+++ b/ui-ngx/src/app/core/services/unit.service.ts
@@ -88,11 +88,11 @@ export class UnitService {
return this.converter.getUnitConverter(unit as string, to);
}
- getTargetUnitSymbol(unit: TbUnitMapping): string {
+ getTargetUnitSymbol(unit: TbUnitMapping | string): string {
if (isObject(unit)) {
- return isNotEmptyStr(unit[this.currentUnitSystem]) ? unit[this.currentUnitSystem] : unit.from;
+ return isNotEmptyStr(unit[this.currentUnitSystem]) ? unit[this.currentUnitSystem] : (unit as TbUnitMapping).from;
}
- return null;
+ return typeof unit === 'string' ? unit : null;
}
convertUnitValue(value: number, unit: TbUnitMapping): number;
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/key/data-key-config.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/key/data-key-config.component.html
index 68a2b5b851..73c1865cc2 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/key/data-key-config.component.html
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/key/data-key-config.component.html
@@ -49,7 +49,7 @@
diff --git a/ui-ngx/src/app/shared/components/unit-input.component.html b/ui-ngx/src/app/shared/components/unit-input.component.html
index e577db6395..e1ab29fab3 100644
--- a/ui-ngx/src/app/shared/components/unit-input.component.html
+++ b/ui-ngx/src/app/shared/components/unit-input.component.html
@@ -22,11 +22,11 @@
[class.!pointer-events-none]="disabled"
(focusin)="onFocus()"
[matAutocomplete]="unitsAutocomplete"
- [matAutocompleteDisabled]="allowConverted">
+ [matAutocompleteDisabled]="supportsUnitConversion">