Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ export const DEVICE_CLASS_MAP: Record<string, string> = {
'Smart Lock Pro': 'WoSmartLockPro',
'Smart Lock Pro Wifi': 'WoSmartLockProWiFi',
'Smart Lock Ultra': 'WoSmartLockPro',
'Lock Ultra': 'WoSmartLockPro', // deviceType in the Lock Ultra status response
'Lock Vision': 'WoSmartLockVision',
'Lock Vision Pro': 'WoSmartLockVisionPro',
'Keypad': 'WoKeypad',
Expand All @@ -337,6 +338,8 @@ export const DEVICE_CLASS_MAP: Record<string, string> = {
'SwitchBot Floor Lamp': 'WoFloorLamp',
'RGBICWW Strip Light': 'WoRGBICWWStripLight',
'SwitchBot RGBICWW Strip Light': 'WoRGBICWWStripLight',
// Same OpenAPI commands as the RGBICWW Strip Light: turnOn/turnOff/toggle, setBrightness, setColor, setColorTemperature
'Permanent Outdoor Lights': 'WoRGBICWWStripLight',
'RGBICWW Floor Lamp': 'WoRGBICWWFloorLamp',
'SwitchBot RGBICWW Floor Lamp': 'WoRGBICWWFloorLamp',
'Art Frame': 'WoArtFrame',
Expand Down
25 changes: 25 additions & 0 deletions test/devices/openapi-commands.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,31 @@ describe('openAPI commands', () => {
expect(calls()).toEqual([['setColor', '255:128:0']])
})

// devices/lighting/permanent-outdoor-lights.md
it('permanent Outdoor Lights send the documented light commands', async () => {
const { device, calls } = await apiDevice('Permanent Outdoor Lights')
await device.turnOn()
await device.turnOff()
await device.setBrightness(40)
await device.setColorTemperature(2700)
await device.setColor(255, 128, 0)
expect(calls()).toEqual([
['turnOn', undefined],
['turnOff', undefined],
['setBrightness', 40],
['setColorTemperature', 2700],
['setColor', '255:128:0'],
])
})

// devices/locks-security/lock-ultra.md: the status response reports deviceType "Lock Ultra"
it('lock Ultra sends lock and unlock', async () => {
const { device, calls } = await apiDevice('Lock Ultra')
await device.lock()
await device.unlock()
expect(calls()).toEqual([['lock', undefined], ['unlock', undefined]])
})

it('color Bulb sends setColorTemperature in kelvin', async () => {
const { device, calls } = await apiDevice('Color Bulb')
await device.setColorTemp(2700, 6500, 4000)
Expand Down
2 changes: 2 additions & 0 deletions test/types/device-type-resolution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ describe('openAPI deviceType names', () => {
['Smart Lock Pro', 'WoSmartLockPro'],
['Smart Lock Pro Wifi', 'WoSmartLockProWiFi'],
['Smart Lock Ultra', 'WoSmartLockPro'],
['Lock Ultra', 'WoSmartLockPro'],
['Permanent Outdoor Lights', 'WoRGBICWWStripLight'],
['Air Purifier VOC', 'WoAirPurifier'],
['Air Purifier Table PM2.5', 'WoAirPurifierTable'],
['Air Purifier Table VOC', 'WoAirPurifierTable'],
Expand Down
Loading