Skip to content

Commit d809a2b

Browse files
committed
fix siri command detection ordering - unlock before lock
1 parent 3e2b46f commit d809a2b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/siri.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ interface commandDetection {
162162
function: (bl: Bluelink) => Promise<string>
163163
}
164164

165+
// Note order matters in this list, as we check a sentence for presence of words
166+
// and certain words contain sub-words. Hence "unlock" needs to be before "lock" etc
165167
const commandMap: commandDetection[] = [
166168
{
167169
words: ['status', 'remote'],
@@ -183,14 +185,14 @@ const commandMap: commandDetection[] = [
183185
words: ['climate', 'off'],
184186
function: climateOff,
185187
},
186-
{
187-
words: ['lock'],
188-
function: lock,
189-
},
190188
{
191189
words: ['unlock'],
192190
function: unlock,
193191
},
192+
{
193+
words: ['lock'],
194+
function: lock,
195+
},
194196
{
195197
words: ['start', 'charging'],
196198
function: startCharge,

0 commit comments

Comments
 (0)