Skip to content

Commit

Permalink
Rearrange the conditions to ensure that we have a device
Browse files Browse the repository at this point in the history
  • Loading branch information
rccoleman authored Jan 26, 2025
1 parent 6be9122 commit a47914c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/extension/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,11 @@ export default class Groups extends Extension {
if (this.state.exists(device)) {
const state = this.state.get(device);
const endpointNames = device.isDevice() && device.getEndpointNames();
const stateKey = device.definition.meta &&
const stateKey = endpointNames && endpointNames.length >= member.ID &&
device.definition.meta &&

Check failure on line 171 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 18)

'device.definition' is possibly 'undefined'.

Check failure on line 171 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 20)

'device.definition' is possibly 'undefined'.

Check failure on line 171 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 22)

'device.definition' is possibly 'undefined'.

Check failure on line 171 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 20)

'device.definition' is possibly 'undefined'.

Check failure on line 171 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / ci

'device.definition' is possibly 'undefined'.

Check failure on line 171 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 22)

'device.definition' is possibly 'undefined'.

Check failure on line 171 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 18)

'device.definition' is possibly 'undefined'.

Check failure on line 171 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 18)

'device.definition' is possibly 'undefined'.

Check failure on line 171 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 20)

'device.definition' is possibly 'undefined'.

Check failure on line 171 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 22)

'device.definition' is possibly 'undefined'.
device.definition.meta.multiEndpoint &&

Check failure on line 172 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 18)

'device.definition' is possibly 'undefined'.

Check failure on line 172 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 20)

'device.definition' is possibly 'undefined'.

Check failure on line 172 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 22)

'device.definition' is possibly 'undefined'.

Check failure on line 172 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 20)

'device.definition' is possibly 'undefined'.

Check failure on line 172 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / ci

'device.definition' is possibly 'undefined'.

Check failure on line 172 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 22)

'device.definition' is possibly 'undefined'.

Check failure on line 172 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 18)

'device.definition' is possibly 'undefined'.

Check failure on line 172 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 18)

'device.definition' is possibly 'undefined'.

Check failure on line 172 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 20)

'device.definition' is possibly 'undefined'.

Check failure on line 172 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 22)

'device.definition' is possibly 'undefined'.
(!device.definition.meta.multiEndpointSkip || !device.definition.meta.multiEndpointSkip.includes('state')) &&
endpointNames && endpointNames.length >= member.ID ? `state_${endpointNames[member.ID - 1]}` : 'state';
(!device.definition.meta.multiEndpointSkip || !device.definition.meta.multiEndpointSkip.includes('state')) ?

Check failure on line 173 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 18)

'device.definition' is possibly 'undefined'.

Check failure on line 173 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 18)

'device.definition' is possibly 'undefined'.

Check failure on line 173 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 20)

'device.definition' is possibly 'undefined'.

Check failure on line 173 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 20)

'device.definition' is possibly 'undefined'.

Check failure on line 173 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 22)

'device.definition' is possibly 'undefined'.

Check failure on line 173 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 22)

'device.definition' is possibly 'undefined'.

Check failure on line 173 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 20)

'device.definition' is possibly 'undefined'.

Check failure on line 173 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 20)

'device.definition' is possibly 'undefined'.

Check failure on line 173 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / ci

'device.definition' is possibly 'undefined'.

Check failure on line 173 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / ci

'device.definition' is possibly 'undefined'.

Check failure on line 173 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 22)

'device.definition' is possibly 'undefined'.

Check failure on line 173 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 22)

'device.definition' is possibly 'undefined'.

Check failure on line 173 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 18)

'device.definition' is possibly 'undefined'.

Check failure on line 173 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 18)

'device.definition' is possibly 'undefined'.

Check failure on line 173 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 18)

'device.definition' is possibly 'undefined'.

Check failure on line 173 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 18)

'device.definition' is possibly 'undefined'.

Check failure on line 173 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 20)

'device.definition' is possibly 'undefined'.

Check failure on line 173 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 20)

'device.definition' is possibly 'undefined'.

Check failure on line 173 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 22)

'device.definition' is possibly 'undefined'.

Check failure on line 173 in lib/extension/groups.ts

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 22)

'device.definition' is possibly 'undefined'.
`state_${endpointNames[member.ID - 1]}` : 'state';

if (state[stateKey] === 'ON' || state[stateKey] === 'OPEN') {
return false;
Expand Down

0 comments on commit a47914c

Please sign in to comment.