'Returns KODI JSON-RPC API version (odd # = dev, even # = stable)
Sends a request to the KODI host using the JSON-RPC to determine if
the legacy API or if the JSON-RPC API functions should be used.
Fallback to testing legacy HTTPAPI before assuming it is just a badly configured host.
Args:
host: KODI webserver host:port
username: KODI webserver username
password: KODI webserver password
Returns:
Returns API number or False
List of possible known values:
API | KODI Version
2  | v10 (Dharma)
3  | (pre Eden)
4  | v11 (Eden)
5  | (pre Frodo)
6  | v12 (Frodo) / v13 (Gotham)'

def _get_kodi_version(self, host, username, password):

    socket.setdefaulttimeout(10)
    checkCommand = u'{"jsonrpc":"2.0","method":"JSONRPC.Version","id":1}'
    result = self._send_to_kodi_json(checkCommand, host, username, password)
    socket.setdefaulttimeout(sickrage.srCore.srConfig.SOCKET_TIMEOUT)
    if (not result):
        testCommand = {u'command': u'Help'}
        request = self._send_to_kodi(testCommand, host, username, password)
        if request:
            return 1
        else:
            return False
    return result[u'result'][u'version']
