Skip to content

Commit

Permalink
Refactored to use report strategy instead of send data only on change
Browse files Browse the repository at this point in the history
  • Loading branch information
imbeacon committed Oct 30, 2024
1 parent 4a96aab commit f8ec479
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def test_send_only_on_data_changed(self):
"""
Test the send_only_on_data_changed method.
This method tests the behavior of the send_only_on_data_changed method in the MyClass class.
This method tests the behavior of the report strategy on change behavior.
The method performs the following steps:
1. Changes the connector configuration using the change_connector_configuration method with
the specified configuration file.
Expand All @@ -138,7 +138,7 @@ def test_send_only_on_data_changed(self):
"""

(config, _) = self.change_connector_configuration(
self.CONFIG_PATH + 'configs/initial_modbus_uplink_converter_only_on_change_config.json')
self.CONFIG_PATH + 'configs/initial_modbus_uplink_converter_report_strategy_on_change.json')
telemetry_keys = [key['tag'] for slave in config['Modbus']['configurationJson']['master']['slaves'] for key in
slave['timeseries']]
actual_values = self.client.get_latest_timeseries(self.device.id, ','.join(telemetry_keys))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
"pollPeriod": 1000,
"unitId": 1,
"deviceName": "Temp Sensor",
"sendDataOnlyOnChange": true,
"reportStrategy": {
"type": "ON_CHANGE"
},
"connectAttemptTimeMs": 5000,
"connectAttemptCount": 5,
"waitAfterFailedAttemptsMs": 300000,
Expand Down

0 comments on commit f8ec479

Please sign in to comment.