Skip to content

Commit 4d519c7

Browse files
committed
Phase 3
1 parent f0fb8fa commit 4d519c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2094
-93
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
},
3737
"scripts": {
3838
"check": "npm install && npm outdated",
39-
"lint": "eslint src/**/*.ts test/**/*.ts",
39+
"type-check": "tsc --noEmit",
40+
"lint": "eslint src/**/*.ts test/**/*.ts && npm run type-check",
4041
"lint:fix": "eslint src/**/*.ts test/**/*.ts --fix",
4142
"lint:src": "eslint src/**/*.ts",
4243
"lint:test": "eslint test/**/*.ts",
@@ -48,7 +49,6 @@
4849
"test": "vitest run",
4950
"test:watch": "vitest watch",
5051
"test-coverage": "npm run test -- --coverage",
51-
"type-check": "tsc --noEmit",
5252
"ble:scan": "node tmp-switchbot-scan.mjs",
5353
"docs": "typedoc",
5454
"lint-docs": "typedoc --emit none --treatWarningsAsErrors"

src/devices/index.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,32 @@ export { DeviceOverrideStateDuringConnection } from './device-override-state-dur
88
export { SequenceDevice } from './sequence-device.js'
99
export { WoAirPurifierTable } from './wo-air-purifier-table.js'
1010
export { WoAirPurifier } from './wo-air-purifier.js'
11+
export { WoArtFrame } from './wo-art-frame.js'
1112
export { WoBlindTilt } from './wo-blind-tilt.js'
1213
export { WoBulb } from './wo-bulb.js'
1314
export { WoCeilingLight } from './wo-ceiling-light.js'
15+
export { WoCirculatorFan } from './wo-circulator-fan.js'
16+
export { WoClimatePanel } from './wo-climate-panel.js'
1417
export { WoContact } from './wo-contact.js'
1518
export { WoCurtain } from './wo-curtain.js'
19+
export { WoFloorLamp } from './wo-floor-lamp.js'
20+
export { WoGarageDoorOpener } from './wo-garage-door-opener.js'
1621
export { WoHand } from './wo-hand.js'
1722
export { WoHub2 } from './wo-hub2.js'
1823
export { WoHub3 } from './wo-hub3.js'
24+
export { WoHubMiniMatter } from './wo-hubmini-matter.js'
1925
export { WoHumi2 } from './wo-humi2.js'
2026
export { WoHumi } from './wo-humi.js'
2127
export { WoIOSensorTH } from './wo-io-sensor-th.js'
28+
export { WoKeypadVisionPro } from './wo-keypad-vision-pro.js'
29+
export { WoKeypadVision } from './wo-keypad-vision.js'
2230
export { WoKeypad } from './wo-keypad.js'
2331
export { WoLeak } from './wo-leak.js'
32+
export { WoSmartLockLite } from './wo-lock-lite.js'
33+
export { WoSmartLockProWiFi } from './wo-lock-pro-wifi.js'
2434
export { WoSmartLockPro } from './wo-lock-pro.js'
35+
export { WoSmartLockVisionPro } from './wo-lock-vision-pro.js'
36+
export { WoSmartLockVision } from './wo-lock-vision.js'
2537
export { WoSmartLock } from './wo-lock.js'
2638
export { WoPlugMiniJP } from './wo-plug-mini-jp.js'
2739
export { WoPlugMiniUS } from './wo-plug-mini-us.js'
@@ -31,8 +43,21 @@ export { WoRelaySwitch1PM } from './wo-relay-switch-1pm.js'
3143
export { WoRelaySwitch2PM } from './wo-relay-switch-2pm.js'
3244
export { WoRemote } from './wo-remote.js'
3345
export { WoRGBICBulb } from './wo-rgbic-bulb.js'
46+
export { WoRGBICWWFloorLamp } from './wo-rgbicww-floor-lamp.js'
47+
export { WoRGBICWWStripLight } from './wo-rgbicww-strip-light.js'
48+
export { WoRollerShade } from './wo-roller-shade.js'
3449
export { WoSensorTHPlus } from './wo-sensor-th-plus.js'
3550
export { WoSensorTHProCO2 } from './wo-sensor-th-pro-co2.js'
3651
export { WoSensorTHPro } from './wo-sensor-th-pro.js'
3752
export { WoSensorTH } from './wo-sensor-th.js'
53+
export { WoSmartThermostatRadiator } from './wo-smart-thermostat-radiator.js'
54+
export { WoStripLight3 } from './wo-strip-light-3.js'
3855
export { WoStrip } from './wo-strip.js'
56+
export { WoVacuumK10Plus } from './wo-vacuum-k10-plus.js'
57+
export { WoVacuumK10ProCombo } from './wo-vacuum-k10-pro-combo.js'
58+
export { WoVacuumK10Pro } from './wo-vacuum-k10-pro.js'
59+
export { WoVacuumK11Plus } from './wo-vacuum-k11-plus.js'
60+
export { WoVacuumK20 } from './wo-vacuum-k20.js'
61+
export { WoVacuumS10 } from './wo-vacuum-s10.js'
62+
export { WoVacuumS20 } from './wo-vacuum-s20.js'
63+
export { WoVacuum } from './wo-vacuum.js'

src/devices/wo-art-frame.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* Copyright(C) 2024-2026, donavanbecker (https://github.com/donavanbecker). All rights reserved.
2+
*
3+
* devices/wo-art-frame.ts: SwitchBot v4.0.0 - Art Frame
4+
*/
5+
6+
import { WoBulb } from './wo-bulb.js'
7+
8+
/**
9+
* Art Frame Device
10+
* Uses same logic as Color Bulb
11+
*/
12+
export class WoArtFrame extends WoBulb {}

src/devices/wo-circulator-fan.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* Copyright(C) 2024-2026, donavanbecker (https://github.com/donavanbecker). All rights reserved.
2+
*
3+
* devices/wo-circulator-fan.ts: SwitchBot v4.0.0 - Circulator Fan Device
4+
*/
5+
6+
import { WoAirPurifier } from './wo-air-purifier.js'
7+
8+
/**
9+
* Circulator Fan Device (Battery/USB)
10+
* Reuses air purifier fan-speed control and status behavior.
11+
*/
12+
export class WoCirculatorFan extends WoAirPurifier {}

src/devices/wo-climate-panel.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* Copyright(C) 2024-2026, donavanbecker (https://github.com/donavanbecker). All rights reserved.
2+
*
3+
* devices/wo-climate-panel.ts: SwitchBot v4.0.0 - Climate Panel Device
4+
*/
5+
6+
import { WoAirPurifier } from './wo-air-purifier.js'
7+
8+
/**
9+
* Climate Panel Device
10+
* Reuses climate control behavior for power, mode, and fan-speed style control.
11+
*/
12+
export class WoClimatePanel extends WoAirPurifier {}

src/devices/wo-floor-lamp.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* Copyright(C) 2024-2026, donavanbecker (https://github.com/donavanbecker). All rights reserved.
2+
*
3+
* devices/wo-floor-lamp.ts: SwitchBot v4.0.0 - Floor Lamp
4+
*/
5+
6+
import { WoBulb } from './wo-bulb.js'
7+
8+
/**
9+
* Floor Lamp Device
10+
* Uses same logic as Color Bulb
11+
*/
12+
export class WoFloorLamp extends WoBulb {}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* Copyright(C) 2024-2026, donavanbecker (https://github.com/donavanbecker). All rights reserved.
2+
*
3+
* devices/wo-garage-door-opener.ts: SwitchBot v4.0.0 - Garage Door Opener Device
4+
*/
5+
6+
import { WoRelaySwitch1 } from './wo-relay-switch-1.js'
7+
8+
/**
9+
* Garage Door Opener Device (uses relay switch control)
10+
* Extends Relay Switch 1 for simple open/close control
11+
*/
12+
export class WoGarageDoorOpener extends WoRelaySwitch1 {}

src/devices/wo-hubmini-matter.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* Copyright(C) 2024-2026, donavanbecker (https://github.com/donavanbecker). All rights reserved.
2+
*
3+
* devices/wo-hubmini-matter.ts: SwitchBot v4.0.0 - HubMini Matter Device
4+
*/
5+
6+
import { WoHub2 } from './wo-hub2.js'
7+
8+
/**
9+
* HubMini Matter Device
10+
* Uses same hub logic as Hub 2
11+
*/
12+
export class WoHubMiniMatter extends WoHub2 {}

src/devices/wo-humi2.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,25 @@ import { WoHumi } from './wo-humi.js'
99
* Humidifier 2 Device
1010
* Uses same logic as Humidifier
1111
*/
12-
export class WoHumi2 extends WoHumi {}
12+
export class WoHumi2 extends WoHumi {
13+
/**
14+
* Set auto mode
15+
*/
16+
async setAuto(): Promise<boolean> {
17+
return this.setMode('auto')
18+
}
19+
20+
/**
21+
* Set manual mode
22+
*/
23+
async setManual(): Promise<boolean> {
24+
return this.setMode('manual')
25+
}
26+
27+
/**
28+
* Set target humidity level (mapped to nebulization efficiency)
29+
*/
30+
async setLevel(level: number): Promise<boolean> {
31+
return this.setEfficiency(level)
32+
}
33+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* WoKeypadVisionPro device class for SwitchBot Keypad Vision Pro
3+
* Extends base WoKeypad functionality for lock keypad operations
4+
*/
5+
import type { KeypadStatus } from '../types/device.js'
6+
import { WoKeypad } from './wo-keypad.js'
7+
8+
/**
9+
* SwitchBot Keypad Vision Pro device
10+
* @extends WoKeypad
11+
*/
12+
export class WoKeypadVisionPro extends WoKeypad {
13+
/**
14+
* Get keypad status (inherited from WoKeypad)
15+
* @returns Promise resolving to KeypadStatus
16+
*/
17+
async getStatus(): Promise<KeypadStatus> {
18+
return super.getStatus()
19+
}
20+
}

0 commit comments

Comments
 (0)