diff --git a/matter-bridge/config.yml b/matter-bridge/config.yml index 87de988..ec4faba 100644 --- a/matter-bridge/config.yml +++ b/matter-bridge/config.yml @@ -1,6 +1,6 @@ --- name: 'HA Matter Bridge' -version: '0.0.2-alpha' +version: '0.0.3-alpha' slug: ha-matter-bridge description: This project serves as a proof of concept to connect HomeAssistant devices to Voice Assistants through the Matter Protocol. init: false diff --git a/matter-bridge/src/mapper/devices/lights/DimmableLightDevice.ts b/matter-bridge/src/mapper/devices/lights/DimmableLightDevice.ts index 1412828..45e1214 100644 --- a/matter-bridge/src/mapper/devices/lights/DimmableLightDevice.ts +++ b/matter-bridge/src/mapper/devices/lights/DimmableLightDevice.ts @@ -56,10 +56,14 @@ export const addDimmableLightDevice: AddHaDeviceToBridge = ( LOGGER.debug( `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( 'light', Number(value) > 0 ? 'turn_on' : 'turn_off', - { entity_id: haEntity.entity_id, brightness: Number(value) } + extraArgs ); });