   appl2.switchOff()
   appl2.display_state()
   appl.display_state()
-  print appl.currentState()
+  print '#',appl.currentState()
   assert((-> appl.currentState() is "ON"),appl.name,appl.currentState())
   assert((-> appl2.currentState() is "OFF"),appl2.name,appl2.currentState())
   write_json("myfile.txt",[appl,appl2])

  assert((-> list[1].name is "light2"),"read_json",list[0].name)
  assert((-> list[0].currentState() is "ON"),"read_json",list[0].currentState())
  assert((-> list[1].currentState() is "OFF"),"read_json",list[0].currentState())
  print 'Tests passed'

# ---- Parse the command line

  # state_machines
  list = []
  for obj in state_machines
    for name,values of obj
      [state,states] = values
      appl = new HeyuAppliance(name, states: states)
      appl.changeState('any',state)
    list.push appl
  list

