from random import *
import lcm

from lilylcm import L06Depth
from lilylcm import L07Humidity
from lilylcm import L08Temperature
from lilylcm import L14LEDs
from lilylcm import L16ChargerCommand
from lilylcm import L19DockCommand

lc = lcm.LCM()

msg6 = L06Depth()
msg7 = L07Humidity()
msg8 = L08Temperature()
msg14 = L14LEDs()
msg16 = L16ChargerCommand()
msg19 = L19DockCommand()

while True:
  
  i = randint(1,4)
  
  msg6.depth = randint(0, 100)
  msg7.humidity = randint(0, 100)
  msg8.temperature = randint(0, 500)
  
  if i == 1:
    msg14.switchOn = True
    msg16.targetState = "Boobies"
    msg19.switchOn = True
    
  elif i == 2:
    msg14.switchOn = True
    msg16.targetState = "Poopie"
    msg19.switchOn = False
    
  elif i == 3:
    msg14.switchOn = False
    msg16.targetState = "Peepee"
    msg19.switchOn = True
    
  elif i == 4:
    msg14.switchOn = False
    msg16.targetState = "Bootie"
    msg19.switchOn = False
    
  lc.publish("POD_Depth",  msg6.encode())
  lc.publish("09I2C_HUMIDITY",  msg7.encode())
  lc.publish("09I2C_TEMP",  msg8.encode())
  lc.publish("POD_LED",  msg14.encode())
  lc.publish("POD_Charge",  msg16.encode())
  lc.publish("POD_Magnet",  msg19.encode())

@@ -374,17 +374,23 @@
 mmand()%0A
-%0A
+try:%0A  
 while Tr
@@ -396,16 +396,18 @@
 rue:%0A  %0A
+  
   i = ra
@@ -420,16 +420,18 @@
 1,4)%0A  %0A
+  
   msg6.d
@@ -449,24 +449,26 @@
 int(0, 100)%0A
+  
   msg7.humid
@@ -489,16 +489,18 @@
 0, 100)%0A
+  
   msg8.t
@@ -531,16 +531,18 @@
 500)%0A  %0A
+  
   if i =
@@ -546,16 +546,18 @@
 i == 1:%0A
+  
     msg1
@@ -570,32 +570,34 @@
 chOn = True%0A    
+  
 msg16.targetStat
@@ -610,24 +610,26 @@
 oobies%22%0A    
+  
 msg19.switch
@@ -635,32 +635,34 @@
 hOn = True%0A    %0A
+  
   elif i == 2:%0A 
@@ -660,24 +660,26 @@
 i == 2:%0A    
+  
 msg14.switch
@@ -684,24 +684,26 @@
 chOn = True%0A
+  
     msg16.ta
@@ -719,24 +719,26 @@
  = %22Poopie%22%0A
+  
     msg19.sw
@@ -753,24 +753,26 @@
  False%0A    %0A
+  
   elif i == 
@@ -774,16 +774,18 @@
 i == 3:%0A
+  
     msg1
@@ -795,32 +795,34 @@
 witchOn = False%0A
+  
     msg16.target
@@ -838,24 +838,26 @@
 Peepee%22%0A    
+  
 msg19.switch
@@ -870,17 +870,21 @@
 rue%0A    
-%0A
+  %0A  
   elif i
@@ -890,24 +890,26 @@
 i == 4:%0A    
+  
 msg14.switch
@@ -915,24 +915,26 @@
 hOn = False%0A
+  
     msg16.ta
@@ -954,24 +954,26 @@
 Bootie%22%0A    
+ 
+ 
 msg19.switch
@@ -988,16 +988,18 @@
 se%0A    %0A
+  
   lc.pub
@@ -1024,32 +1024,34 @@
  msg6.encode())%0A
+  
   lc.publish(%2209
@@ -1075,32 +1075,34 @@
 sg7.encode())%0A  
+ 
+ 
 lc.publish(%2209I2
@@ -1118,32 +1118,34 @@
  msg8.encode())%0A
+  
   lc.publish(%22PO
@@ -1161,32 +1161,34 @@
 msg14.encode())%0A
+  
   lc.publish(%22PO
@@ -1217,16 +1217,18 @@
 de())%0A  
+ 
+ 
 lc.publi
@@ -1253,16 +1253,50 @@
 msg19.encode())%0A
+%0Aexcept KeyboardInterrupt:%0A  pass%0A

Update test.py