From 961a54bf65777ac6845252080241d49ede2ddf2f Mon Sep 17 00:00:00 2001 From: sanjayk03-dev Date: Sun, 31 Aug 2025 16:50:00 +0530 Subject: [PATCH] fixed state notify --- src/py/bbctrl/Web.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/py/bbctrl/Web.py b/src/py/bbctrl/Web.py index 307cfe0..8ec9128 100644 --- a/src/py/bbctrl/Web.py +++ b/src/py/bbctrl/Web.py @@ -733,7 +733,16 @@ class RotaryHandler(bbctrl.APIHandler): for key, value in rotary_config.items(): motor_2[key] = value + # Save the configuration using the standard Config.save method + # This ensures proper encoding and state updates config.save(config_data) + + # Force a complete reload to ensure all values are properly encoded and sent to frontend + config.reload() + + # Explicitly trigger state notification to ensure frontend gets updates + # This forces immediate WebSocket notification of all state changes + ctrl.state._notify() except FileNotFoundError: log.error('Configuration file not found at {}'.format(path))