Skip to content

Commit

Permalink
revert 4-20 measurement naming to keep rule of using '_' for name par…
Browse files Browse the repository at this point in the history
…t separation (4-20_1_current -> name_position_measurement)
  • Loading branch information
ftylitak committed May 31, 2024
1 parent e434a8f commit f7464d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions insighioNode/apps/demo_console/scenario_advind_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ def measure_4_20_mA_on_port(measurements, port_id):
raw_mV = analog_generic.get_reading(sensor_out_pin)
current_mA = round((raw_mV / (cfg.get("_SHUNT_OHMS") * cfg.get("_INA_GAIN"))) * 100) / 100
logging.debug("ANLG SENSOR @ pin {}: {} mV, Current = {} mA".format(sensor_out_pin, raw_mV, current_mA))
set_value_float(measurements, "4_20_{}_current".format(port_id), current_mA, SenmlSecondaryUnits.SENML_SEC_UNIT_MILLIAMPERE)
set_value_float(measurements, "4-20_{}_current".format(port_id), current_mA, SenmlSecondaryUnits.SENML_SEC_UNIT_MILLIAMPERE)

execute_transformation(measurements, "4_20_{}_current".format(port_id), current_mA, port_formula)
execute_transformation(measurements, "4-20_{}_current".format(port_id), current_mA, port_formula)

gpio_handler.set_pin_value(sensor_on_pin, 0)
gpio_handler.set_pin_value(cfg.get("_UC_IO_CUR_SNS_ON"), 0)
Expand Down

0 comments on commit f7464d4

Please sign in to comment.