@mega-yfue/eufy-sdk 0.5.0-beta.37 → 0.5.0-beta.39

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.
package/dist/index.js CHANGED
@@ -5492,7 +5492,12 @@ function usesHomeBasePowerPayload(ctx) {
5492
5492
  function hasUnreflectedHomeBasePower(ctx) {
5493
5493
  return usesHomeBasePowerPayload(ctx) && !ctx.paramIds.has(2001);
5494
5494
  }
5495
+ function hasPrivacyPower(ctx) {
5496
+ return ctx.deviceType === DeviceType.INDOOR_PT_CAMERA_S350 && ctx.homeBaseAttached === true;
5497
+ }
5495
5498
  function powerCommand(on, ctx) {
5499
+ if (hasPrivacyPower(ctx))
5500
+ return privacyCommand(!on, ctx.channel);
5496
5501
  if (usesHomeBasePowerPayload(ctx))
5497
5502
  return setPayload(CAMERA_CMD.PRIVACY_MODE, { switch: on ? 0 : 1 }, ctx, 0);
5498
5503
  return setScalar(CAMERA_CMD.CAMERA_ENABLE, powerValue(on, ctx), ctx, "auto");
@@ -5509,11 +5514,11 @@ function poweredOf(ctx) {
5509
5514
  return cameraPowerTier(ctx.model, ctx.capabilities ?? /* @__PURE__ */ new Set());
5510
5515
  }
5511
5516
  function enablementReflection(on, ctx) {
5517
+ if (!CAMERA_MEMBERS.enabled.readReflectsWrite(ctx))
5518
+ return void 0;
5512
5519
  const alias = CAMERA_MEMBERS.enabled.readAliases[0].paramType;
5513
5520
  if (ctx.paramIds.has(alias))
5514
5521
  return { param: alias, expected: on, observed: on };
5515
- if (hasUnreflectedHomeBasePower(ctx))
5516
- return void 0;
5517
5522
  if (ctx.paramIds.has(CAMERA_CMD.CAMERA_ENABLE)) {
5518
5523
  return {
5519
5524
  param: CAMERA_CMD.CAMERA_ENABLE,
@@ -5524,7 +5529,7 @@ function enablementReflection(on, ctx) {
5524
5529
  return void 0;
5525
5530
  }
5526
5531
  function refuseWhenDisabled(ctx, read) {
5527
- if (!hasUnreflectedHomeBasePower(ctx) && read("enabled")?.value === false)
5532
+ if (CAMERA_MEMBERS.enabled.readReflectsWrite(ctx) && read("enabled")?.value === false)
5528
5533
  throw new CameraDisabledError(ctx.name ?? ctx.serial);
5529
5534
  }
5530
5535
  var CAMERA_MEMBERS = {
@@ -5558,7 +5563,7 @@ var CAMERA_MEMBERS = {
5558
5563
  invert: true,
5559
5564
  invertFor: (ctx) => isT8410HomeBase3(ctx) ? false : void 0,
5560
5565
  readAliases: [{ paramType: 2001, invert: false }],
5561
- readReflectsWrite: (ctx) => !hasUnreflectedHomeBasePower(ctx),
5566
+ readReflectsWrite: (ctx) => !hasUnreflectedHomeBasePower(ctx) && !hasPrivacyPower(ctx),
5562
5567
  description: "Camera enabled. Family-dependent wire param: 1035 CMD_DEVS_SWITCH (enable bit on T8410/HomeBase 3, disable bit on battery/solo cams) or 2001 OPEN_DEVICE (standalone indoor/outdoor). Reported on/off state; unreflectedMembers identifies commands whose effect this report does not reliably reflect.",
5563
5568
  observation: {
5564
5569
  event: "cameraEnabledChanged",