new_contents: #!/usr/bin/env python
  """
  sms.py - Used to send txt messages.
  """
  import config
  import serial
  import time
  
  class Sms:
      def __init__(self, recipient=config.recipient, message=config.message):
          self.recipient = recipient
          self.content = message
  
      def setRecipient(self, number):
          self.recipient = number
  
      def setContent(self, message):
          self.content = message
  
      def connectPhone(self):
          self.ser = serial.Serial(config.serial, 460800, timeout=5)
          time.sleep(1)
  
      def sendMessage(self):
          self.ser.write('ATZ\r')
          time.sleep(1)
          self.ser.write('AT+CMGF=1\r')
          time.sleep(1)
          self.ser.write('''AT+CMGS="''' + self.recipient + '''"\r''')
          time.sleep(1)
          self.ser.write(self.content + "\r")
          time.sleep(1)
          self.ser.write(chr(26))
          time.sleep(1)
  
      def disconnectPhone(self):
          self.ser.close()
subject: add sms