
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
qcloud-iotexplorer-h5-panel-sdk
Advanced tools
腾讯连连小程序自定义H5面板SDK开发文档
npm i qcloud-iotexplorer-h5-panel-sdk
引入sdk
import sdk from 'qcloud-iotexplorer-h5-panel-sdk';
// or
const sdk = require('qcloud-iotexplorer-h5-panel-sdk');
控制设备属性,如:
sdk.controlDeviceData({
power_switch: 1
});
查询设备历史数据,具体用法参见: AppGetDeviceDataHistory 接口文档
拉取用户信息,调用后会更新到 sdk.userInfo 中,具体用法参考 AppGetUser 接口文档
拉取设备所属产品信息,调用后会更新 sdk.productInfo 和 sdk.dataTemplate,具体用法参考 AppGetProducts 接口文档
拉取设备最新的属性,调用后会更新 sdk.deviceData,具体用法参考 AppGetDeviceData 接口文档
拉取设备当前在线状态,调用后会更新 sdk.deviceStatus,具体用法参考 AppGetDeviceStatuses 接口文档
跳转到腾讯连连通用的产品详情页(小程序页面)
tips模块,样式和风格与连连小程序一致
展示tips
关闭tips
封装后的 tips.show 方法,等价于:
this.show(message, {
type: 'loading',
canBeReplace: true,
duration: 0,
delayDuration: 200,
canClickClose: false,
...options,
})
关闭loading tips
注意,showLoading后必须主动调用hideLoading,否则tips永远不会消失
封装后的 tips.show 方法,等价于:
this.show(message, { type: 'success', ...opts });
封装后的 tips.show 方法,等价于:
this.show(message, { type: 'info', ...options });
会先标准化处理错误展示信息后展示tips,等价于:
return this.show(errMsg, { type: 'danger', mask, duration, ...options });
当 websocket close 事件触发后执行回调
当 websocket 触发 error 事件后触发回调
当 websocket 收到 control
指令后触发
当 websocket 收到 report
指令后触发
当 websocket 收到设备状态改变推送后触发回调
AppGetUser
设置当前页面的分享内容,通过 wx.miniProgram.postMessage 向小程序推送分享信息,具体参考 小程序页面分享文档
调用 wx.miniprogram.navigateBack 返回上一级页面
应用开发 SDK 实例,H5面板sdk底层依赖 应用开发小程序端SDK,更多调用能力请参考应用开发SDK文档
微信 JS-SDK 实例,具体用法参考官方文档,使用前必须保证已经调用 sdk.wxSdkReady 方法
确保微信 jssdk 已注册完成,完成后会触发 resolve,该方法多次调用,若成功会返回缓存的 Promise 对象,如:
sdk.wxSdkReady().then(() => wx.miniprogram.navigateBack());
设备id,由 {productId}/{deviceName}
组成
产品id
设备名称
设备信息,如:
{
AliasName: "设备别名",
CreateTime: 1583739344,
DeviceId: "{productId}/{deviceName}",
DeviceName: "{deviceName}",
DeviceType: 0,
FamilyId: "家庭ID",
IconUrl: "设备ICON",
ProductId: "{productId}",
RoomId: "房间id",
UpdateTime: 1583739344,
UserID: "用户Id"
}
设备所在产品的物模型,如:
{
"version": "1.0",
"profile": {
"ProductId": "xxxx",
"CategoryId": "1"
},
"properties": [
{
"id": "int",
"name": "int",
"desc": "",
"mode": "rw",
"define": {
"type": "int",
"min": "0",
"max": "100",
"start": "0",
"step": "1",
"unit": ""
},
"required": false
},
{
"id": "float",
"name": "float",
"desc": "",
"mode": "rw",
"define": {
"type": "float",
"min": "0",
"max": "100",
"start": "0",
"step": "1",
"unit": ""
},
"required": false
},
{
"id": "bool",
"name": "bool",
"desc": "",
"mode": "rw",
"define": {
"type": "bool",
"mapping": {
"0": "关",
"1": "开"
}
},
"required": false
},
{
"id": "enum",
"name": "enum",
"desc": "",
"mode": "rw",
"define": {
"type": "enum",
"mapping": {
"1": "1",
"2": "2",
"3": "3",
"4": "4",
"5": "5"
}
},
"required": false
}
],
"events": [],
"actions": []
}
设备在线状态,在线: 1,非在线: 0
设备展示名称,会依次取:AliasName > productInfo.name > deviceName
来展示
是否是分享设备
设备所在家庭id,如果是分享设备则无此值
设备所在房间id,如果是分享设备则无此值
设备所在家庭详情,如果是分享设备则无此值
用户是否是当前家庭的管理员
用户信息,如:
{
Avatar: "头像url",
CountryCode: "国家代码",
Email: "email",
NickName: "昵称",
PhoneNumber: "电话号码",
UserID: "用户id"
}
FAQs
腾讯连连小程序自定义H5面板SDK开发文档
The npm package qcloud-iotexplorer-h5-panel-sdk receives a total of 0 weekly downloads. As such, qcloud-iotexplorer-h5-panel-sdk popularity was classified as not popular.
We found that qcloud-iotexplorer-h5-panel-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.