getSmartEventSwitchState(params: GetSmartEventSwitchStateParams)

Requires:
@tuya-miniapp/cloud-api≥1.0.5

Description

Query smart event switch

Parameters

ParameterTypeRequiredDescription
YesRequest body

Return Value

Type: Promise<GetSmartEventSwitchStateResult>
hadService, switchState, extContent

Referenced Types

typeGetSmartEventSwitchStateResult
PropertyTypeDescription
hadServicebooleanWhether the related service is enabled
switchState0 | 1Switch state (0 / 1)
extContentstringExtended content (JSON string)

Valid Values

GetSmartEventSwitchStateParams.serviceBusinessType
ValueDescriptionSince
aiSmartFreeEvent--
aiSmartFreeEventImage2Text--
GetSmartEventSwitchStateResult.switchState
ValueDescriptionSince
0--
1--

Examples

Request example

import { getSmartEventSwitchState } from '@tuya-miniapp/cloud-api';

getSmartEventSwitchState({
  devId: 'vdevo1',
  serviceBusinessType: 'aiSmartFreeEvent',
})
  .then((r) => console.log(r))
  .catch(console.error);

Response example

{ "hadService": true, "switchState": 1, "extContent": "{}" }