From ebb681e3a4d0ecbc2e4acf2422d68d457c8d14db Mon Sep 17 00:00:00 2001 From: dgreif Date: Wed, 24 Jul 2024 11:59:21 -0400 Subject: [PATCH] Deprecation message for bridged cameras --- .changeset/heavy-dogs-eat.md | 5 +++++ packages/homebridge-ring/README.md | 2 +- packages/homebridge-ring/config.schema.json | 2 +- packages/homebridge-ring/ring-platform.ts | 11 ++++++++++- 4 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 .changeset/heavy-dogs-eat.md diff --git a/.changeset/heavy-dogs-eat.md b/.changeset/heavy-dogs-eat.md new file mode 100644 index 00000000..e4715f68 --- /dev/null +++ b/.changeset/heavy-dogs-eat.md @@ -0,0 +1,5 @@ +--- +'homebridge-ring': patch +--- + +Add deprecation warning for bridged cameras. Only unbridged cameras will be supported in the next major release. diff --git a/packages/homebridge-ring/README.md b/packages/homebridge-ring/README.md index bf931d29..6a833c02 100644 --- a/packages/homebridge-ring/README.md +++ b/packages/homebridge-ring/README.md @@ -82,7 +82,7 @@ Only include an optional parameter if you actually need it. Default behavior wit | Option | Default | Explanation | | ---------------------------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `unbridgeCameras` | `false` | if `true`, all Ring Cameras we be treated as external accessories, which generally leads to better performance. This means they each need to be individually added to HomeKit. WARNING: If your cameras are already bridged, they will be deleted from HomeKit when you enable this option, and you will need to reconfigure any associated automations or HomeKit settings | +| `unbridgeCameras` | `false` | if `true`, all Ring Cameras we be treated as external accessories, which generally leads to better performance. This means they each need to be individually added to HomeKit. This option will be enabled by default in the next major release. WARNING: If your cameras are already bridged, they will be deleted from HomeKit when you enable this option, and you will need to reconfigure any associated automations or HomeKit settings | | `alarmOnEntryDelay` | `false` | if `true`, HomeKit will register a delayed entry event as a triggered alarm. There are some households where this is a nice feature as a heads up if you have other people who enter your house and you want an alert so that you can disable the alarm for them before it actually goes off. This works well if you automatically arm/disarm on leave/arrive (see setup instructions below) | | `beamDurationSeconds` | `60` for light groups, previous from Ring app for individual lights | Ring smart lighting has a default behavior of only staying on for 60 seconds when you turn on a light via the Ring app. To force a duration when the light is turned on from HomeKit, set this option to a specific number of seconds. If this option is not set, the lights will use the duration from the previous time the light was turned on in the Ring app. For light groups, this will default to 60 seconds. The maximum value is `32767`, which is ~9.1 hours. | | `hideDeviceIds` | `[]` | Allows you to hide specific devices by an array of ids. The id for each device is logged when homebridge starts. | diff --git a/packages/homebridge-ring/config.schema.json b/packages/homebridge-ring/config.schema.json index 03ea0be1..d0f2fbbd 100644 --- a/packages/homebridge-ring/config.schema.json +++ b/packages/homebridge-ring/config.schema.json @@ -19,7 +19,7 @@ "unbridgeCameras": { "title": "Unbridge Cameras", "type": "boolean", - "description": "If enabled, all Ring Cameras we be treated as external accessories, which generally leads to better performance. This means they each need to be individually added to HomeKit. WARNING: If your cameras are already bridged, they will be deleted from HomeKit when you enable this option, and you will need to reconfigure any associated automations or HomeKit settings" + "description": "If enabled, all Ring Cameras we be treated as external accessories, which generally leads to better performance. This means they each need to be individually added to HomeKit. This option will be enabled by default in the next major release. WARNING: If your cameras are already bridged, they will be deleted from HomeKit when you enable this option, and you will need to reconfigure any associated automations or HomeKit settings" }, "alarmOnEntryDelay": { "title": "Alarm on Entry Delay", diff --git a/packages/homebridge-ring/ring-platform.ts b/packages/homebridge-ring/ring-platform.ts index 404a933e..d40c24e4 100644 --- a/packages/homebridge-ring/ring-platform.ts +++ b/packages/homebridge-ring/ring-platform.ts @@ -39,7 +39,7 @@ import { Switch } from './switch' import { Camera } from './camera' import { PanicButtons } from './panic-buttons' import { RefreshTokenAuth } from 'ring-client-api/rest-client' -import { logInfo, useLogger } from 'ring-client-api/util' +import { logError, logInfo, useLogger } from 'ring-client-api/util' import { BaseAccessory } from './base-accessory' import { FloodFreezeSensor } from './flood-freeze-sensor' import { FreezeSensor } from './freeze-sensor' @@ -208,6 +208,7 @@ export class RingPlatform implements DynamicPlatformPlugin { platformAccessories: PlatformAccessory[] = [], externalAccessories: PlatformAccessory[] = [], activeAccessoryIds: string[] = [] + let hasBridgedCameras = false logInfo('Found the following locations:') @@ -354,6 +355,8 @@ export class RingPlatform implements DynamicPlatformPlugin { this.homebridgeAccessories[uuid] = homebridgeAccessory activeAccessoryIds.push(uuid) + + hasBridgedCameras ||= isCamera && !isExternalCamera }, ) }), @@ -400,5 +403,11 @@ export class RingPlatform implements DynamicPlatformPlugin { }) }, ) + + if (hasBridgedCameras) { + logError( + 'Bridged camera support will be removed in the next major release of homebridge-ring. Please enable the unbridgeCameras option in your configuration and add the individual cameras to HomeKit to prepare for this change.', + ) + } } }