@tuya-miniapp/ark-extension-virtual-device 1.8.7-beta-5 → 1.8.7-beta-7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -220752,7 +220752,7 @@ var require_package2 = __commonJS({
220752
220752
  "package.json"(exports, module2) {
220753
220753
  module2.exports = {
220754
220754
  name: "@tuya-miniapp/ark-extension-virtual-device",
220755
- version: "1.8.7-beta-4",
220755
+ version: "1.8.7-beta-6",
220756
220756
  license: "MIT",
220757
220757
  files: [
220758
220758
  "manifest.json",
@@ -263571,13 +263571,15 @@ async function dispatchMessageToTTT(result, devOrGroupId, dps, topic, message) {
263571
263571
  const dev = devList2.find(
263572
263572
  (item) => item.deviceTopo?.nodeId === result.data?.cid
263573
263573
  );
263574
- ark.miniapp.emitPluginEvent({
263575
- name: "TUNIDeviceControlManager.onSubDeviceDpUpdate",
263576
- data: {
263577
- deviceId: dev?.devId,
263578
- dps
263579
- }
263580
- });
263574
+ if (shouldDispatchSubDeviceEvent(dev.parentId)) {
263575
+ ark.miniapp.emitPluginEvent({
263576
+ name: "TUNIDeviceControlManager.onSubDeviceDpUpdate",
263577
+ data: {
263578
+ deviceId: dev?.devId,
263579
+ dps
263580
+ }
263581
+ });
263582
+ }
263581
263583
  ark.miniapp.emitPluginEvent({
263582
263584
  name: "TUNIDeviceControlManager.onDpDataChange",
263583
263585
  data: {
@@ -263635,7 +263637,7 @@ async function dispatchMessageToTTT(result, devOrGroupId, dps, topic, message) {
263635
263637
  del: "onSubDeviceRemoved",
263636
263638
  add: "onSubDeviceAdded"
263637
263639
  };
263638
- if (shouldDispatchSubDeviceEvent(devOrGroupId)) {
263640
+ if (shouldDispatchSubDeviceEvent(devOrGroupId) && opDevId === devOrGroupId) {
263639
263641
  if (type2 === "del") {
263640
263642
  ark.miniapp.emitPluginEvent({
263641
263643
  name: `TUNIDeviceControlManager.${pluginName[type2]}`,
@@ -263659,19 +263661,21 @@ async function dispatchMessageToTTT(result, devOrGroupId, dps, topic, message) {
263659
263661
  data: { devId },
263660
263662
  type
263661
263663
  } = result;
263662
- ark.miniapp.emitPluginEvent({
263663
- name: "TYUniDeviceControlManager.onSubDeviceInfoUpdate",
263664
- data: {
263665
- deviceId: devId
263666
- }
263667
- });
263668
- ark.miniapp.emitPluginEvent({
263669
- name: "TUNIDeviceControlManager.onSubDeviceInfoUpdate",
263670
- data: {
263671
- deviceId: devId
263672
- }
263673
- });
263674
- removeCachedDevice(devId);
263664
+ if (shouldDispatchSubDeviceEvent(devOrGroupId) && devId === devOrGroupId) {
263665
+ ark.miniapp.emitPluginEvent({
263666
+ name: "TYUniDeviceControlManager.onSubDeviceInfoUpdate",
263667
+ data: {
263668
+ deviceId: devId
263669
+ }
263670
+ });
263671
+ ark.miniapp.emitPluginEvent({
263672
+ name: "TUNIDeviceControlManager.onSubDeviceInfoUpdate",
263673
+ data: {
263674
+ deviceId: devId
263675
+ }
263676
+ });
263677
+ removeCachedDevice(devId);
263678
+ }
263675
263679
  break;
263676
263680
  case 47:
263677
263681
  ark.miniapp.emitPluginEvent({
@@ -279893,7 +279897,7 @@ async function getDeviceInfo2(params) {
279893
279897
  latitude: devInfo.lat,
279894
279898
  longitude: devInfo.lon,
279895
279899
  ...devInfo.dataPointInfo,
279896
- isVirtualDevice: devInfo.virtual,
279900
+ isVirtualDevice: dev?.virtual,
279897
279901
  panelConfig: product.panelConfig,
279898
279902
  // isVDevice: dev.virtual,
279899
279903
  dps,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-miniapp/ark-extension-virtual-device",
3
- "version": "1.8.7-beta-5",
3
+ "version": "1.8.7-beta-7",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "manifest.json",