export declare const GOVEE_APP_VERSION = "7.4.10"; export declare const GOVEE_USER_AGENT = "GoveeHome/7.4.10 (com.ihoment.GoVeeSensor; build:8; iOS 26.5.0) Alamofire/5.11.0"; export declare const GOVEE_API_URLS: { readonly login: "https://app2.govee.com/account/rest/account/v2/login"; readonly verification: "https://app2.govee.com/account/rest/account/v1/verification"; readonly loginTTR: "https://community-api.govee.com/os/v1/login"; readonly logout: "https://app2.govee.com/account/rest/account/v1/logout"; readonly devices: "https://app2.govee.com/device/rest/devices/v1/list"; readonly iotKey: "https://app2.govee.com/app/v1/account/iot/key"; readonly tapToRuns: "https://app2.govee.com/bff-app/v1/exec-plat/home"; readonly leakWarning: "https://app2.govee.com/leak/rest/device/v1/warnMessage"; }; export declare const GOVEE_STATUS_NEW_DEVICE = 454; /** * Thrown when Govee requires a one-time email verification code before it will * issue a token for this client (the "new device" 2FA challenge). When this is * raised, a code has already been requested and emailed to the user; they need * to paste it into the plugin config and log in again. */ export declare class GoveeTwoFactorRequiredError extends Error { readonly code = "GOVEE_2FA_REQUIRED"; constructor(message: string); } /** * Thrown when a verification code was supplied but Govee rejected it (wrong or * expired). A fresh code has NOT been requested — the user should re-check the * email they already received, or clear the code to trigger a new one. */ export declare class GoveeTwoFactorInvalidError extends Error { readonly code = "GOVEE_2FA_INVALID"; constructor(message: string); } export interface GoveeLoginResult { token: string; clientId: string; accountId: string; } export interface GoveeDevice { device: string; deviceName: string; sku: string; } export declare function generateClientId(username: string): string; /** * Build a diagnostic error for a login response that came back without an * account token. Govee sometimes returns HTTP 200 with a body that is not the * expected `{ client: { token } }` shape — e.g. when the account needs * attention in the Govee Home app (an email-verification code or accepting * updated terms), or when the account is served by a regional backend this * plugin does not target. The old generic "no token received" message hid all * of that; this surfaces the HTTP status and the raw body so the failure is * actually diagnosable from the config UI and the Homebridge log. */ export declare function buildLoginFailureError(res: { status?: number; data?: unknown; }): Error; /** * Build standard Govee API headers */ export declare function goveeHeaders(token: string, clientId: string): Record; /** * Headers for the pre-authentication endpoints (login, verification) that run * before an account token exists. */ export declare function goveePreAuthHeaders(clientId: string): Record; /** * Ask Govee to email a one-time login verification code to the account. Called * after a login returns {@link GOVEE_STATUS_NEW_DEVICE} so the user has a code * to paste back into the plugin config. */ export declare function goveeRequestVerificationCode(username: string, clientId?: string): Promise; export declare function goveeLogin(username: string, password: string, code?: string): Promise; export declare function goveeGetDevices(token: string, clientId: string): Promise;