fix for dimmable ligth
This commit is contained in:
parent
fa3cd39674
commit
031d729af0
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: 'HA Matter Bridge'
|
name: 'HA Matter Bridge'
|
||||||
version: '0.0.2-alpha'
|
version: '0.0.3-alpha'
|
||||||
slug: ha-matter-bridge
|
slug: ha-matter-bridge
|
||||||
description: This project serves as a proof of concept to connect HomeAssistant devices to Voice Assistants through the Matter Protocol.
|
description: This project serves as a proof of concept to connect HomeAssistant devices to Voice Assistants through the Matter Protocol.
|
||||||
init: false
|
init: false
|
||||||
|
@ -56,10 +56,14 @@ export const addDimmableLightDevice: AddHaDeviceToBridge = (
|
|||||||
LOGGER.debug(
|
LOGGER.debug(
|
||||||
`CurrentLevel Event for device ${haEntity.entity_id} value: ${value}`
|
`CurrentLevel Event for device ${haEntity.entity_id} value: ${value}`
|
||||||
);
|
);
|
||||||
|
let extraArgs = { entity_id: haEntity.entity_id } as object;
|
||||||
|
if (Number(value) > 0) {
|
||||||
|
extraArgs = { ...extraArgs, brightness: Number(value) };
|
||||||
|
}
|
||||||
haMiddleware.callAService(
|
haMiddleware.callAService(
|
||||||
'light',
|
'light',
|
||||||
Number(value) > 0 ? 'turn_on' : 'turn_off',
|
Number(value) > 0 ? 'turn_on' : 'turn_off',
|
||||||
{ entity_id: haEntity.entity_id, brightness: Number(value) }
|
extraArgs
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user