-
-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #605 : Add Innr plug, Hue iris & OSRAM Plug
- Loading branch information
1 parent
21096f1
commit b6d20c0
Showing
3 changed files
with
151 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const { | ||
DEVICE_FEATURE_CATEGORIES, | ||
DEVICE_FEATURE_TYPES, | ||
DEVICE_POLL_FREQUENCIES, | ||
} = require('../../../../utils/constants'); | ||
|
||
const { LIGHT_EXTERNAL_ID_BASE } = require('../utils/consts'); | ||
|
||
const getPlugOnOff = (philipsHueLight, bridgeSerialNumber, serviceId) => ({ | ||
name: philipsHueLight.name, | ||
service_id: serviceId, | ||
external_id: `${LIGHT_EXTERNAL_ID_BASE}:${bridgeSerialNumber}:${philipsHueLight.id}`, | ||
selector: `${LIGHT_EXTERNAL_ID_BASE}:${bridgeSerialNumber}:${philipsHueLight.id}`, | ||
should_poll: true, | ||
model: philipsHueLight.modelid, | ||
poll_frequency: DEVICE_POLL_FREQUENCIES.EVERY_MINUTES, | ||
features: [ | ||
{ | ||
name: `${philipsHueLight.name} On/Off`, | ||
read_only: false, | ||
has_feedback: false, | ||
external_id: `${LIGHT_EXTERNAL_ID_BASE}:${bridgeSerialNumber}:${philipsHueLight.id}:${DEVICE_FEATURE_TYPES.SWITCH.BINARY}`, | ||
selector: `${LIGHT_EXTERNAL_ID_BASE}:${bridgeSerialNumber}:${philipsHueLight.id}:${DEVICE_FEATURE_TYPES.SWITCH.BINARY}`, | ||
category: DEVICE_FEATURE_CATEGORIES.SWITCH, | ||
type: DEVICE_FEATURE_TYPES.LIGHT.BINARY, | ||
min: 0, | ||
max: 1, | ||
}, | ||
], | ||
}); | ||
|
||
module.exports = { | ||
getPlugOnOff, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters