gursi26 commited on
Commit
d414f4c
·
1 Parent(s): a64da8a

how about now

Browse files
Files changed (1) hide show
  1. app.py +11 -10
app.py CHANGED
@@ -111,18 +111,19 @@ elif st.session_state.selected_command == "control/gripper":
111
  speed = st.slider("Speed", 1, 100, 50)
112
  args = {"gripper_value": gripper_value, "speed": speed}
113
 
 
 
 
 
 
 
 
 
 
 
 
114
  with st.form("mqtt_form"):
115
  if st.form_submit_button("Send Command"):
116
- if "client" not in st.session_state:
117
- st.session_state.client = create_paho_client()
118
- setup_paho_client(
119
- st.session_state.client,
120
- HIVEMQ_USERNAME,
121
- HIVEMQ_PASSWORD,
122
- HIVEMQ_HOST,
123
- PORT,
124
- DEVICE_ID
125
- )
126
 
127
  payload = {"command": st.session_state.selected_command, "args": args}
128
  st.markdown("### Payload")
 
111
  speed = st.slider("Speed", 1, 100, 50)
112
  args = {"gripper_value": gripper_value, "speed": speed}
113
 
114
+ if "client" not in st.session_state:
115
+ st.session_state.client = create_paho_client()
116
+ setup_paho_client(
117
+ st.session_state.client,
118
+ HIVEMQ_USERNAME,
119
+ HIVEMQ_PASSWORD,
120
+ HIVEMQ_HOST,
121
+ PORT,
122
+ DEVICE_ID
123
+ )
124
+
125
  with st.form("mqtt_form"):
126
  if st.form_submit_button("Send Command"):
 
 
 
 
 
 
 
 
 
 
127
 
128
  payload = {"command": st.session_state.selected_command, "args": args}
129
  st.markdown("### Payload")