diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.models.ts b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.models.ts
index b722852fd6..3eacd000b4 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.models.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/indicator/liquid-level-widget.models.ts
@@ -25,7 +25,7 @@ import {
lastUpdateAgoDateFormat
} from '@shared/models/widget-settings.models';
import { DataKey, WidgetConfig } from '@shared/models/widget.models';
-import { DataKeyType } from '@shared/models/telemetry/telemetry.models';
+import { AttributeData, DataKeyType } from '@shared/models/telemetry/telemetry.models';
import { forkJoin, Observable, of } from 'rxjs';
import { singleEntityFilterFromDeviceId } from '@shared/models/query/query.models';
import { EntityType } from '@shared/models/entity-type.models';
@@ -375,9 +375,8 @@ export const convertLiters = (value: number, units: CapacityUnits, conversionTyp
return conversionType === ConversionType.to ? value / factor : value * factor;
};
-export const extractValue = (attributes: any[], attributeName: string, defaultValue: any): any => {
- const index = attributes.findIndex(attr => attr.key === attributeName);
- return index !== -1 ? attributes[index].value : defaultValue;
+export const extractValue =
(attributes: Array, attributeName: string): T | undefined => {
+ return attributes.find(attr => attr.key === attributeName)?.value;
};
export const valueContainerStyleDefaults = cssTextFromInlineStyle({
@@ -413,13 +412,13 @@ export const createAbsoluteLayout = (values?: {inputValue: number | string; volu