Skip to content

Commit

Permalink
Only use endpoint-specific states if the device definition uses them
Browse files Browse the repository at this point in the history
Some devices don't use separate endpoint-specific states even if they support multiple endpoints
  • Loading branch information
rccoleman committed Jan 26, 2025
1 parent 420a9f2 commit 6be9122
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/extension/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@ 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 = endpointNames && endpointNames.length >= member.ID ? `state_${endpointNames[member.ID - 1]}` : 'state';
const stateKey = device.definition.meta &&

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / ci

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / ci

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.
device.definition.meta.multiEndpoint &&

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / ci

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / ci

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.
(!device.definition.meta.multiEndpointSkip || !device.definition.meta.multiEndpointSkip.includes('state')) &&

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / ci

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / ci

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / ci

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / ci

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (macos-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 20)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 22)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.

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

View workflow job for this annotation

GitHub Actions / tests (windows-latest, 18)

Property 'definition' does not exist on type 'Device | Group'.
endpointNames && endpointNames.length >= member.ID ? `state_${endpointNames[member.ID - 1]}` : 'state';

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

0 comments on commit 6be9122

Please sign in to comment.