diff --git a/CHANGELOG.md b/CHANGELOG.md index 99fbe6ed..ca01a52f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - replaced true with 1 in SQL statements of myems-api. - updated user insert sql statement for failed_login_count. - updated icons for vertical menu items. +- updated acquisition procedure of myems-modbus-tcp. ### Fixed - fixed typo in virtualmetercarbon. diff --git a/myems-modbus-tcp/acquisition.py b/myems-modbus-tcp/acquisition.py index d0f49dc7..83c1bf6f 100644 --- a/myems-modbus-tcp/acquisition.py +++ b/myems-modbus-tcp/acquisition.py @@ -194,18 +194,15 @@ def process(logger, data_source_id, host, port): value = result[0] if point['object_type'] == 'ANALOG_VALUE': - analog_value_list.append({'data_source_id': data_source_id, - 'point_id': point['id'], + analog_value_list.append({'point_id': point['id'], 'is_trend': point['is_trend'], 'value': Decimal(value) * point['ratio']}) elif point['object_type'] == 'ENERGY_VALUE': - energy_value_list.append({'data_source_id': data_source_id, - 'point_id': point['id'], + energy_value_list.append({'point_id': point['id'], 'is_trend': point['is_trend'], 'value': Decimal(value) * point['ratio']}) elif point['object_type'] == 'DIGITAL_VALUE': - digital_value_list.append({'data_source_id': data_source_id, - 'point_id': point['id'], + digital_value_list.append({'point_id': point['id'], 'is_trend': point['is_trend'], 'value': int(value) * int(point['ratio'])})