webdjoe / pyvesync

pyvesync is a python library to manage Etekcity & Levoit smart devices
MIT License
170 stars 79 forks source link

Add support for LTF-F422S-KEU #242

Open min0s022 opened 1 month ago

min0s022 commented 1 month ago

Hey,

i dont manage to capture the packages. But I can share the device.

https://levoit.com/collections/tower-fans/products/levoit-classic-42-inch-smart-tower-fan

Best regards!

spkesDE commented 1 month ago

API

setSwitch

/cloud/v2/deviceManaged/bypassV2 -> { 
    data: { 
        powerSwitch: 1 | 0 (boolean as int)
        switchIdx: 0 
    }, 
    method: 'setSwitch', 
    source: 'APP' 
}

getTowerFanStatus

/cloud/v2/deviceManaged/bypassV2 -> { 
    method: 'getTowerFanStatus', 
    source: 'APP' 
}

setOscillationSwitch

/cloud/v2/deviceManaged/bypassV2 -> { 
    data: { 
        oscillationSwitch: 1 | 0 (boolean as int)
    }, 
    method: 'setOscillationSwitch', 
    source: 'APP' 
}

setTowerFanMode

/cloud/v2/deviceManaged/bypassV2 -> { 
    data: { 
        workMode: 'advancedSleep' | 'auto' | 'turbo' | 'normal' 
    }, 
    method: 'setTowerFanMode', 
    source: 'APP' 
}

setLevel

/cloud/v2/deviceManaged/bypassV2 -> { 
    data: { 
        manualSpeedLevel: 1-12, 
        levelType: 'wind', 
        levelIdx: 0 
    }, 
    method: 'setLevel', 
    source: 'APP' 
}

setDisplay

/cloud/v2/deviceManaged/bypassV2 -> { 
    data: { 
        screenSwitch: 1 | 0 (boolean as int)
    }, 
    method: 'setDisplay', 
    source: 'APP' 
}

setMuteSwitch

/cloud/v2/deviceManaged/bypassV2 -> { 
    data: { 
        muteSwitch: 1 | 0 (boolean as int)
    }, 
    method: 'setMuteSwitch', 
    source: 'APP' 
}

setDisplayingType

/cloud/v2/deviceManaged/bypassV2 -> { 
    data: { 
        displayingType: 1 | 0 (boolean as int)
    }, 
    method: 'setDisplayingType', 
    source: 'APP' 
}

setSleepPreference

/cloud/v2/deviceManaged/bypassV2 -> { 
    data: { 
        sleepPreferenceType: string, 
        oscillationSwitch: 1 | 0, 
        initFanSpeedLevel: 0-12, 
        fallAsleepRemain: 1 | 0, 
        autoChangeFanLevelSwitch: 1 | 0 
    }, 
    method: 'setSleepPreference', 
    source: 'APP' 
}

Models

'LTF-F422S-KEU', 'LTF-F422S-WUSR', 'LTF-F422_WJP', 'LTF-F422S-WUS'

Everything is working for me except setSleepPreference, which I have not tested since I don't need it in my TypeScript app.

Thank you, @webdjoe, for this repo; it helped me a lot to develop my own app for Homey Pro. My backend is heavily inspired by this repo.

All the API endpoints and payloads were extracted from the APK for Android.

Best regards!