Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.m.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.m.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.modern.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.modern.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.umd.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface ToggleActionConfig extends BaseActionConfig {
export interface CallServiceActionConfig extends BaseActionConfig {
action: "call-service";
service: string;
service_data?: {
data?: {
entity_id?: string | [string];
[key: string]: any;
};
Expand Down Expand Up @@ -255,7 +255,7 @@ export interface EntitiesCardEntityConfig extends EntityConfig {
secondary_info?: "entity-id" | "last-changed" | "last-triggered" | "last-updated" | "position" | "tilt-position" | "brightness";
action_name?: string;
service?: string;
service_data?: Record<string, unknown>;
data?: Record<string, unknown>;
url?: string;
tap_action?: ActionConfig;
hold_action?: ActionConfig;
Expand Down
2 changes: 1 addition & 1 deletion src/handle-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const handleActionConfig = (
return;
}
const [domain, service] = actionConfig.service.split(".", 2);
hass.callService(domain, service, actionConfig.service_data, actionConfig.target);
hass.callService(domain, service, actionConfig.data, actionConfig.target);
forwardHaptic("success");
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/handle-click.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const handleClick = (
return;
}
const [domain, service] = actionConfig.service.split(".", 2);
const serviceData = { ...actionConfig.service_data };
const serviceData = { ...actionConfig.data };
if (serviceData.entity_id === "entity") {
serviceData.entity_id = config.entity;
}
Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface ToggleActionConfig extends BaseActionConfig {
export interface CallServiceActionConfig extends BaseActionConfig {
action: "call-service";
service: string;
service_data?: {
data?: {
entity_id?: string | [string];
[key: string]: any;
};
Expand Down Expand Up @@ -333,7 +333,7 @@ export interface EntitiesCardEntityConfig extends EntityConfig {
| "brightness";
action_name?: string;
service?: string;
service_data?: Record<string, unknown>;
data?: Record<string, unknown>;
url?: string;
tap_action?: ActionConfig;
hold_action?: ActionConfig;
Expand Down