Skip to content

Commit

Permalink
fix(call-service): Merge target data into service data before sending…
Browse files Browse the repository at this point in the history
… to HA

When a target property is a string the service handler validation in HA converts it to an array. Not all HA service accept entity ids as arrays.

Fixes #1248
Fixes #1245
  • Loading branch information
zachowj committed Jan 9, 2024
1 parent f86e2c6 commit 60f55f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/homeAssistant/Websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,8 @@ export default class Websocket {
type: 'call_service',
domain,
service,
service_data: data,
target,
// Merging target data with service data because the service call validation will change entity_id from a string to an array and not all services support that
service_data: { ...data, ...target },
return_response: returnResponse,
};

Expand Down

0 comments on commit 60f55f2

Please sign in to comment.