Tuya iOS Smart Life App SDK 5.15.0
<WTLDeviceDelegate> Protocol Reference

#import <WTLDevice.h>

Inheritance diagram for <WTLDeviceDelegate>:

Instance Methods

(void) - device:stateChanged:
 
(void) - device:receivedAttributeReport:
 
(void) - device:receivedEventReport:
 
(void) - deviceBecameActive:
 

Detailed Description

Definition at line 205 of file WTLDevice.h.

Method Documentation

◆ device:receivedAttributeReport:

- (void) device: (WTLDevice *)  device
receivedAttributeReport: (NSArray< NSDictionary< NSString *, id > * > *)  attributeReport 
required

Notifies delegate of attribute reports from the WTLDevice

Parameters
attributeReportAn array of response-value objects as described in WTLDeviceResponseHandler

◆ device:receivedEventReport:

- (void) device: (WTLDevice *)  device
receivedEventReport: (NSArray< NSDictionary< NSString *, id > * > *)  eventReport 
required

Notifies delegate of event reports from the WTLDevice

Parameters
eventReportAn array of response-value objects as described in WTLDeviceResponseHandler
           In addition to the WTLEventPathKey and WTLDataKey containing the path and event values, eventReport also contains
           these keys:

           WTLEventNumberKey : NSNumber-wrapped uint64_t value. Monotonically increasing, and consecutive event reports
                               should have consecutive numbers unless device reboots, or if events are lost.
           WTLEventPriorityKey : NSNumber-wrapped WTLEventPriority value.
           WTLEventTimeTypeKey : NSNumber-wrapped WTLEventTimeType value.
           WTLEventSystemUpTimeKey : NSNumber-wrapped NSTimeInterval value.
           WTLEventTimestampDateKey : NSDate object.

           Only one of WTLEventTimestampDateKey and WTLEventSystemUpTimeKey will be present, depending on the value for
           WTLEventTimeTypeKey.

◆ device:stateChanged:

- (void) device: (WTLDevice *)  device
stateChanged: (WTLDeviceState)  state 
required
Parameters
stateThe current state of the device

◆ deviceBecameActive:

- (void) deviceBecameActive: (macos(13.3)) 
(watchos(9.4)) 
(tvos(16.4))  API_AVAILABLE 
optional

Notifies delegate the device is currently actively communicating.

This can be used as a hint that now is a good time to send commands to the device, especially if the device is sleepy and might not be active very often.


The documentation for this protocol was generated from the following file: