Skip to content

Add support for SwitchBot Lock Ultra via Hub Mini on beta-4.3.2#1273

Closed
Copilot wants to merge 5 commits intobeta-4.3.2from
copilot/fix-1271
Closed

Add support for SwitchBot Lock Ultra via Hub Mini on beta-4.3.2#1273
Copilot wants to merge 5 commits intobeta-4.3.2from
copilot/fix-1271

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Aug 28, 2025

This PR adds support for SwitchBot Lock Ultra devices to work via Hub Mini through the OpenAPI connection, addressing the feature request to enable Lock Ultra functionality with existing Hub Mini infrastructure.

Note: This implementation has been rebased onto the beta-4.3.2 branch as requested for proper integration with the latest development version.

Changes Made

The implementation reuses the existing Lock class infrastructure with minimal changes:

  1. Device Type Recognition: Added 'Smart Lock Ultra' to the device type handlers in platform.ts
  2. Model Mapping: Lock Ultra uses the same SwitchBotModel.LockPro model as Lock Pro for full feature compatibility
  3. Configuration Support: Updated type definitions in settings.ts to include Lock Ultra as a valid lockConfig device type
  4. UI Configuration: Added complete configuration schema for Lock Ultra in config.schema.json with all lock-specific options (contact sensor hiding, latch button activation, connection types, etc.)
  5. Documentation: Updated README.md to list Lock Ultra as a supported device

Technical Details

Lock Ultra leverages the existing Lock class implementation, treating it functionally equivalent to Lock Pro. This approach ensures:

  • Full OpenAPI support via Hub Mini (as requested)
  • BLE connection support for direct device communication
  • All existing Lock Pro features: contact sensor, latch button, webhooks, caching options
  • Consistent configuration and management experience

Testing

  • ✅ TypeScript compilation passes on beta-4.3.2
  • ✅ All existing tests continue to pass
  • ✅ Plugin loads successfully with new device type
  • ✅ Documentation builds without errors

The implementation follows the existing pattern used for Lock Pro and maintains backward compatibility while extending support to the newer Lock Ultra hardware.

Fixes #1271.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits August 21, 2025 00:28
…t development (#1262)

This PR creates comprehensive GitHub Copilot instructions to help
developers work effectively with the homebridge-switchbot codebase. The
instructions provide detailed guidance on building, testing, and
developing this TypeScript Homebridge platform plugin for SwitchBot
smart home devices.

## Key Features Added

**Complete Development Workflow Documentation:**
- Bootstrap and build process with exact commands and timing
expectations
- Dependency installation with required `--legacy-peer-deps` flag due to
TypeDoc conflicts
- TypeScript compilation and plugin UI building (~7 seconds)
- Test execution with Vitest (~2 seconds)
- Documentation generation with TypeDoc (~7 seconds)

**Validation Scenarios:**
- Manual plugin validation to ensure proper Homebridge registration
- Plugin loading verification with Node.js
- TypeScript compilation validation
- Documentation generation without warnings
- Complete workflow timing (~16 seconds total)

**Codebase Navigation Guide:**
- Detailed project structure with 38 TypeScript files across device and
IR device modules
- Key development areas for common tasks (adding devices, configuration
changes)
- File relationships and dependencies
- Base classes and extension patterns for device implementations

**Known Issues and Workarounds:**
- Documented dependency conflicts requiring `--legacy-peer-deps`
- ESLint configuration issues with import/extensions rule
- Build artifact management with updated .gitignore

**Timing and Performance Guidelines:**
- All commands tested with realistic timing expectations
- "NEVER CANCEL" warnings for builds with appropriate timeout
recommendations
- Complete validation workflow benchmarked at under 20 seconds

## Validation

All commands and scenarios in the instructions have been thoroughly
tested and validated to ensure they work correctly in a fresh
development environment. The instructions follow the imperative tone
requirement and provide exhaustive coverage of the development workflow.

The file is located at `.github/copilot-instructions.md` and provides
over 7,000 characters of comprehensive guidance for GitHub Copilot to
work effectively with this codebase.

Fixes #1261.

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: donavanbecker <9875439+donavanbecker@users.noreply.github.com>
Co-authored-by: donavanbecker <9875439+donavanbecker@users.noreply.github.com>
Copilot AI changed the title [WIP] Feature Request: Support Lock Ultra via Hub Mini (not Matter) Add support for SwitchBot Lock Ultra via Hub Mini Aug 28, 2025
Copilot AI requested a review from donavanbecker August 28, 2025 01:05
@donavanbecker donavanbecker changed the base branch from latest to beta-4.3.2 August 28, 2025 04:57
@donavanbecker donavanbecker marked this pull request as ready for review August 28, 2025 04:57
@github-actions github-actions bot added enhancement New feature or request dependencies Pull requests that update a dependency file workflow docs latest labels Aug 28, 2025
@donavanbecker
Copy link
Copy Markdown
Collaborator

@copilot rework this or by rebasing to beta-* branch

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Aug 28, 2025

@copilot rework this or by rebasing to beta-* branch

I've rebased the Lock Ultra support onto the beta-4.3.2 branch as requested. The implementation is now on the new branch copilot/fix-1271-beta based on beta-4.3.2 instead of the main branch. All changes have been successfully applied and validated (build passes, tests pass, plugin loads correctly). Commit: 75467c4

Copilot AI changed the title Add support for SwitchBot Lock Ultra via Hub Mini Add support for SwitchBot Lock Ultra via Hub Mini on beta-4.3.2 Aug 28, 2025
Copilot AI requested a review from donavanbecker August 28, 2025 18:07
@donavanbecker donavanbecker deleted the copilot/fix-1271 branch November 2, 2025 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file docs enhancement New feature or request latest workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Support Lock Ultra via Hub Mini (not Matter)

3 participants