Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit alexa parameter state description options #1621

Merged
merged 1 commit into from
Jan 5, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export const OPEN_STATES = ['CLOSED', 'OPEN']

export const PLAYBACK_OPERATIONS = ['Play', 'Pause', 'Next', 'Previous', 'FastForward', 'Rewind']

export const STATE_DESCRIPTION_OPTIONS_LIMIT = 150

export const TEMPERATURE_SCALES = ['CELSIUS', 'FAHRENHEIT']

export const THERMOSTAT_MODES = ['OFF', 'HEAT', 'COOL', 'ECO', 'AUTO']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
EQUALIZER_MODES,
LANGUAGES,
PLAYBACK_OPERATIONS,
STATE_DESCRIPTION_OPTIONS_LIMIT,
TEMPERATURE_SCALES,
THERMOSTAT_MODES,
UNITS_OF_MEASURE
Expand Down Expand Up @@ -232,7 +233,8 @@ export default {
stateDescription.options &&
stateDescription.options
.filter((option) => !isNaN(option.value))
.map((option) => `${option.value}=${option.label}`),
.map((option) => `${option.value}=${option.label}`)
.slice(0, STATE_DESCRIPTION_OPTIONS_LIMIT),
placeholder: placeholder.replace(/,/g, '\n'),
multiple: true
}),
Expand Down Expand Up @@ -356,7 +358,9 @@ export default {
default:
stateDescription &&
stateDescription.options &&
stateDescription.options.map((option) => `${option.value}=${option.label}`),
stateDescription.options
.map((option) => `${option.value}=${option.label}`)
.slice(0, STATE_DESCRIPTION_OPTIONS_LIMIT),
placeholder: placeholder.replace(/,/g, '\n'),
multiple: true,
required: !stateDescription || !stateDescription.options || !stateDescription.options.length
Expand All @@ -370,7 +374,9 @@ export default {
default:
stateDescription &&
stateDescription.options &&
stateDescription.options.map((option) => `${option.value}=${option.label}`),
stateDescription.options
.map((option) => `${option.value}=${option.label}`)
.slice(0, STATE_DESCRIPTION_OPTIONS_LIMIT),
placeholder: 'Normal=Normal:Cottons\nWhites=Whites',
multiple: true,
required: !stateDescription || !stateDescription.options || !stateDescription.options.length
Expand Down