Skip to content

Commit

Permalink
fix: Ignore GreenPower endpoint in definition generator (#7291)
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk authored Mar 31, 2024
1 parent 2bb5f30 commit 05911ba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/generateDefinition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,11 @@ export async function generateDefinition(device: Zh.Device): Promise<{externalDe
// It is possible to better check if device should be considered multiEndpoint
// based, for example, on generator arguments(i.e. presence of "endpointNames"),
// but this will be enough for now.
const multiEndpoint = device.endpoints.length > 1;
const endpointsWithoutGreenPower = device.endpoints.filter((e) => e.ID !== 242);
const multiEndpoint = endpointsWithoutGreenPower.length > 1;
if (multiEndpoint) {
const endpoints: {[n: string]: number} = {};
for (const endpoint of device.endpoints) {
for (const endpoint of endpointsWithoutGreenPower) {
endpoints[endpoint.ID.toString()] = endpoint.ID;
}
// Add to beginning for better visibility.
Expand Down

0 comments on commit 05911ba

Please sign in to comment.