@switchbot/homebridge-switchbot 5.2.3 → 5.2.5

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.
@@ -1880,7 +1880,7 @@ async function importDiscoveredDevice(device) {
1880
1880
  ["auto", "ble", "openapi"].forEach((val) => {
1881
1881
  const opt = document.createElement("option");
1882
1882
  opt.value = val;
1883
- opt.text = val.charAt(0).toUpperCase() + val.slice(1);
1883
+ opt.text = val === "ble" ? "BLE" : val === "openapi" ? "OpenAPI" : "Auto";
1884
1884
  opt.selected = (device.connectionPreference || "auto") === val;
1885
1885
  connectionPrefSelect.appendChild(opt);
1886
1886
  });
@@ -2179,7 +2179,7 @@ async function editDevice(device) {
2179
2179
  nameLabel.style.color = "#6b7280";
2180
2180
  const nameInput = document.createElement("input");
2181
2181
  nameInput.type = "text";
2182
- nameInput.value = device.name || device.id;
2182
+ nameInput.value = device.configDeviceName || device.name || "";
2183
2183
  nameInput.style.width = "100%";
2184
2184
  nameInput.style.marginBottom = "12px";
2185
2185
  nameInput.style.padding = "8px 10px";
@@ -2237,7 +2237,7 @@ async function editDevice(device) {
2237
2237
  ["auto", "ble", "openapi"].forEach((val) => {
2238
2238
  const opt = document.createElement("option");
2239
2239
  opt.value = val;
2240
- opt.text = val.charAt(0).toUpperCase() + val.slice(1);
2240
+ opt.text = val === "ble" ? "BLE" : val === "openapi" ? "OpenAPI" : "Auto";
2241
2241
  opt.selected = (device.connectionPreference || "auto") === val;
2242
2242
  connectionPrefSelect.appendChild(opt);
2243
2243
  });
@@ -2325,7 +2325,7 @@ async function editDevice(device) {
2325
2325
  const { updateDevice: updateDevice2, syncParentPluginConfigFromDisk: syncParentPluginConfigFromDisk2, fetchDevices: fetchDevices2 } = await Promise.resolve().then(() => (init_api(), api_exports));
2326
2326
  const { renderDeviceList: renderDeviceList2 } = await Promise.resolve().then(() => (init_render(), render_exports));
2327
2327
  const params = {
2328
- deviceId: device.id,
2328
+ deviceId: device.deviceId,
2329
2329
  configDeviceName: nameInput.value || void 0,
2330
2330
  configDeviceType: typeSelect.value,
2331
2331
  connectionPreference: connectionPrefSelect.value,