ERROR_CODES = {
    "-40401": "Invalid stok value",
    "-64324": "Privacy mode is ON, not able to execute",
    "-64302": "Preset ID not found",
    "-64321": "Preset ID was deleted so no longer exists",
    "-40105": "Method does not exist",
    "-40101": "Parameter to set does not exist",
    "-40209": "Invalid login credentials",
    "-64304": "Maximum Pan/Tilt range reached (MOTOR_LOCKED_ROTOR)",
    "-71103": "User ID is not authorized (USER_ID_INVALID)",
    "72102": "Quick response id not found (NOT_EXIST_QUICK_RESPONSE)",
    "-90404": "CAMERA_UPDATE_LOW_ENERGY",
    "-63103": "DEVICE_NAME_EXCESSIVE",
    "-100004": "MEDIA_SDK_INNER_RETRY_ERROR_CODE",
    "-40210": "METHOD_DO_NOT_EXIST",
    "-64303": "MOTOR_BUSY",
    "-64336": "MOTOR_PRIVATE_AREA",
    "-71105": "PLAYBACK_SEARCH_FAILED",
    "-64305": "PRESET_ADD_MOVING",
    "-64306": "PRESET_SATURATED",
    "-52409": "SD_CARD_UNPLUGGED",
    "-71114": "STORAGE_NOT_EXIST",
    "-71115": "STORAGE_SD_LOADING",
    "-52411": "TALK_IS_USED",
    "-52407": "TOO_MANY_CLIENT",
    "-52419": "TOO_MANY_HTTPS_CLIENT",
    "-52405": "TOO_MANY_REQUEST",
    "-71102": "USER_ID_EMPLOYED",
    "-71101": "USER_ID_FULL",
    "-52402": "VOD_INVALID_REQUEST",
    "-40412": "HOMEKIT_LOGIN_FAIL",
    "-40404": "DEVICE_BLOCKED",
    "-40405": "DEVICE_FACTORY",
    "-40406": "OUT_OF_LIMIT",
    "-40407": "OTHER_ERROR",
    "-40408": "SYSTEM_BLOCKED",
    "-40409": "NONCE_EXPIRED",
    "-90000": "FFS_NONE_PWD",
    "-90001": "TSS_NONE_PWD",
    "40108": "TIMEOUT_ERROR",
    "-40106": "UNSUPPORTED_METHOD",
    "-40109": "ONE_SECOND_REPEAT_REQUEST",
    "-40413": "INVALID_NONCE",
    "-40414": "NEED_LOGIN_BY_LOCAL_PASSWORD",
    "-40418": "TPAP_AUTHENTICATION_FAILED",
    "-40420": "TPAP_SLP_AUTH_TAG_SIG_FAIL",
    "-40421": "TPAP_SESSION_TOKEN_INVALID",
    "-40211": "MISSING_NECESSARY_PARAMS",
    "-40203": "BIND_SENSOR_EXISTS",
    "-40321": "IP_CONFLICT",
    "-60506": "LOCAL_ACCOUNT_OLD_PWD_ERROR",
    "-69051": "DIAGNOSE_TYPE_NOT_SUPPORT",
    "-69052": "DIAGNOSE_TASK_FULL",
    "-69053": "DIAGNOSE_TASK_BUSY",
    "-69055": "DIAGNOSE_INTERNAL_ERROR",
    "-69056": "DIAGNOSE_ID_NOT_FOUND",
    "-69057": "DIAGNOSE_TASK_NULL",
    "-69060": "CLOUD_LINK_DOWN",
    "-69061": "ONVIF_SET_WRONG_TIME",
    "-69062": "CLOUD_NTP_NO_RESPONSE",
    "-69063": "CLOUD_GET_WRONG_TIME",
    "-69064": "SNTP_SRV_NO_RESPONSE",
    "-69065": "SNTP_GET_WRONG_TIME",
    "-69076": "LINK_UNCONNECTED",
    "-69077": "WIFI_SIGNAL_WEAK",
    "-69078": "LOCAL_NETWORK_POOR",
    "-69079": "CLOUD_NETWORK_POOR",
    "-69080": "INTER_NETWORK_POOR",
    "-69081": "DNS_TIMEOUT",
    "-69082": "DNS_ERROR",
    "-69083": "PING_NO_RESPONSE",
    "-69084": "DHCP_MULTI_SERVER",
    "-69085": "DHCP_ERROR",
    "-69094": "STREAM_SESSION_CLOSE",
    "-69095": "STREAM_BITRATE_EXCEPTION",
    "-69096": "STREAM_FULL",
    "-69097": "STREAM_NO_INTERNET",
    "-72101": "HARDWIRED_NOT_FOUND",
    "-80101": "ENCRYPT_NOT_SUPPORT",
    "-1103": "ACCOUNT_NOT_BIND_TO_DEVICE",
    "-53423": "ALGORITHMS_ERROR",
    "-52423": "AUDIO_PARAMS_INVALID",
    "-5015": "CLOUD_ANOMALY",
    "-100007": "CLS_VALID_PSK",
    "-10001": "CONNECTION_ERROR",
    "-10003": "DEVICE_CONTEXT_NOT_EXIST",
    "-10004": "DEVICE_NOT_LOCAL",
    "-1007": "DEVICE_OFFLINE",
    "-3": "DIGEST_AUTHORIZE_FAIL",
    "-20675": "ERROR_ACCOUNT_SQUEEZED_OFFLINE",
    "-1101": "ERROR_CONNECTION_CLOSED",
    "-20002": "ERROR_DEVICE_OFFLINE",
    "-1014": "ERROR_RELAY_NODE_UNREACHABLE",
    "15006": "ERROR_THING_IS_OFFLINE",
    "-52212": "FLOW_UPPER_LIMIT_REACHED",
    "-53422": "IMAGE_STORAGE_ERROR",
    "-53420": "IMAGE_TOO_LARGE",
    "-10002": "INVALID_DATA",
    "-53421": "INVALID_IMAGE_PARAM",
    "-100002": "NVR_LOGIN_PASSWORD_EMPTY",
    "-100003": "P2P_NOT_READY",
    "-100006": "RELAY_DATA_TIMEOUT",
    "-100001": "RELAY_REQUEST_LIMIT",
    "-100005": "RELAY_REQUEST_TIMEOUT",
    "42": "RESPONSE_FOR_APP_CLOSE_REASON_DATA_TIMEOUT_ERROR_CODE",
    "38": "RESPONSE_FOR_APP_CLOSE_REASON_ERROR_CODE",
    "39": "RESPONSE_FOR_APP_CLOSE_REASON_EXIT_ERROR_CODE",
    "41": "RESPONSE_FOR_APP_CLOSE_REASON_REQUEST_TIMEOUT_ERROR_CODE",
    "40": "RESPONSE_FOR_APP_CLOSE_REASON_USE_HIGH_PRIORITY_CONNECTION_ERROR_CODE",
    "-120004": "RTC_CONNECT_ERROR",
    "-120002": "RTC_NO_ROUTE_TO_HOST",
    "-120003": "RTC_SOCKET_TIMEOUT",
    "-120005": "RTC_SWAP_OFFER_TIMEOUT",
    "-120001": "RTC_UNKNOWN_HOST",
    "-1104": "SD_CARD_OFFLINE",
    "-52422": "SD_CARD_UNUSABLE",
    "-10100": "SFU_DEGRADE_TO_RELAY",
    "-2001": "STREAM_DATA_DECRYPT_ERROR",
    "-101": "STREAM_MIME_CHANGE",
    "-1102": "TOKEN_INVALID",
    "-52435": "VOD_SESSION_FULL",
    "-52417": "VOD_SESSION_OCCUPIED",
    "-53001": "WEBRTC_SESSION_ERROR_CREATE_FAIL",
    "-53004": "WEBRTC_SESSION_ERROR_PORT_FAIL",
    "-53002": "WEBRTC_SESSION_ERROR_PREPARE_FAIL",
    "-53003": "WEBRTC_SESSION_ERROR_UPNP_FAIL",
    "-2": "ERR_CODE_NO_AVAILABLE_TRANSPORT",
    "-1": "ERR_CODE_NULL_TRANSPORT",
    "401": "UNAUTHORIZED",
    "-2099": "UNKNOWN_ERROR",
}
MAX_LOGIN_RETRIES = 1


class EncryptionMethod:
    MD5 = "md5"
    SHA256 = "sha256"
