Versions in this module Expand all Collapse all v0 v0.4.0 Oct 11, 2026 Changes in this version + var ErrTPAPAuth = errors.New("the device refused the password (TPAP)") + var ErrTPAPDeviceProof = errors.New("the device could not prove it knows the password (TPAP)") + var ErrTPAPLocked = errors.New("the device is locked after too many failed TPAP logins") + var ErrTPAPUnsupported = errors.New("the device asks for a TPAP variant this module does not support") + func TPAPPasscode(password string, extraCrypt map[string]any, camera bool) (string, error) + func TPAPPasscodeSHA1(password string) string + type TPAPCipher struct + func NewTPAPCipher(sharedKey []byte) (*TPAPCipher, error) + func (t *TPAPCipher) Open(seq int32, body []byte) ([]byte, error) + func (t *TPAPCipher) Seal(seq int32, plain []byte) []byte + type TPAPClient struct + Base string + Camera bool + HTTP *http.Client + PasscodeType string + Password string + func (t *TPAPClient) Call(ctx context.Context, method string, params any) (map[string]any, error) + func (t *TPAPClient) Handshake(ctx context.Context) error + func (t *TPAPClient) Send(ctx context.Context, req any) (map[string]any, error) + type TPAPInfo struct + DAC int + NOC int + Pake []int + Port int + TLS int + func ParseTPAPInfo(v any) (TPAPInfo, error) + func TPAPCameraInfo() TPAPInfo + func TPAPDiscover(ctx context.Context, hc *http.Client, base string) (*TPAPInfo, error) + func (i TPAPInfo) BaseURL(host string) string + func (i TPAPInfo) PasscodeType() (string, error) + type TPAPVerifier struct + func NewTPAPVerifier(passcode string, salt []byte, iterations int, userRandom, devRandom []byte) (*TPAPVerifier, error) + func (t *TPAPVerifier) Finish(userShare, userConfirm []byte) (devConfirm, sharedKey []byte, err error) + func (t *TPAPVerifier) Share() []byte type TapoFound + TPAP *TPAPInfo v0.3.0 Oct 11, 2026 Changes in this version + const ConsumableChargeContacts + const ConsumableFilter + const ConsumableMainBrush + const ConsumableMainBrushLid + const ConsumableMop + const ConsumableSensor + const ConsumableSideBrush + const EveryDay + const Friday + const Monday + const NightVisionFullColor + const NightVisionInfrared + const NightVisionSmart + const Saturday + const ScheduleAtTime + const ScheduleSunrise + const ScheduleSunset + const Sunday + const Thursday + const Tuesday + const Wednesday + const Weekdays + const Weekend + var ErrNoSingleRequests = errors.New("this camera path does not take single requests") + func CamSingle(ctx context.Context, c SmartCaller, verb, module string, body any) (map[string]any, error) + func TimezoneOffset(d time.Duration) string + type CamAlert struct + Duration string + Enabled bool + Modes []string + Raw map[string]any + Volume string + type CamConnection struct + Level int + Link string + RSSI int + SSID string + type CamDetection struct + Enabled bool + Raw map[string]any + Sensitivity string + type CamDetectionKind string + const DetectBabyCry + const DetectBark + const DetectGlassBreak + const DetectLineCrossing + const DetectMeow + const DetectMotion + const DetectPerson + const DetectPet + const DetectTamper + const DetectVehicle + func CamDetectionKinds() []CamDetectionKind + type CamDisk struct + FreeSpace string + Name string + Raw map[string]any + Status string + TotalSpace string + type CamInfo struct + Alias string + Battery *int + Charging bool + DeviceID string + FWVersion string + HWVersion string + LowBattery bool + MAC string + Model string + Power string + Raw map[string]any + Type string + func ParseCamInfo(bi map[string]any) CamInfo + type CamLastAlarm struct + Time time.Time + Type string + type CamPreset struct + ID string + Name string + type CamRecording struct + End time.Time + Start time.Time + Type int + type CamSiren struct + Active bool + Duration int + Sound string + Sounds []string + Volume int + type CamTime struct + Time time.Time + Timezone string + ZoneID string + type DustMode int + const DustBalanced + const DustLight + const DustMax + const DustSmart + type TapoCamera struct + Caller SmartCaller + ChildID string + func (c TapoCamera) Alert(ctx context.Context) (CamAlert, error) + func (c TapoCamera) Calibrate(ctx context.Context) error + func (c TapoCamera) Call(ctx context.Context, method string, params any) (map[string]any, error) + func (c TapoCamera) Components(ctx context.Context) (map[string]int, error) + func (c TapoCamera) Connection(ctx context.Context) (CamConnection, error) + func (c TapoCamera) DayNight(ctx context.Context) (string, error) + func (c TapoCamera) DeletePreset(ctx context.Context, ids ...string) error + func (c TapoCamera) Detection(ctx context.Context, kind CamDetectionKind) (CamDetection, error) + func (c TapoCamera) FormatSDCard(ctx context.Context) error + func (c TapoCamera) GotoPreset(ctx context.Context, id string) error + func (c TapoCamera) Info(ctx context.Context) (CamInfo, error) + func (c TapoCamera) LED(ctx context.Context) (bool, error) + func (c TapoCamera) LastAlarm(ctx context.Context) (CamLastAlarm, error) + func (c TapoCamera) ManualAlarm(ctx context.Context, start bool) error + func (c TapoCamera) Move(ctx context.Context, x, y int) error + func (c TapoCamera) MoveStep(ctx context.Context, angle int) error + func (c TapoCamera) NightVision(ctx context.Context) (string, error) + func (c TapoCamera) Presets(ctx context.Context) ([]CamPreset, error) + func (c TapoCamera) Privacy(ctx context.Context) (bool, error) + func (c TapoCamera) Reboot(ctx context.Context) error + func (c TapoCamera) RecordingDays(ctx context.Context, from, to time.Time, childID string) ([]string, error) + func (c TapoCamera) Recordings(ctx context.Context, from, to time.Time, start, end int, childID string) ([]CamRecording, error) + func (c TapoCamera) SDCards(ctx context.Context) ([]CamDisk, error) + func (c TapoCamera) SavePreset(ctx context.Context, name string) error + func (c TapoCamera) SetAlert(ctx context.Context, fields map[string]any) error + func (c TapoCamera) SetAlias(ctx context.Context, name string) error + func (c TapoCamera) SetDayNight(ctx context.Context, mode string) error + func (c TapoCamera) SetDetection(ctx context.Context, kind CamDetectionKind, on bool) error + func (c TapoCamera) SetDetectionConfig(ctx context.Context, kind CamDetectionKind, fields map[string]any) error + func (c TapoCamera) SetLED(ctx context.Context, on bool) error + func (c TapoCamera) SetNightVision(ctx context.Context, mode string) error + func (c TapoCamera) SetPrivacy(ctx context.Context, on bool) error + func (c TapoCamera) SetSiren(ctx context.Context, sound string, volume, duration int) error + func (c TapoCamera) SetTimezone(ctx context.Context, zoneID, offset string) error + func (c TapoCamera) Siren(ctx context.Context) (CamSiren, error) + func (c TapoCamera) SoundSiren(ctx context.Context, on bool) error + func (c TapoCamera) Time(ctx context.Context) (CamTime, error) + func (c TapoCamera) WifiScan(ctx context.Context) ([]WifiNetwork, error) + type TapoCountdownRule struct + Delay int + Enable bool + ID string + On bool + Remain int type TapoDevice + func (d TapoDevice) AddCountdown(ctx context.Context, delay int, on bool) (string, error) + func (d TapoDevice) AddScheduleRule(ctx context.Context, r TapoScheduleRule) (string, error) + func (d TapoDevice) CountdownRules(ctx context.Context) ([]TapoCountdownRule, error) + func (d TapoDevice) EditScheduleRule(ctx context.Context, r TapoScheduleRule) error + func (d TapoDevice) RemoveCountdowns(ctx context.Context) error + func (d TapoDevice) RemoveScheduleRules(ctx context.Context, ids ...string) error + func (d TapoDevice) ReplaceCountdown(ctx context.Context, delay int, on bool) (string, error) + func (d TapoDevice) ScheduleRules(ctx context.Context) ([]TapoScheduleRule, error) + type TapoScheduleRule struct + Days uint8 + Enable bool + ID string + Minute int + Offset int + On bool + Raw map[string]any + Start string + func ParseTapoScheduleRule(m map[string]any) TapoScheduleRule + type TapoVacuum struct + Caller SmartCaller + func (v TapoVacuum) AreaUnit(ctx context.Context) (VacuumAreaUnit, error) + func (v TapoVacuum) CarpetBoost(ctx context.Context) (bool, error) + func (v TapoVacuum) CleanRecords(ctx context.Context) (VacuumRecords, error) + func (v TapoVacuum) CleanRooms(ctx context.Context, mapID int64, rooms []int) error + func (v TapoVacuum) Consumables(ctx context.Context) (VacuumConsumables, error) + func (v TapoVacuum) DustCollection(ctx context.Context) (VacuumDustCollection, error) + func (v TapoVacuum) EmptyDustbin(ctx context.Context) error + func (v TapoVacuum) Locate(ctx context.Context) error + func (v TapoVacuum) Maps(ctx context.Context) (VacuumMaps, error) + func (v TapoVacuum) MopAttached(ctx context.Context) (bool, error) + func (v TapoVacuum) Pause(ctx context.Context) error + func (v TapoVacuum) ResetConsumable(ctx context.Context, name string) error + func (v TapoVacuum) Resume(ctx context.Context) error + func (v TapoVacuum) ReturnHome(ctx context.Context) error + func (v TapoVacuum) Rooms(ctx context.Context, mapID int64) ([]VacuumRoom, error) + func (v TapoVacuum) SetCarpetBoost(ctx context.Context, on bool) error + func (v TapoVacuum) SetCleanCount(ctx context.Context, n int) error + func (v TapoVacuum) SetDustCollection(ctx context.Context, d VacuumDustCollection) error + func (v TapoVacuum) SetSuction(ctx context.Context, s VacuumSuction) error + func (v TapoVacuum) SetVolume(ctx context.Context, volume int) error + func (v TapoVacuum) SetWaterLevel(ctx context.Context, w VacuumWater) error + func (v TapoVacuum) Start(ctx context.Context) error + func (v TapoVacuum) Status(ctx context.Context) (VacuumStatus, error) + func (v TapoVacuum) StopReturn(ctx context.Context) error + func (v TapoVacuum) Volume(ctx context.Context) (int, error) + type VacuumAreaUnit int + const AreaPing + const AreaSquareFeet + const AreaSquareMetres + type VacuumCleanMode int + const VacuumModeHome + const VacuumModeHomeCustom + const VacuumModePreset + const VacuumModeRooms + const VacuumModeSpot + const VacuumModeZones + type VacuumConsumables struct + ChargeContacts int + Filter int + MainBrush int + MainBrushLid int + Mop int + Sensor int + SideBrush int + Used map[string]int + type VacuumDustCollection struct + Auto bool + Mode DustMode + type VacuumMap struct + ID int64 + Locked bool + Name string + Saved bool + Updated int64 + type VacuumMaps struct + AutoChange bool + Current int64 + Maps []VacuumMap + type VacuumRecord struct + Area int + DustCollection bool + Error int + Index int + MapID int64 + Minutes int + StartType int + TaskType int + Timestamp int64 + type VacuumRecords struct + Last *VacuumRecord + Raw map[string]any + Records []VacuumRecord + TotalArea int + TotalCount int + TotalMinutes int + type VacuumRoom struct + CleanCount int + Color int + ID int + Name string + Suction VacuumSuction + Water VacuumWater + type VacuumStatus struct + Battery int + CleanArea int + CleanCount int + CleanMinutes int + CleanPercent int + Errors []int + Mapping bool + Mode VacuumCleanMode + Raw map[string]map[string]any + Relocating bool + Status VacuumStatusCode + Suction VacuumSuction + Water VacuumWater + Working bool + func (s VacuumStatus) Faulted() bool + type VacuumStatusCode int + const VacuumCharged + const VacuumCharging + const VacuumCleaning + const VacuumFault + const VacuumGoingHome + const VacuumIdle + const VacuumMapping + const VacuumPaused + const VacuumUndocked + func (s VacuumStatusCode) String() string + type VacuumSuction int + const SuctionMax + const SuctionQuiet + const SuctionStandard + const SuctionTurbo + const SuctionUltra + type VacuumWater int + const WaterHigh + const WaterLow + const WaterMedium + const WaterOff v0.2.0 Oct 11, 2026 Changes in this version + const DefaultBatchSize + const FadeOff + const FadeOn + const GentleOff + const GentleOn + const KLAPHTTPSPort + const KasaActionNone + const KasaActionOff + const KasaActionOn + const KasaTimeMinutes + const KasaTimeNone + const KasaTimeSunrise + const KasaTimeSunset + const LinkiePort + func CamChildList(ctx context.Context, c SmartCaller) ([]map[string]any, error) + func CamControlChild(ctx context.Context, c SmartCaller, deviceID, method string, params any) (map[string]any, error) + func CamDeviceInfo(ctx context.Context, c SmartCaller) (map[string]any, error) + func CamGet(ctx context.Context, c SmartCaller, method string, params map[string]any) (map[string]any, error) + func ChildComponents(ctx context.Context, c SmartCaller) (map[string]map[string]int, error) + func Components(ctx context.Context, c SmartCaller) (map[string]int, error) + func DecodeNickname(s string) string + func DecryptTapoAnswer(f *TapoFound, key *rsa.PrivateKey) error + func InsecureHTTP(timeout time.Duration) *http.Client + func IsKasaUnsupported(err error) bool + func SSLAESConfirm(cnonce, nonce, pwdHash string) string + func SSLAESDigest(cnonce, nonce, pwdHash string) string + func SSLAESKeys(cnonce, nonce, pwdHash string) (key, iv []byte) + func SSLAESPasswordHashes(password string) []string + func SSLAESTag(body []byte, cnonce, pwdHash string, seq int) string + func SealTapoDiscovery(pubPEM []byte, data any) (map[string]any, error) + func SmartList(ctx context.Context, c SmartCaller, method, listKey string, ...) ([]map[string]any, map[string]any, error) + type EnergyInterval int + const EnergyDaily + const EnergyHourly + const EnergyMonthly + type KasaCaller interface + KasaCall func(ctx context.Context, req any) (map[string]any, error) + type KasaConn struct + Addr string + Timeout time.Duration + func (k KasaConn) KasaCall(ctx context.Context, req any) (map[string]any, error) + type KasaDevice struct + Bulb bool + Caller KasaCaller + ChildID string + LightStrip bool + func NewKasaDevice(ctx context.Context, c KasaCaller) (*KasaDevice, map[string]any, error) + func (d *KasaDevice) AddRule(ctx context.Context, k KasaRuleKind, r KasaRule) (string, error) + func (d *KasaDevice) Child(id string) *KasaDevice + func (d *KasaDevice) CloudInfo(ctx context.Context) (map[string]any, error) + func (d *KasaDevice) DeleteAllRules(ctx context.Context, k KasaRuleKind) error + func (d *KasaDevice) DeleteRule(ctx context.Context, k KasaRuleKind, id string) error + func (d *KasaDevice) DimTo(ctx context.Context, brightness, ms int) error + func (d *KasaDevice) DimmerParameters(ctx context.Context) (map[string]any, error) + func (d *KasaDevice) EditRule(ctx context.Context, k KasaRuleKind, r KasaRule) error + func (d *KasaDevice) Emeter(ctx context.Context) (KasaEmeter, error) + func (d *KasaDevice) EmeterDays(ctx context.Context, year, month int) ([]KasaStat, error) + func (d *KasaDevice) EmeterMonths(ctx context.Context, year int) ([]KasaStat, error) + func (d *KasaDevice) EraseEmeter(ctx context.Context) error + func (d *KasaDevice) EraseRuntime(ctx context.Context) error + func (d *KasaDevice) FactoryReset(ctx context.Context) error + func (d *KasaDevice) FirmwareList(ctx context.Context) ([]map[string]any, error) + func (d *KasaDevice) LightDetails(ctx context.Context) (map[string]any, error) + func (d *KasaDevice) LightState(ctx context.Context) (map[string]any, error) + func (d *KasaDevice) NextAction(ctx context.Context) (map[string]any, error) + func (d *KasaDevice) Query(ctx context.Context, module, method string, params any) (map[string]any, error) + func (d *KasaDevice) Reboot(ctx context.Context, delay int) error + func (d *KasaDevice) Rules(ctx context.Context, k KasaRuleKind) (KasaRules, error) + func (d *KasaDevice) RuntimeDays(ctx context.Context, year, month int) ([]KasaStat, error) + func (d *KasaDevice) RuntimeMonths(ctx context.Context, year int) ([]KasaStat, error) + func (d *KasaDevice) SetAlias(ctx context.Context, alias string) error + func (d *KasaDevice) SetBrightness(ctx context.Context, b int) error + func (d *KasaDevice) SetDimmerFade(ctx context.Context, which string, ms int) error + func (d *KasaDevice) SetLED(ctx context.Context, on bool) error + func (d *KasaDevice) SetLight(ctx context.Context, l KasaLight) (map[string]any, error) + func (d *KasaDevice) SetLightingEffect(ctx context.Context, effect map[string]any) error + func (d *KasaDevice) SetPreferredState(ctx context.Context, state map[string]any) error + func (d *KasaDevice) SetRampRate(ctx context.Context, rate int) error + func (d *KasaDevice) SetRelay(ctx context.Context, on bool) error + func (d *KasaDevice) SetRulesEnabled(ctx context.Context, k KasaRuleKind, on bool) error + func (d *KasaDevice) Sysinfo(ctx context.Context) (map[string]any, error) + func (d *KasaDevice) Time(ctx context.Context) (time.Time, error) + func (d *KasaDevice) WifiJoin(ctx context.Context, ssid, password string, keyType int) error + func (d *KasaDevice) WifiScan(ctx context.Context) ([]WifiNetwork, error) + type KasaEmeter struct + CurrentMA float64 + PowerMW float64 + TotalWh float64 + VoltageMV float64 + func ParseKasaEmeter(r map[string]any) KasaEmeter + type KasaLight struct + Brightness *int + ColorTemp *int + Hue *int + On *bool + Saturation *int + TransitionMS int + type KasaModuleError struct + Code int + Method string + Module string + Msg string + func (e *KasaModuleError) Error() string + type KasaRule struct + Action int + Delay int + EAction int + EMin int + ETime int + Enable bool + ID string + Light map[string]any + Name string + Raw map[string]any + Repeat bool + SAction int + SMin int + STime int + WDay [7]bool + type KasaRuleKind int + const KasaAntiTheft + const KasaCountdown + const KasaSchedule + type KasaRules struct + Enable bool + Rules []KasaRule + type KasaStat struct + Day int + Month int + Value float64 + Year int + type LinkieClient struct + Base string + HTTP *http.Client + Password string + Username string + func (l *LinkieClient) KasaCall(ctx context.Context, req any) (map[string]any, error) + type SSLAESClient struct + Base string + HTTP *http.Client + Password string + Username string + func (s *SSLAESClient) Call(ctx context.Context, method string, params any) (map[string]any, error) + func (s *SSLAESClient) Handshake(ctx context.Context) error + func (s *SSLAESClient) Send(ctx context.Context, req any) (map[string]any, error) + type SSLClient struct + Base string + HTTP *http.Client + Password string + Username string + func (s *SSLClient) Call(ctx context.Context, method string, params any) (map[string]any, error) + type SmartRequest struct + Method string + Params any + type SmartResult struct + Err error + Method string + Result map[string]any + func MultiCall(ctx context.Context, c SmartCaller, reqs []SmartRequest, batch int) ([]SmartResult, error) + func MultiCallChild(ctx context.Context, c SmartCaller, deviceID string, reqs []SmartRequest) ([]SmartResult, error) + type TapoAutoOff struct + DelayMin int + Enable bool + type TapoAutoUpdate struct + Enable bool + RandomRange int + Time int + type TapoDevice struct + Caller SmartCaller + ChildID string + func (d TapoDevice) AutoOff(ctx context.Context) (TapoAutoOff, error) + func (d TapoDevice) AutoUpdate(ctx context.Context) (TapoAutoUpdate, error) + func (d TapoDevice) Call(ctx context.Context, method string, params any) (map[string]any, error) + func (d TapoDevice) Child(deviceID string) TapoDevice + func (d TapoDevice) Children(ctx context.Context) ([]TapoInfo, error) + func (d TapoDevice) CurrentPower(ctx context.Context) (float64, error) + func (d TapoDevice) DynamicEffects(ctx context.Context) (TapoRules, error) + func (d TapoDevice) EditPreset(ctx context.Context, index int, state map[string]any) error + func (d TapoDevice) Emeter(ctx context.Context) (TapoEmeter, error) + func (d TapoDevice) EnergyData(ctx context.Context, start, end time.Time, interval EnergyInterval) (TapoEnergyData, error) + func (d TapoDevice) EnergyUsage(ctx context.Context) (TapoEnergyUsage, error) + func (d TapoDevice) FactoryReset(ctx context.Context) error + func (d TapoDevice) FirmwareState(ctx context.Context) (TapoFirmwareState, error) + func (d TapoDevice) Info(ctx context.Context) (TapoInfo, error) + func (d TapoDevice) LED(ctx context.Context) (map[string]any, error) + func (d TapoDevice) LatestFirmware(ctx context.Context) (TapoFirmware, error) + func (d TapoDevice) LightingEffect(ctx context.Context) (map[string]any, error) + func (d TapoDevice) Presets(ctx context.Context) ([]map[string]any, error) + func (d TapoDevice) Reboot(ctx context.Context, delay int) error + func (d TapoDevice) Rules(ctx context.Context, kind TapoRuleKind) (TapoRules, error) + func (d TapoDevice) SetAccount(ctx context.Context, username, password string) error + func (d TapoDevice) SetAutoOff(ctx context.Context, a TapoAutoOff) error + func (d TapoDevice) SetAutoUpdate(ctx context.Context, a TapoAutoUpdate) error + func (d TapoDevice) SetDynamicEffect(ctx context.Context, id string, enable bool) error + func (d TapoDevice) SetLEDRule(ctx context.Context, rule string) error + func (d TapoDevice) SetLight(ctx context.Context, l TapoLight) error + func (d TapoDevice) SetLightingEffect(ctx context.Context, effect map[string]any) error + func (d TapoDevice) SetNickname(ctx context.Context, name string) error + func (d TapoDevice) SetOn(ctx context.Context, on bool) error + func (d TapoDevice) SetTransitions(ctx context.Context, version int, enable bool, onSecs, offSecs int) error + func (d TapoDevice) StartFirmwareUpdate(ctx context.Context) error + func (d TapoDevice) Time(ctx context.Context) (TapoTime, error) + func (d TapoDevice) Transitions(ctx context.Context) (map[string]any, error) + func (d TapoDevice) TriggerLogs(ctx context.Context, pageSize, startID int) ([]TriggerLog, error) + func (d TapoDevice) Usage(ctx context.Context) (TapoUsage, error) + func (d TapoDevice) WifiJoin(ctx context.Context, username, password, ssid, wifiPassword, keyType string) error + func (d TapoDevice) WifiScan(ctx context.Context) ([]WifiNetwork, error) + type TapoEmeter struct + CurrentMA float64 + EnergyWh float64 + PowerMW float64 + VoltageMV float64 + type TapoEnergyData struct + Interval EnergyInterval + LocalTime string + Raw map[string]any + Start time.Time + Wh []float64 + type TapoEnergyUsage struct + CurrentPower float64 + LocalTime string + MonthEnergy int + MonthRuntime int + TodayEnergy int + TodayRuntime int + type TapoFirmware struct + NeedUpgrade bool + ReleaseDate string + ReleaseNote string + Size int + Type int + Version string + func (f TapoFirmware) Available() bool + type TapoFirmwareState struct + AutoUpgrade bool + Progress int + RebootTime int + Status int + UpgradeTime int type TapoFound + Decrypted map[string]any + func (f TapoFound) BaseURL() string + type TapoInfo struct + Battery *int + Brightness *int + Category string + ColorTemp *int + Detected *bool + DeviceID string + FWVersion string + HWVersion string + Hue *int + Humidity *float64 + IP string + InAlarm *bool + LowBattery bool + MAC string + Model string + Nickname string + On *bool + OnTime int + Open *bool + Overheated bool + RSSI int + Raw map[string]any + Region string + Saturation *int + Status string + Temp *float64 + TempUnit string + Type string + func ParseTapoInfo(m map[string]any) TapoInfo + type TapoLight struct + Brightness *int + ColorTemp *int + Hue *int + On *bool + Saturation *int + type TapoPeriods struct + Past30 int + Past7 int + Today int + type TapoRuleKind string + const TapoAntitheft + const TapoCountdown + const TapoSchedule + type TapoRules struct + Enable bool + Max int + Rules []map[string]any + type TapoTime struct + Region string + TimeDiff int + Timestamp int64 + type TapoUsage struct + Power TapoPeriods + Saved TapoPeriods + Time TapoPeriods + type TriggerLog struct + Event string + EventID string + ID int + Params map[string]any + Timestamp int64 + type WifiNetwork struct + BSSID string + Channel int + CipherType int + KeyType string + SSID string + SignalLevel int v0.1.0 Oct 11, 2026 Changes in this version + const KasaPort + const TapoPort + var ErrKLAPAuth = errors.New("the device refused the TP-Link account credentials") + var ErrNotSmart = errors.New("the device did not answer the Tapo request") + func AuthHash(username, password string) []byte + func AuthHashV1(username, password string) []byte + func CheckTapoProbe(b []byte) ([]byte, error) + func ChildList(ctx context.Context, c SmartCaller) ([]map[string]any, error) + func ControlChild(ctx context.Context, c SmartCaller, deviceID, method string, params any) (map[string]any, error) + func Decrypt(cipher []byte) []byte + func Encrypt(plain []byte) []byte + func Frame(plain []byte) []byte + func IsUnsupported(err error) bool + func KasaError(m map[string]any) error + func KasaKelvinRange(model string) (lo, hi float64, known bool) + func KasaRequest(ctx context.Context, addr string, req any, timeout time.Duration) (map[string]any, error) + func NormaliseMAC(s string) string + func ReadFrame(r io.Reader) ([]byte, error) + func TapoKelvinRange(info map[string]any) (lo, hi float64) + func TapoProbe(pubPEM []byte) []byte + type AESClient struct + Base string + HTTP *http.Client + Logins []AESLogin + func (a *AESClient) Call(ctx context.Context, method string, params any) (map[string]any, error) + func (a *AESClient) Handshake(ctx context.Context) error + func (a *AESClient) Matched() string + type AESLogin struct + Name string + Params map[string]any + func AESLogins(username, password string, version int) []AESLogin + func AESLoginsWith(username, password string, version int, extra ...Credential) []AESLogin + type AESSession struct + func NewAESSession(keyIV []byte) (*AESSession, error) + func (s *AESSession) Decrypt(b64 string) ([]byte, error) + func (s *AESSession) Encrypt(plain []byte) string + type Credential struct + Name string + Password string + Username string + type Found struct + Addr string + Sysinfo map[string]any + func KasaDiscover(ctx context.Context, bcast string, wait time.Duration) ([]Found, error) + type KLAPAuth struct + Hash []byte + Name string + Version int + func KLAPAuths(username, password string) []KLAPAuth + func KLAPAuthsWith(username, password string, extra ...Credential) []KLAPAuth + type KLAPClient struct + Auth []byte + Auths []KLAPAuth + Base string + HTTP *http.Client + func (k *KLAPClient) BadSignatures() int + func (k *KLAPClient) Call(ctx context.Context, method string, params any) (map[string]any, error) + func (k *KLAPClient) Handshake(ctx context.Context) error + func (k *KLAPClient) KasaCall(ctx context.Context, req any) (map[string]any, error) + func (k *KLAPClient) Matched() KLAPAuth + func (k *KLAPClient) Send(ctx context.Context, plain []byte) ([]byte, error) + type Session struct + func NewSession(local, remote, auth []byte) *Session + func (s *Session) Decrypt(seq int32, body []byte) ([]byte, error) + func (s *Session) Encrypt(plain []byte) (int32, []byte) + func (s *Session) Open(seq int32, body []byte) ([]byte, bool, error) + func (s *Session) Seal(seq int32, plain []byte) []byte + type SmartCaller interface + Call func(ctx context.Context, method string, params any) (map[string]any, error) + type SmartError struct + Code int + Method string + func (e *SmartError) Error() string + type TapoFound struct + Addr string + DeviceID string + DeviceType string + Encrypt string + HTTPPort int + HTTPS bool + Host string + LoginVersion int + MAC string + Model string + Name string + Result map[string]any + func ParseTapoAnswer(b []byte) (TapoFound, error) + func TapoDiscover(ctx context.Context, bcast string, wait time.Duration) ([]TapoFound, error) + func (f TapoFound) Protocol() string