package com.casic.br.utils

import android.util.Log
import com.tuya.smart.sdk.api.IResultCallback
import com.tuya.smart.sdk.api.ITuyaDevice

object CommandManager {
    private const val kTag = "CommandManager"

    fun getTuyaDp(deviceInstance: ITuyaDevice, dpId: String) {
        deviceInstance.getDp(dpId, object : IResultCallback {
            override fun onSuccess() {

            }

            override fun onError(code: String?, error: String?) {
                Log.e(kTag, "onError: $error")
            }
        })
    }

    fun sendTuyaDp(deviceInstance: ITuyaDevice, cmd: String) {
        deviceInstance.publishDps(cmd, object : IResultCallback {
            override fun onSuccess() {

            }

            override fun onError(code: String?, error: String?) {
                Log.e(kTag, "onError: $error")
            }
        })
    }
}