GithubHelp home page GithubHelp logo

tuyainc / tuyasmart_home_ios_sdk Goto Github PK

View Code? Open in Web Editor NEW
50.0 26.0 19.0 249.6 MB

Tuya Smart iOS Home SDK

Home Page: https://tuyainc.github.io/tuyasmart_home_ios_sdk_doc

Ruby 4.42% Objective-C 95.58%
tuya-smart-ios-sdk tuya ios-sdk cocoapods iot-platform

tuyasmart_home_ios_sdk's Introduction

Tuya Smart iOS SDK

中文版 | English


Features Overview

Tuya Smart iOS Home SDK is the iOS 9.0 and above version provided by Tuya for the field of smart home. iOS developers can quickly develop app functions based on SDK, realize the activation of intelligent hardware, hardware control, firmware upgrades, timed tasks, intelligent scenarios and other operations.

The SDK includes the following features:

  • Account system (phone number, email registration, login, password reset and other general account functions)
  • Home system (home management, room management, home sharing and other functions)
  • Hardware functions (network configuration, control, status reporting, timed tasks, groups, firmware upgrades, sharing)

Fast Integration

Using CocoaPods integration (version 9.0 or above is supported)

Add the following content in file Podfile:

platform :ios, '9.0'

target 'your_target_name' do

      pod "TuyaSmartHomeKit"

end

Execute command pod update in the project's root directory to begin integration.

For the instructions of CocoaPods, please refer to: CocoaPods Guides

Initializing SDK

  1. Open project setting, Target => General, edit Bundle Identifier to the value from Tuya develop center.
  2. Import security image to the project and rename as t_s.bmp, then add it into Project Setting => Target => Build Phases => Copy Bundle Resources.
  3. Add the following to the project file PrefixHeader.pch
#import <TuyaSmartHomeKit/TuyaSmartKit.h>

Open file AppDelegate.m,and use the App ID and App Secret obtained from the development platform in the [AppDelegate application:didFinishLaunchingWithOptions:]method to initialize SDK:

[[TuyaSmartSDK sharedInstance] startWithAppKey:<#your_app_key#> secretKey:<#your_secret_key#>];

Now all the preparatory work has been completed. You can set out to develop your application.

Doc

Refer to details: Tuya Smart Doc - iOS SDK

ChangeLog

CHANGELOG.md

tuyasmart_home_ios_sdk's People

Contributors

0x5e avatar 0xlan avatar applewenmingyan avatar fisher12cc avatar tuyaronbin avatar wenmingyan avatar xuchengcheng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tuyasmart_home_ios_sdk's Issues

iOS SDK installation gives error

Hello,
I try to install tuya ios sdk using pods but every time pods gives me error for [!] Error installing TYBluetooth
I attach screenshot also.
ss
Is there any problem fomr my side or server side?

Thanks,

Installation of tuyaSmartHomeKit ios sdk gives error

Hello,
I tried to install tuya ios sdk using pods but I get an error.
[!] Error installing TuyaSmartHomeKit
I also attached screenshot below.

Screenshot 2020-10-31 at 11 42 40 AM

Please tell me is this a server issue or my region issue?
Thanks

Error installing TuyaSmartTimerKit

[!] Error installing TuyaSmartTimerKit
[!] /usr/bin/curl -f -L -o /var/folders/fg/6q2lrqjj4hq51mfnhtv4y4br0000gn/T/d20200901-1178-1b3af4f/file.zip https://airtake-public-data.oss-cn-hangzhou.aliyuncs.com/smart/app/package/sdk/ios/TuyaSmartTimerKit-3.13.0.zip --create-dirs --netrc-optional --retry 2

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
15 421k 15 65330 0 0 1137 0 0:06:19 0:00:57 0:05:22 10408
curl: (18) transfer closed with 365829 bytes remaining to read

License

Will you add the license?

打开运行崩溃

TuyaSmartHomeKit_Example[26331:4756871] *** Terminating app due to uncaught exception 'start sdk error', reason: 'security image not found'

并且 t_s.bmp文件缺失

uid 登录直接崩溃

-[TuyaSmartMQTTConfigModel setUseQUIC:]: unrecognized selector sent to instance 0x282c39920

Problem with the SDK

Hello all,

We have some Heaters with Tuya WiFi module in them, all of the can connect to Tuya app and function very well. However we have our own app to connect to our Tuya based products. Some of these heaters can connect to our app but some can not connect.

Any ideas on what is the problem?

Thank you in advance.
Shaham


大家好,

我们有一些带有Tuya WiFi模块的加热器,所有这些都可以连接到Tuya app并且运行良好。 但是,我们有自己的应用程序连接到我们的Tuya产品。 其中一些加热器可以连接到我们的应用程序,但有些无法连接。

关于什么是问题的任何想法?

先感谢您。
Shaham

After robot turned on, takes 10-30 seconds to update app status

Hi @xuchengcheng

After robot turned on, takes 10-30 seconds to update app status. After the robot turned off, takes ~1-3 minute to update the app status. Can we reduce the time? How to do it?

就是如果robot冷开机,需要10秒以上才能在app端通过tuya sdk接受到状态变更成在线,如果离线,可能需要1-2分钟以上才能在app端更新状态,有什么办法可以提高吗?如果打开app时,robot是开机的,需要3-5秒左右.也可以通过调用什么接口改善吗?

SDK升级时的一些问题...

请问从TuyaSmartKit迁移到TuyaSmartHomeKit有没有一个帮助文档? 比如那些方法已弃用在新的SDK里的替代方法是什么?
目前迁移的不是很顺利。
一些TuyaSmartKit的方法到TuyaSmartHomeKit不适用,也没有文档可查。
比如获取这个账号下的所有设备TuyaSmartKitTuyaSmartUser.sharedInstance()?.deviceArray
TuyaSmartHomeKit应该怎么做?
还有TuyaSmartKit下注册的账号到新的TuyaSmartHomeKit下能否通用?

Question about smart IR

Hello,
I'm trying to use a smart IR device to learn a code from infrared control and send the same code using my app, I'm setting the dps["1"] as "study" and I take the code from the dps["2"] (study_code), but how can I send this code by smart IR ? I'm trying to set dps["1"] as "send_ir" and publish this code in dps["3"] (ir_code) but it's not working, is there something I forgot?
Thank you for your help.

About sensor question

Hello, I'm trying to develop sensors。
But I don't know where to get the historical data from the sensor records.
Is it accessed through your API??
Thank you for your help.

ios other linker flag添加objc

使用你们SDK,在other linker flag添加objc以后导致项目里一些第三方报错,不添加objc你们的SDK无法使用,怎么解决,如何把-objc换成-force_load.

TuyaSmartRequest没有回调

TuyaSmartRequest的

  • (void)requestWithApiName:(NSString *)apiName
    postData:(NSDictionary *)postData
    version:(NSString *)version
    success:(TYSuccessID)success
    failure:(TYFailureError)failure方法两个block都没有回调。
2019-03-14 10:54:21.969000 eFamilySmart[1682:340657] TYRequest response is tuya.m.ipc.config.get Error Domain=NSURLErrorDomain Code=-999 "已取消" UserInfo=
{NSErrorFailingURLKey=https://a1.tuyacn.com/api.json?osSystem=10.2.1&
timeZoneId=Asia%2FShanghai&clientId=9k9rg4j98x7hn49jdd3j&
sign=ce872c1fd3813ae98fb0bc0e4f2ca2ea&a=tuya.m.ipc.config.get&
time=1552532062&deviceId=4089BB18-CDBE-4B10-AFBE-F8EDC81F82A9&os=IOS&appRnVersion=5.5&platform=iPhone%20SE&
sid=ay152629G86216430brfVfG3db7c1e23133f3f549a5d86b312509aec&lang=zh-Hans&appVersion=2.3.6&
ttid=sdk_appstore@9k9rg4j98x7hn49jdd3j&sdkVersion=2.7.17&v=1.0&, 
NSLocalizedDescription=已取消, NSErrorFailingURLStringKey=https://a1.tuyacn.com/api.json?osSystem=10.2.1&
timeZoneId=Asia%2FShanghai&clientId=9k9rg4j98x7hn49jdd3j&sign=ce872c1fd3813ae98fb0bc0e4f2ca2ea&
a=tuya.m.ipc.config.get&time=1552532062&deviceId=4089BB18-CDBE-4B10-AFBE-F8EDC81F82A9&os=IOS&appRnVersion=5.5&
platform=iPhone%20SE&sid=ay152629G86216430brfVfG3db7c1e23133f3f549a5d86b312509aec&lang=zh-Hans&appVersion=2.3.6&
ttid=sdk_appstore@9k9rg4j98x7hn49jdd3j&sdkVersion=2.7.17&v=1.0&}

How to make a universal app from Tuya SDK?

I have 2 products (both heaters) which are supposed to be exactly the same model and functionality, but apparently the supplier put different MCUs in them.
Surprisingly both of them can be controlled via Tuya app as heater. But only one of them can be controlled via my app.

My question is how Tuya doesn't care about the difference in MCU and both can be controlled via Tuya app, but my in-house developed app cares about the MCU? What makes Tuya app different from my app? How can I make my app a universal app like Tuya app?

I would be thankful if someone can help with my problem.

Best Regards,

家庭删除接口

你好,在使用iOS sdk时,发现HomeManager里有家庭删除delegate回调,但是没有找到家庭删除接口,请问这个接口在哪里呢?

Issue with bitcode when use cocoa pods.

ld: '/Users/*/Desktop/TuyaMeshExample/Pods/TuyaCameraSDK/ios/TuyaCameraSDK.framework/TuyaCameraSDK' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users//Desktop/TuyaMeshExample/Pods/TuyaCameraSDK/ios/TuyaCameraSDK.framework/TuyaCameraSDK' for architecture arm64

override function get exception

Hello, when i add override function from get wifi signal:

`func getWifiSignalStrength() {
self.device?.getWifiSignalStrength(success: {
print("get wifi signal strength success")
}, failure: { (error) in
if let e = error {
print("get wifi signal strength failure: (e)")
}
})
}

// MARK: - TuyaSmartDeviceDelegate
func device(_ device: TuyaSmartDevice!, signal: String!) {

}`

take exception :

unrecognized selector sent to instance 0xa777d538f873fb09
2019-12-17 22:37:03.890862+0300 HomeAlone[8529:2794962] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber length]: unrecognized selector sent to instance 0xa777d538f873fb09'

delegate was added TuyaSmartDeviceDelegate

Does cloud send the PID to the app?

Hello,

Would you please let me know how the app can prepares the UI for each product?
Does the cloud receive the PID from the device, the figures out what DPs this PID has and eventually tell the app to prepare the UI?
In another word, does the app needs to receive the PID from cloud or all it needs is the schema (DP IDs)?

Thanks in advance.

Device IOT

I'm trying to add an IOT device to my SDK application, but I always get this message: "Error Domain=com.tuya.www Code=1501 "This device is not supported by this app" UserInfo={NSLocalizedDescription=This device is not supported by this app, NSLocalizedFailureReason=APP_PRODUCT_UNSUPPORT}""

I would like to know if I can connect any TUYA devices (from any company) to my SDK application or do I need company authorization?

Login not works with New SDK

Hello,
I create user from your old ios sdk version. Now its not works with this new sdk version.
If i create new user from latest version then login works fine for that user.

Thanks,

ZigBee 网关添配问题

你好,是关于添配 ZigBee 网关的问题,我们按照文档上的 ”ZigBee 网关配网“ 进行编码,前段时间是可以添配成功的,然后这星期开始就一直添配不上了。xcode 的控制台一直输出这样的
logs:
2019-04-24 18:13:21.183223+0800 ****[8647:3702571] TYActivatorService: searchDevice
2019-04-24 18:13:21.195427+0800 ****[8647:3702571] TYGetSTimerService get timer from sTimer
2019-04-24 18:13:21.197365+0800 ****[8647:3702571] method is https://a1.tuyacn.com/api.json?osSystem=12.1.2&timeZoneId=Asia%2FShanghai&clientId=ydcju98mwykhfx7kfq4p&sign=0f1908febdecf151d8849dbc46bee287&a=tuya.m.device.list.token&time=1556100801&deviceId=42B222F9-F9D1-45A6-935B-6AD566873E27&os=IOS&platform=iPhone%207&sid=ay155124N7696997sYHbpRz370c0288497070c026377b876a2e2fb9e&lang=zh-Hans-CN&appVersion=1.2.24&ttid=sdk_appstore@ydcju98mwykhfx7kfq4p&sdkVersion=2.0.0&v=2.0&,postData is {
token = n7XlMB25;
}
2019-04-24 18:13:21.259475+0800 ****[8647:3703357] ATRequest response is tuya.m.device.list.token {
result = {
};
status = ok;
success = 1;
t = 1556100801241;
}
然后代理 - (void)activator:(TuyaSmartActivator *)activator didReceiveDevice:(TuyaSmartDeviceModel *)deviceModel error:(NSError *)error 一直没有回调回来

非常需要你的帮助,谢谢。

Crash after initializing Tuya SDK

Hello,

Our app is crashing after initializing Tuya SDK (perhaps from a background thread)

Thread 3: EXC_BAD_ACCESS (code=2, address=0x101752a80)

Stack trace
===========
Thread 3 Queue : GCDAsyncSocket (serial)
#0	0x0000000101752a80 in read ()
#1	0x0000000101005c2c in -[GCDAsyncSocket doReadData] at /Users/francisco/Developer/tuyatest-ios/Pods/CocoaAsyncSocket/Source/GCD/GCDAsyncSocket.m:5264
#2	0x00000001010034b4 in __66-[GCDAsyncSocket setupReadAndWriteSourcesForNewlyConnectedSocket:]_block_invoke at /Users/francisco/Developer/tuyatest-ios/Pods/CocoaAsyncSocket/Source/GCD/GCDAsyncSocket.m:4224
#3	0x0000000101fecc74 in _dispatch_client_callout ()
#4	0x0000000101fefffc in _dispatch_continuation_pop ()
#5	0x0000000102002610 in _dispatch_source_invoke ()
#6	0x0000000101ff4a4c in _dispatch_lane_serial_drain ()
#7	0x0000000101ff58b4 in _dispatch_lane_invoke ()
#8	0x0000000101fff77c in _dispatch_workloop_worker_thread ()
#9	0x00000001943d9114 in _pthread_wqthread ()
#10	0x00000001943dbcd4 in start_wqthread ()


Console logs
============
2019-12-19 14:09:16.711401+0100 tuyatest[423:39784] [HockeySDK] -[BITCrashManager startManager]_block_invoke/1199 [HockeySDK] WARNING: Detecting crashes is NOT enabled due to running the app with a debugger attached.
2019-12-19 14:09:16.795472+0100 tuyatest[423:39784] upgradeV2ToV3
2019-12-19 14:09:16.798869+0100 tuyatest[423:39784] upgradeV3ToV4
2019-12-19 14:09:16.806157+0100 tuyatest[423:39784] init --- {
    dataVersion = 1;
    domain =     {
        aispeechHttpsUrl = "https://aispeech.tuyaus.com";
        gwApiUrl = "http://a.gw.tuyaus.com/gw.json";
        gwMqttUrl = "mq.gw.tuyaus.com";
        mobileApiUrl = "https://a1.tuyaus.com";
        mobileMediaMqttUrl = "s.tuyaus.com";
        mobileMqttUrl = "mq.mb.tuyaus.com";
        mobileMqttsUrl = "m1.tuyaus.com";
        pxApiUrl = "http://px.tuyaus.com";
        regionCode = AZ;
    };
    ecode = <private>;
    email = "";
    env = "APP_ENV_RELEASE";
    headPic = "";
    mobile = "";
    nickname = "";
    partnerIdentity = p1306808;
    phoneCode = en;
    regFrom = 9;
    sid = <private>;
    snsNickname = "";
    source = 8;
    tempUnit = 1;
    timezoneId = "Europe/Madrid";
    uid = <private>;
    username = 21;
}
2019-12-19 14:09:16.831994+0100 tuyatest[423:39784] connect to host : 52.32.160.79
2019-12-19 14:09:16.834089+0100 tuyatest[423:39784] [MQTTSessionLegacy] initWithClientId:iOS_-<private>
2019-12-19 14:09:16.834302+0100 tuyatest[423:39784] [MQTTSession] init
2019-12-19 14:09:16.901460+0100 tuyatest[423:39784] mqtt connect


}
objc[423]: Class _NSZombie_NSSQLRow is implemented in both ?? (0x282329ef0) and ?? (0x282335500). One of the two will be used. Which one is undefined.
2019-12-19 14:09:17.903242+0100 tuyatest[423:39921] TYRequest response success is tuya.p.time.get {
  "result" : {
    "validTime" : 1800,
    "time" : 1576760957
  },
  "success" : true,
  "status" : "ok",
  "t" : 1576760957797
}
2019-12-19 14:09:18.085252+0100 tuyatest[423:39784] open sqlite db ok.
2019-12-19 14:09:18.101553+0100 tuyatest[423:39925] MQTT connect state : connected (0) (null)
2019-12-19 14:09:18.101867+0100 tuyatest[423:39925] MQTT connected time consuming : 1200
2019-12-19 14:09:19.201918+0100 tuyatest[423:39784] receiveBroadcast : {
    ability = 0;
    active = 2;
    encrypt = 1;
    gwId = <private>;
    ip = "192.168.5.120";
    mode = 0;
    productKey = <private>;
    version = "3.1";
}, active : 2
2019-12-19 14:09:19.203098+0100 tuyatest[423:39784] startTcpConnecting:192.168.5.120
2019-12-19 14:09:19.221677+0100 tuyatest[423:39784] tcpConnected:<private>, time : 0.02
2019-12-19 14:09:19.222421+0100 tuyatest[423:39784] tcp request type : 10, devId : <private>, body : {
    devId = <private>;
    gwId = <private>;
}
2019-12-19 14:09:19.223842+0100 tuyatest[423:39784] kNotificationGatewayInfoUpdate --
2019-12-19 14:09:19.227933+0100 tuyatest[423:39981] [] nw_connection_copy_connected_path [C6] Client called nw_connection_copy_connected_path on unconnected nw_connection
2019-12-19 14:09:19.228085+0100 tuyatest[423:39981] [] tcp_connection_is_cellular No connected path
(lldb) 

How can we solve it?

Thanks in advance

Product Id in a group

Hello,
I'm trying to create a group of devices with the function TuyaSmartGroup.createGroup, but there's a parameter called productId, where can I find this ID? In the documentation, they said we must use the user device list, but I can't find the groupId in my device list.

Question about scenes

Hello,

I would like to turn on a smart lamp everyday at 14:00 Shanghai's time zone, to do that I'm using the follow code in swift:

let sceneName = "temp"
let action = TuyaSmartSceneActionModel()
action?.entityId = device.devId
action?.actionExecutor = "dpIssue"
action?.executorProperty = ["1":true]
let condition = TuyaSmartSceneConditionModel()
condition?.entityId = device.devId
condition?.expr = [["timeZoneId": "Asia/Shanghai", "loops": "1111111", "time":"14:00", "date": "20190211"]]
let homeId = JibSmartHome.sharedInstance.home!.homeModel.homeId
TuyaSmartScene.addNewScene(withName: sceneName, homeId: homeId,
                           background: "", showFirstPage: false,
                           conditionList: [condition!], actionList: [action!],
                           matchType: TuyaSmartConditionMatchAll,
                           success: { sceneModel in
                              self.scene = TuyaSmartScene(sceneModel: sceneModel)
                              self.scene?.enable(success: {
                                      self.dismiss(animated: true, completion: nil)
                           }, failure: { error in
                                      print(error?.localizedDescription)
                           })
}, failure: {optionalError in
           if let err = optionalError {
               print(error?.localizedDescription)
           }
})

My application is executing the success block, but my lamp isn't turn on at 14:00. I already try to modify my scene adding a ruleTrigger action, but it didn't work too. On the other side, when I execute my scene, my lamp turn on no matter what time, it seems that my condition and my action are not linked. Do you know what I did wrong? There are some way to program my lamp to turn on everyday at 14?

Thank you very much.

I've a device which disappears when I restart or logout/login

Hi,
I've connected a "Smart Socket" and a "Wifi Light" with my app (using your SDK) but when I restart the app or logout/login, the "Wifi Light" disappears.
For the moment, I search for my devices with this code

for home in homeManager.homes {
	for device in TuyaSmartHome(homeId: home.homeId).deviceList {
		print("//// DEVICE: \(device.name)");
	}
}

However, with your example App, the "Wifi Light" still appear, but I can't find why.
In your app if I count the number of devices in the home 1699498 just after initializing the SDK I get one more device than in my app

Thanks for your help 🙂

单设备接入

你好我们现在想了解基于tuya sdk开放单品app,就是如果没有家庭的概念,请问设备的一个绑定流程是怎样的,我看现在的sdk接口绑定流程,要先获取绑定token,但是都需要传home ID呀

This device is not supported by this app

Hello.
I'm trying to integrate SDK with my test App and i am with the follow error:

Error Domain=com.tuya.www Code=1501 "This device is not supported by this app" UserInfo={NSLocalizedDescription=This device is not supported by this app, NSLocalizedFailureReason=APP_PRODUCT_UNSUPPORT}

How can i fix it?

Delete a group

Hello,
I'm trying to use use the function dismiss from a instance TuyaSmartGroup, and I got the error code= -999, but my 2 completions (success and failure) don't treat this error, how can I dismiss a group without error?

你们SDK和其他SDK发生冲突

关于OTHER_LDFLAGS = $(inherited) -ObjC -l"BlocksKit" -l"CocoaAsyncSocket" -l"MBProgressHUD" -l"MQTTClient" -l"Masonry" -l"Reachability" -l"SDWebImage" -l"YYModel" -l"c++" -l"crypto" -l"ssl" -l"z" -framework "CFNetwork" -framework "CoreBluetooth" -framework "CoreFoundation" -framework "CoreGraphics" -framework "CoreTelephony" -framework "Foundation" -framework "ImageIO" -framework "MessageUI" -framework "Security" -framework "SystemConfiguration" -framework "TYBluetooth" -framework "TuyaSmartActivatorKit" -framework "TuyaSmartBLEKit" -framework "TuyaSmartBLEMeshKit" -framework "TuyaSmartBaseKit" -framework "TuyaSmartDeviceKit" -framework "TuyaSmartFeedbackKit" -framework "TuyaSmartMQTTChannelKit" -framework "TuyaSmartMessageKit" -framework "TuyaSmartSceneKit" -framework "TuyaSmartSocketChannelKit" -framework "TuyaSmartTimerKit" -framework "TuyaSmartUtil" -framework "UIKit"

1.你们的SDK里面需要在other linker flag里添加 $(inherited),不添加就会程序运行会报错。如何解决
2.如果必须添加$(inherited)可以不添加-ObjC么?-ObjC和我们的其他SDK发生冲突

Checking Of device category

Hi,
I added door lock & camera to my device list.
now I want to check when I will click on camera or door lock. How can I find the category or device type on clicking the device or how can I check which device type I am pressing.
This issue's reason is when I will press the camera it will go to camera view & when I will press the door lock it will go to door lock view.

Please anyone share the solution for the same issue.

程序运行崩溃

我导入SDK后调用 [[TuyaSmartSDK sharedInstance] startWithAppKey:SDK_APPKEY secretKey:SDK_APPSECRET]时程序崩溃,报错信息是Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[TYSDKDevice tysdk_UUID]: unrecognized selector sent to class 0x101d074c8',bundle id appkey appsecret 安全图片都没有问题。

'Mantle/Mantle.h' file not found

I update my Tuya pod file after that I am facing the problem -

'Mantle/Mantle.h' file not found

in the

TuyaSmartHomeKit.framework's

-TYModel.h file.

单设备分享

你好,情况是这样的:
基于自有用户体系登入涂鸦SDK,也就是UID登入,然后单设备共享的步骤是什么?

The color of the smart bulb does not change

I'm trying to change the color of the smart lamp using the following code:

-------------------------------------------------
var dps = String : Any
dps = ["24" : "00f003e8"]
device?.publishDps(dps, success: {
print("success")
}, failure: { (error) in
if let e = error {
print("publishDps failure: (e)")
}
})
-------------------------------------------------

I have tried to pass a value in hexadecimal, RGB, the literal name of the color (for example blue) and the color of the smart lamp does not update, but the method returns me success.
where am i wrong?

PS: i'm using swift

家庭删除接口没有发现

在查看HomeManager类里没有发现家庭删除接口,但是代理却有家庭删除接口回调,请问家庭删除接口在哪里?

TuyaSmartRequest api not works

Hello,
I used TuyaSmartRequest api 'm.smart.dp.his.stat.get.all' & 'm.smart.dp.his.stat.get.month' for get dpId data. But now its not works. Are you changed anything in it?

TuyaSmartRequest *request = [[TuyaSmartRequest alloc] init];
[request requestWithApiName:@"m.smart.dp.his.stat.get.all" postData:@{@"devId":deviceModel.devId, @"dpId":@"101"} version:@"1.0" success:^(id result) {
}
or

[request requestWithApiName:@"m.smart.dp.his.stat.get.month" postData:@{@"devId":deviceModel.devId, @"month":@"201909", @"dpId":@"101"} version:@"1.0" success:^(id result){
}

Its gives error like, Error Domain=com.tuya.www Code=1501 "Parameter or Data Error" UserInfo={NSLocalizedDescription=Parameter or Data Error, NSLocalizedFailureReason=PARAMS_ILLEGAL_OR_DATA_ILLEGAL}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.