diff --git a/src/RSIPI/rsi_client.py b/src/RSIPI/rsi_client.py index 85bd379..7ec9254 100644 --- a/src/RSIPI/rsi_client.py +++ b/src/RSIPI/rsi_client.py @@ -62,6 +62,26 @@ class RSIClient: logging.info("✅ RSI Client Stopped") print("✅ RSI Client Stopped") + def update_send_variable(self, name, value): + print(f"[DEBUG] update_send_variable called with: {name} = {value}") + if "." in name: + parent, child = name.split(".", 1) + if parent in self.send_variables and isinstance(self.send_variables[parent], dict): + self.send_variables[parent][child] = value + print(f"[DEBUG] Current send_variables: {dict(self.send_variables)}") + return f"✅ Updated {name} to {value}" + else: + return f"❌ Variable '{name}' not found or not structured correctly" + else: + if name in self.send_variables: + self.send_variables[name] = value + return f"✅ Updated {name} to {value}" + print(f"[DEBUG] EStr value after update: {self.send_variables.get('EStr')}") + print(f"[DEBUG] Current send_variables: {dict(self.send_variables)}") + else: + return f"❌ Variable '{name}' not found in send_variables" + + if __name__ == "__main__": config_file = "RSI_EthernetConfig.xml" client = RSIClient(config_file)