creates a telnet connection to the lightpad

def __telnet_event_listener(self, ip, callback):
        """creates a telnet connection to the lightpad"""

        tn = telnetlib.Telnet(ip, 2708)
        self._last_event = ""
        self._telnet_running = True
        while self._telnet_running:
            try:
                raw_string = tn.read_until(b'.\n', 5)

                if len(raw_string) >= 2 and raw_string[-2:] == b'.\n':
                    # lightpad sends ".\n" at the end that we need to chop off
                    json_string = raw_string.decode('ascii')[0:-2]
                    if json_string != self._last_event:
                        callback(json.loads(json_string))

                    self._last_event = json_string

            except:
                pass
        tn.close()