homebridge-smartthings-oauth 1.0.44-beta.7 → 1.0.45

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/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [1.0.45] - OAuth Wizard Popup Fix
5
+
6
+ ### Fixed
7
+ - **OAuth Wizard popup blocked**: The SmartThings login popup in step 3 of the OAuth wizard was silently blocked by browsers for many users. The `window.open()` call happened after an `await`, which breaks the browser's user-gesture context and triggers popup blockers. The window is now opened synchronously before the async call to preserve the gesture chain.
8
+ - **Popup fallback URL field**: Step 3 now always displays a copyable URL field with the authorization link, so users can manually open it if the popup is still blocked by stricter browser settings.
9
+
4
10
  ## [1.0.44] - Samsung Frame TV, TV App Launcher & Washer Service
5
11
 
6
12
  ### Added
@@ -22,6 +28,10 @@ All notable changes to this project will be documented in this file.
22
28
  - **MultiServiceAccessory**: Detects Frame TV devices by matching the SmartThings device name against `frameTvDevices` config entries (case-insensitive). Creates a shared `SamsungWebSocket` instance used by both the TV service and Art Mode switch.
23
29
  - **Platform**: Registers Art Mode accessories as separate platform accessories after device discovery, with UUIDs derived from `deviceId + '-artmode'` to ensure uniqueness.
24
30
 
31
+ ### Fixed
32
+ - **Art Mode Accessory Registration**: Fixed incorrect `PLUGIN_NAME` (`homebridge-smartthings-ik` instead of `homebridge-smartthings-oauth`) which prevented the Art Mode switch from appearing in HomeKit.
33
+ - **Art Mode Accessory Persistence**: Fixed a bug where the Art Mode accessory was unregistered and re-registered on every restart because its derived UUID didn't match any SmartThings device ID. Art Mode accessories are now excluded from the cleanup loop.
34
+
25
35
  ### Security
26
36
  - **Dependency audit**: Fixed all 6 npm audit vulnerabilities (axios, form-data, glob, js-yaml, brace-expansion, diff) — 0 vulnerabilities remaining.
27
37
 
package/README.md CHANGED
@@ -347,6 +347,35 @@ If you accidentally denied the connection, the TV remembers this decision and wi
347
347
 
348
348
  ---
349
349
 
350
+ ## TV App Launcher (Optional)
351
+
352
+ Launch Samsung TV apps directly from the HomeKit TV input picker. Apps appear as additional input sources alongside your HDMI inputs.
353
+
354
+ ### Setup
355
+
356
+ 1. Open plugin settings in the Homebridge UI
357
+ 2. Scroll to the **"TV App Shortcuts"** section
358
+ 3. Select which apps to enable (Netflix, YouTube, Disney+, Shahid, and more)
359
+ 4. Save and restart Homebridge
360
+
361
+ Selected apps will appear in the input source list of your TV accessory in HomeKit. Selecting an app input will launch it on the TV using the `custom.launchapp` SmartThings capability.
362
+
363
+ No apps are enabled by default.
364
+
365
+ ---
366
+
367
+ ## Washer Support
368
+
369
+ Samsung washers with the `washerOperatingState` capability are automatically discovered and exposed as a HomeKit **Valve** accessory with:
370
+
371
+ - **Active**: Whether the washer is running
372
+ - **In Use**: Whether a wash cycle is in progress
373
+ - **Remaining Duration**: Countdown timer showing time left in the current cycle
374
+
375
+ No additional configuration is needed — washers are detected and added automatically during device discovery.
376
+
377
+ ---
378
+
350
379
  ## Troubleshooting
351
380
 
352
381
  ### Common Issues
@@ -159,6 +159,17 @@
159
159
 
160
160
  <div class="tab-pane fade" id="step3">
161
161
  <h4>Step 3: Enter Authorization Code</h4>
162
+
163
+ <div id="oauth-auth-url-box" class="alert alert-info" style="display:none">
164
+ <strong>A login page should have opened automatically.</strong> If it didn't, copy the URL below and open it in your browser:<br>
165
+ <div class="input-group mt-2">
166
+ <input type="text" class="form-control form-control-sm" id="oauth-auth-url" readonly>
167
+ <div class="input-group-append">
168
+ <button class="btn btn-sm btn-outline-secondary" type="button" onclick="copyAuthUrl()">Copy</button>
169
+ </div>
170
+ </div>
171
+ </div>
172
+
162
173
  <p>Paste the <code>args.code</code> value from the httpbin.org response below.</p>
163
174
  <p class="text-muted">Example: The JSON response will look like <code>{"args": {"code": "xxxxxx"}, ...}</code>. Copy just the code value.</p>
164
175
 
@@ -388,7 +399,19 @@
388
399
  document.querySelector(targetTab.getAttribute('data-target')).classList.add('show', 'active');
389
400
  }
390
401
 
402
+ function copyAuthUrl() {
403
+ var input = document.getElementById('oauth-auth-url');
404
+ input.select();
405
+ document.execCommand('copy');
406
+ homebridge.toast.success('URL copied to clipboard');
407
+ }
408
+
391
409
  async function requestAuthCode() {
410
+ // Open window synchronously (before await) to avoid popup blockers.
411
+ // Browsers only allow window.open() in direct response to user clicks;
412
+ // an await breaks that gesture context and the popup gets silently blocked.
413
+ const popup = window.open('about:blank', '_blank');
414
+
392
415
  try {
393
416
  const payload = {
394
417
  clientId: document.getElementById('oauth-client-id').value,
@@ -398,9 +421,18 @@
398
421
  };
399
422
 
400
423
  const authUrl = await homebridge.request('/authCode', payload);
401
- window.open(authUrl, "_blank");
424
+
425
+ // Always show the URL field as a fallback
426
+ document.getElementById('oauth-auth-url').value = authUrl;
427
+ document.getElementById('oauth-auth-url-box').style.display = 'block';
428
+
429
+ if (popup && !popup.closed) {
430
+ popup.location.href = authUrl;
431
+ }
432
+
402
433
  return authUrl;
403
434
  } catch (err) {
435
+ if (popup && !popup.closed) popup.close();
404
436
  console.error('requestAuthCode error:', err);
405
437
  homebridge.toast.error("Could not generate authorization URL. Please check your credentials.");
406
438
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "private": false,
3
3
  "displayName": "Homebridge Smartthings oAuth Plugin",
4
4
  "name": "homebridge-smartthings-oauth",
5
- "version": "1.0.44-beta.7",
5
+ "version": "1.0.45",
6
6
  "description": "Connects SmartThings devices to Homebridge. Automatically discovers devices.",
7
7
  "license": "Apache-2.0",
8
8
  "repository": {