Skip to content

Commit

Permalink
Merge pull request #51 from phillipivan/master
Browse files Browse the repository at this point in the history
v2.5.2
  • Loading branch information
phillipivan authored Dec 18, 2024
2 parents 3024ff5 + fa0f0fb commit 958d638
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 146 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "generic-emberplus",
"version": "2.5.1",
"version": "2.5.2",
"main": "dist/index.js",
"scripts": {
"prepare": "husky",
Expand All @@ -27,7 +27,7 @@
]
},
"engines": {
"node": "^22.11"
"node": "^22.12"
},
"dependencies": {
"@companion-module/base": "~1.11.2",
Expand All @@ -36,15 +36,15 @@
"p-queue": "^8.0.1"
},
"devDependencies": {
"@companion-module/tools": "^2.1.0",
"@types/node": "^22.10.1",
"eslint": "^9.16.0",
"@companion-module/tools": "^2.1.1",
"@types/node": "^22.10.2",
"eslint": "^9.17.0",
"husky": "^9.1.7",
"lint-staged": "^15.2.10",
"prettier": "^3.4.1",
"lint-staged": "^15.2.11",
"prettier": "^3.4.2",
"rimraf": "^6.0.1",
"typescript": "~5.7.2",
"typescript-eslint": "^8.17.0"
"typescript-eslint": "^8.18.1"
},
"prettier": "@companion-module/tools/.prettierrc.json",
"packageManager": "[email protected]"
Expand Down
18 changes: 9 additions & 9 deletions src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const setValue =
if (action.options.variable) {
await self.registerNewParameter(path)
}
queue
await queue
.add(async () => {
const node = await emberClient.getElementByPath(path)
// TODO - do we handle not found?
Expand Down Expand Up @@ -193,7 +193,7 @@ const doMatrixAction =
async (action: CompanionActionEvent): Promise<void> => {
const path = await resolvePath(self, action.options['path']?.toString() ?? '')
self.log('debug', 'Get node ' + path)
queue
await queue
.add(async () => {
const node = await emberClient.getElementByPath(path)
// TODO - do we handle not found?
Expand Down Expand Up @@ -222,15 +222,15 @@ const doMatrixAction =
* @param state reference to the state of the module
* @param queue reference to the PQueue of the module
*/
const doMatrixActionFunction = function (
const doMatrixActionFunction = async function (
self: InstanceBase<EmberPlusConfig>,
emberClient: EmberClient,
config: EmberPlusConfig,
state: EmberPlusState,
queue: PQueue,
) {
): Promise<void> {
self.log('debug', 'Get node ' + state.selected.matrix)
queue
await queue
.add(async () => {
if (
state.selected.source !== -1 &&
Expand Down Expand Up @@ -288,7 +288,7 @@ const doTake =
state: EmberPlusState,
queue: PQueue,
) =>
(action: CompanionActionEvent): void => {
async (action: CompanionActionEvent): Promise<void> => {
if (
state.selected.target !== -1 &&
state.selected.source !== -1 &&
Expand All @@ -304,7 +304,7 @@ const doTake =
' on matrix ' +
Number(action.options['matrix']),
)
doMatrixActionFunction(self, emberClient, config, state, queue)
await doMatrixActionFunction(self, emberClient, config, state, queue)
} else {
self.log('debug', 'TAKE went wrong.')
}
Expand Down Expand Up @@ -341,11 +341,11 @@ const setSelectedSource =
state: EmberPlusState,
queue: PQueue,
) =>
(action: CompanionActionEvent): void => {
async (action: CompanionActionEvent): Promise<void> => {
if (action.options['source'] != -1 && Number(action.options['matrix']) == state.selected.matrix) {
state.selected.source = Number(action.options['source'])
self.log('debug', 'Take is: ' + config.take)
if (config.take) doMatrixActionFunction(self, emberClient, config, state, queue)
if (config.take) await doMatrixActionFunction(self, emberClient, config, state, queue)
self.checkFeedbacks(FeedbackId.SourceBackgroundSelected, FeedbackId.Clear, FeedbackId.Take)
self.log('debug', 'setSelectedSource: ' + action.options['source'] + ' on Matrix: ' + state.selected.matrix)
}
Expand Down
Loading

0 comments on commit 958d638

Please sign in to comment.