@switchbot/homebridge-switchbot 5.0.0-beta.132 → 5.0.0-beta.134

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.
@@ -91,66 +91,6 @@ export async function importDiscoveredDevice(device: any): Promise<{ configDevic
91
91
  typeSelect.appendChild(optgroup)
92
92
  })
93
93
 
94
- // --- Matter Type Advanced Field (only for window covering types) ---
95
-
96
- // Matter Type advanced field (only for window covering types)
97
- const windowCoveringTypes = ['Roller Shade', 'Curtain', 'Curtain3', 'Blind Tilt']
98
-
99
- const matterTypeLabel = document.createElement('label')
100
- matterTypeLabel.textContent = 'Matter Window Covering Type (Advanced)'
101
- matterTypeLabel.style.display = 'block'
102
- matterTypeLabel.style.marginBottom = '6px'
103
- matterTypeLabel.style.fontWeight = '500'
104
- matterTypeLabel.style.fontSize = '12px'
105
- matterTypeLabel.style.color = '#6b7280'
106
- matterTypeLabel.style.marginTop = '2px'
107
-
108
- // Table 8.2 from Matter spec (partial, most common types)
109
- const matterTypes = [
110
- { value: '', label: 'Auto-detect (recommended)' },
111
- { value: 0, label: 'Roller Shade (0)' },
112
- { value: 1, label: 'Roman Shade (1)' },
113
- { value: 2, label: 'Balloon Shade (2)' },
114
- { value: 3, label: 'Woven Wood (3)' },
115
- { value: 4, label: 'Drapery (4)' },
116
- { value: 5, label: 'Awning (5)' },
117
- { value: 6, label: 'Shutter (6)' },
118
- { value: 7, label: 'Tilt Blind (7)' },
119
- { value: 8, label: 'Blind Tilt (8)' },
120
- { value: 9, label: 'Projector Screen (9)' },
121
- { value: 15, label: 'Other (15)' },
122
- ]
123
-
124
- const matterTypeSelect = document.createElement('select')
125
- matterTypeSelect.style.width = '100%'
126
- matterTypeSelect.style.marginBottom = '12px'
127
- matterTypeSelect.style.padding = '8px 10px'
128
- matterTypeSelect.style.borderRadius = '6px'
129
- matterTypeSelect.style.fontSize = '14px'
130
- matterTypeSelect.style.boxSizing = 'border-box'
131
- matterTypes.forEach((opt) => {
132
- const option = document.createElement('option')
133
- option.value = String(opt.value)
134
- option.textContent = opt.label
135
- if (device.matterType != null && String(opt.value) === String(device.matterType)) {
136
- option.selected = true
137
- }
138
- matterTypeSelect.appendChild(option)
139
- })
140
-
141
- // Show/hide Matter Type field based on type
142
- function updateMatterTypeVisibility() {
143
- if (windowCoveringTypes.includes(typeSelect.value)) {
144
- matterTypeLabel.style.display = 'block'
145
- matterTypeSelect.style.display = 'block'
146
- } else {
147
- matterTypeLabel.style.display = 'none'
148
- matterTypeSelect.style.display = 'none'
149
- }
150
- }
151
- typeSelect.addEventListener('change', updateMatterTypeVisibility)
152
- updateMatterTypeVisibility()
153
-
154
94
  const macLabel = document.createElement('label')
155
95
  macLabel.textContent = 'BLE MAC Address (optional)'
156
96
  macLabel.style.display = 'block'
@@ -243,7 +183,6 @@ export async function importDiscoveredDevice(device: any): Promise<{ configDevic
243
183
  address: macInput.value || undefined,
244
184
  encryptionKey: encryptionKeyInput.value || undefined,
245
185
  keyId: keyIdInput.value || undefined,
246
- ...(windowCoveringTypes.includes(typeSelect.value) && matterTypeSelect.value !== '' ? { matterType: Number(matterTypeSelect.value) } : {}),
247
186
  })
248
187
 
249
188
  div.addEventListener('click', (event) => {
@@ -258,8 +197,6 @@ export async function importDiscoveredDevice(device: any): Promise<{ configDevic
258
197
  contentDiv.appendChild(nameInput)
259
198
  contentDiv.appendChild(typeLabel)
260
199
  contentDiv.appendChild(typeSelect)
261
- contentDiv.appendChild(matterTypeLabel)
262
- contentDiv.appendChild(matterTypeSelect)
263
200
  contentDiv.appendChild(macLabel)
264
201
  contentDiv.appendChild(macInput)
265
202
  contentDiv.appendChild(encryptionKeyLabel)
package/src/platform.ts CHANGED
@@ -97,18 +97,7 @@ export const DEVICE_MATTER_CLUSTERS: Record<string, any> = {
97
97
  }, // Switch in HAP, RobotVacuumCleaner in Matter
98
98
  curtain: {
99
99
  windowCovering: {
100
- // type will be set dynamically via setCurtainMatterTypeAsync
101
- },
102
- async setMatterTypeAsync(config: any, deviceId: string) {
103
- // Find the device in config by id
104
- const device = (config?.devices || []).find((d: any) => (d.deviceId ?? d.id) === deviceId)
105
- if (device && typeof device.matterType === 'number') {
106
- this.windowCovering.type = device.matterType
107
- return device.matterType
108
- }
109
- // Default type if not set in config
110
- this.windowCovering.type = 0
111
- return 0
100
+ type: 5, // GenericWindowCovering - supports lift feature (covers curtain3, rollershade variants via normalization)
112
101
  },
113
102
  }, // WindowCovering → WindowCovering (includes curtain3, rollershade variants via normalization)
114
103
  blindtilt: {