Skip to content

Commit 339524c

Browse files
Zhiwzibuyu1995
authored andcommitted
fix(codec): fix codec bug
1 parent 0e46893 commit 339524c

File tree

1 file changed

+2
-2
lines changed
  • server/app/services/products/views

1 file changed

+2
-2
lines changed

server/app/services/products/views/codec.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def validate_output_data(data_dict: Dict, data_stream: DataStream,
273273
continue
274274
value = value_dict.get('value')
275275
time = value_dict.get('time')
276-
if isinstance(time, (int, float)):
276+
if not isinstance(time, (int, float)):
277277
error_dict[data_point_uid] = 'Not a valid time'
278278
if not validate_data_type(point_type, value):
279279
error_dict[data_point_uid] = 'Not a valid value type'
@@ -292,7 +292,7 @@ def validate_data_type(point_type: int, value: Any) -> bool:
292292
:return: True if valid else False
293293
"""
294294
validate_result = True
295-
if (point_type in (1, 4)) and isinstance(value, (int, float)):
295+
if (point_type in (1, 4)) and not isinstance(value, (int, float)):
296296
validate_result = False
297297
elif point_type == 2 and not isinstance(value, str):
298298
validate_result = False

0 commit comments

Comments
 (0)