Spaces:
Sleeping

taha454 commited on
Commit
7da974d
·
1 Parent(s): ec1cbf7

debug mqtt

Browse files
Files changed (1) hide show
  1. mqtt_manager.py +8 -4
mqtt_manager.py CHANGED
@@ -45,7 +45,7 @@ def mqtt_listener():
45
 
46
  client = mqtt.Client()
47
  client.connect(mqtt_broker, mqtt_port)
48
-
49
 
50
  # اشترك في كل الردود
51
  for tl_id in state.singlas_state.keys():
@@ -73,9 +73,13 @@ def mqtt_publisher_loop(tl_id):
73
  last_state = current_state
74
 
75
  '''
76
- if current_state != state.status_free:
77
- topic = topic_msg(tl_id)
78
- pub_client.publish(topic, current_state)
 
 
 
 
79
 
80
  time.sleep(.01)
81
 
 
45
 
46
  client = mqtt.Client()
47
  client.connect(mqtt_broker, mqtt_port)
48
+
49
 
50
  # اشترك في كل الردود
51
  for tl_id in state.singlas_state.keys():
 
73
  last_state = current_state
74
 
75
  '''
76
+ print(current_state)
77
+ if current_state != last_state:
78
+ if current_state != state.status_free:
79
+ topic = topic_msg(tl_id)
80
+ pub_client.publish(topic, current_state)
81
+ last_state = current_state
82
+
83
 
84
  time.sleep(.01)
85