Update alexa channel attribute (#1284)

Signed-off-by: jsetton <jeremy.setton@gmail.com>
pull/1313/head
Jeremy 2022-01-19 12:16:50 -05:00 committed by GitHub
parent 5b30761d60
commit 1bdbdf9d21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 9 deletions

View File

@ -93,8 +93,8 @@ export default {
Channel: {
itemTypes: ['Number', 'String'],
parameters: (item) => [
p.channelMappings(item.stateDescription, item.type === 'String'),
...(item.type === 'Number' ? [p.channelRange()] : []),
p.channelMappings(item.type === 'String'),
...(item.type === 'Number' ? [p.channelRange()] : [p.supportsChannelNumber()]),
p.retrievable()
]
},

View File

@ -39,17 +39,11 @@ export default {
multiple: true,
required: !defaultValue
}),
channelMappings: (stateDescription, required) => ({
channelMappings: (required) => ({
name: 'channelMappings',
label: 'Channel Mappings',
description: 'Each mapping formatted as <code>channelId=channelName<code>',
type: 'TEXT',
default:
stateDescription &&
stateDescription.options &&
stateDescription.options
.filter((option) => !isNaN(option.value))
.map((option) => `${option.value}=${option.label}`),
placeholder: '2=CBS\n4=NBC\n7=ABC\n13=PBS',
multiple: true,
required
@ -405,6 +399,13 @@ export default {
advanced: true,
visible: (_, config) => !config.binding
}),
supportsChannelNumber: () => ({
name: 'supportsChannelNumber',
label: 'Supports Channel Requests by Number',
type: 'BOOLEAN',
default: false,
advanced: true
}),
supportsDeactivation: () => ({
name: 'supportsDeactivation',
label: 'Supports Deactivation',