Skip to content

Commit

Permalink
Bump prettier from 3.0.3 to 3.1.0 in /lambda (#633)
Browse files Browse the repository at this point in the history
* Bump prettier from 3.0.3 to 3.1.0 in /lambda

Bumps [prettier](https://github.com/prettier/prettier) from 3.0.3 to 3.1.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](prettier/prettier@3.0.3...3.1.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Fix new prettier formatting errors

Signed-off-by: jsetton <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: jsetton <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: jsetton <[email protected]>
  • Loading branch information
dependabot[bot] and jsetton authored Dec 1, 2023
1 parent d3166fd commit 9be6058
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 30 deletions.
12 changes: 6 additions & 6 deletions lambda/alexa/smarthome/device/attributes/fanSpeed.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ export default class FanSpeed extends DeviceAttribute {
...(level === 0
? { 0: [AlexaAssetCatalog.VALUE_OFF] }
: level === 1
? { 1: [AlexaAssetCatalog.VALUE_LOW, AlexaAssetCatalog.VALUE_MINIMUM] }
: level === Math.ceil(speedLevels / 2)
? { [level]: [AlexaAssetCatalog.VALUE_MEDIUM] }
: level === speedLevels
? { [level]: [AlexaAssetCatalog.VALUE_HIGH, AlexaAssetCatalog.VALUE_MAXIMUM] }
: {})
? { 1: [AlexaAssetCatalog.VALUE_LOW, AlexaAssetCatalog.VALUE_MINIMUM] }
: level === Math.ceil(speedLevels / 2)
? { [level]: [AlexaAssetCatalog.VALUE_MEDIUM] }
: level === speedLevels
? { [level]: [AlexaAssetCatalog.VALUE_HIGH, AlexaAssetCatalog.VALUE_MAXIMUM] }
: {})
}),
{}
)
Expand Down
4 changes: 2 additions & 2 deletions lambda/alexa/smarthome/handlers/channelController.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ export default class ChannelController extends AlexaHandler {
return new RegExp(`^${name}`, 'i').test(mapping);
})
: supportsChannelNumber
? channelNumber
: undefined;
? channelNumber
: undefined;

// Throw invalid value error if command not defined
if (typeof command === 'undefined') {
Expand Down
4 changes: 2 additions & 2 deletions lambda/alexa/smarthome/handlers/colorTemperatureController.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ export default class ColorTemperatureController extends AlexaHandler {
command = !isNaN(increment)
? clamp(parseInt(temperatureState) + (isIncreaseRequest ? -1 : 1) * increment, 0, 100)
: isIncreaseRequest
? ItemValue.DECREASE
: ItemValue.INCREASE;
? ItemValue.DECREASE
: ItemValue.INCREASE;
} else {
// Increment current state by defined value as Number doesn't support IncreaseDecreaseType commands
command = clamp(
Expand Down
4 changes: 2 additions & 2 deletions lambda/alexa/smarthome/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export default class AlexaMetadata {
values: item.metadata?.alexa
? AlexaMetadata.convertValue(item.metadata.alexa.value, ParameterType.LIST)
: item.tags && settings.runtime.version === '2'
? item.tags
: [],
? item.tags
: [],
// Use item alexa metadata config if defined
config: item.metadata?.alexa?.config || {},
// Add group config if defined
Expand Down
4 changes: 2 additions & 2 deletions lambda/alexa/smarthome/properties/generic.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ export default class Generic extends DecoupleState {
const capabilityNames = parameters[Parameter.CAPABILITY_NAMES]
? parameters[Parameter.CAPABILITY_NAMES]
: metadata.isPartOfGroupEndpoint
? [].concat(item.label, item.metadata?.synonyms?.value.split(','))
: this.defaultCapabilityNames;
? [].concat(item.label, item.metadata?.synonyms?.value.split(','))
: this.defaultCapabilityNames;
// Update capability names parameter removing duplicate and invalid labels
parameters[Parameter.CAPABILITY_NAMES] = capabilityNames
.filter((label) => typeof label === 'string')
Expand Down
8 changes: 4 additions & 4 deletions lambda/alexa/smarthome/properties/mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ export default class Mode extends Generic {
.map(([command, labels]) => [command, labels || this.defautCommandLabels[command]])
.reduce((modes, [command, labels]) => ({ ...modes, [command]: labels }), {})
: parameters[Parameter.SUPPORTED_MODES]
? parameters[Parameter.SUPPORTED_MODES]
: item.stateDescription?.options
? Object.fromEntries(item.stateDescription.options.map((option) => [option.value, option.label]))
: {};
? parameters[Parameter.SUPPORTED_MODES]
: item.stateDescription?.options
? Object.fromEntries(item.stateDescription.options.map((option) => [option.value, option.label]))
: {};

// Update supported modes parameter, removing duplicate labels and entries with no valid labels,
// and updating labels shortened format (e.g. Normal=:Cottons,Whites => Normal=Normal:Cottons,Whites=Whites)
Expand Down
8 changes: 4 additions & 4 deletions lambda/alexa/smarthome/properties/rangeValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ export default class RangeValue extends Generic {
const range = parameters[Parameter.SUPPORTED_RANGE]
? parameters[Parameter.SUPPORTED_RANGE]
: item.stateDescription
? [item.stateDescription.minimum, item.stateDescription.maximum, item.stateDescription.step]
: [];
? [item.stateDescription.minimum, item.stateDescription.maximum, item.stateDescription.step]
: [];
// Update supported range values if valid (min < max; max - min > prec), otherwise set to undefined
parameters[Parameter.SUPPORTED_RANGE] =
range[0] < range[1] && range[1] - range[0] > Math.abs(range[2]) ? range : undefined;
Expand All @@ -188,8 +188,8 @@ export default class RangeValue extends Generic {
const presets = parameters[Parameter.PRESETS]
? parameters[Parameter.PRESETS]
: item.stateDescription?.options
? Object.fromEntries(item.stateDescription.options.map((option) => [option.value, option.label]))
: {};
? Object.fromEntries(item.stateDescription.options.map((option) => [option.value, option.label]))
: {};
// Update presets parameter, removing duplicate labels and entries
// with out of range values, not multiple of range precision, or with no valid labels
parameters[Parameter.PRESETS] = Object.entries(presets)
Expand Down
14 changes: 7 additions & 7 deletions lambda/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lambda/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"esmock": "^2.6.0",
"mocha": "^10.2.0",
"nock": "^13.4.0",
"prettier": "^3.0.3",
"prettier": "^3.1.0",
"sinon": "^17.0.1"
},
"engines": {
Expand Down

0 comments on commit 9be6058

Please sign in to comment.