'Establish a telnet connection and sends command.'

def telnet_command(self, command):

    try:
        try:
            telnet = telnetlib.Telnet(self._host, self._port, self._timeout)
        except (ConnectionRefusedError, OSError):
            _LOGGER.warning('Pioneer    %s    refused    connection', self._name)
            return
        telnet.write((command.encode('ASCII') + '\r'))
        telnet.read_very_eager()
        telnet.close()
    except telnetlib.socket.timeout:
        _LOGGER.debug('Pioneer    %s    command    %s    timed    out', self._name, command)
