tjhowse / modbus4mqtt

Modbus TCP <-> MQTT glue. YAML configuration. Robust.
Other
75 stars 33 forks source link

Default register values should be set when the YAML is loaded, not anywhere they're accessed #31

Open tjhowse opened 3 years ago

tjhowse commented 3 years ago

Any optional value of a register should be set to its default value in the for register in self.registers: loop in mqtt_interface.__init__(), rather than using register.get(field, 'default') throughout the code. The defaults for each register value should be declared in a top-level CONST map.