Rename service_data to data to maintain HA compatibility.

This commit is contained in:
Dermot Duffy
2023-10-08 21:17:57 -07:00
parent 972029fac6
commit 9a2eb24d35
46 changed files with 929 additions and 380 deletions
+3 -3
View File
@@ -6,7 +6,7 @@ import {
NoActionConfig,
ToggleActionConfig,
UrlActionConfig,
} from 'custom-card-helpers';
} from '@dermotduffy/custom-card-helpers';
import { z } from 'zod';
import { MEDIA_CHUNK_SIZE_DEFAULT, MEDIA_CHUNK_SIZE_MAX } from '../const.js';
import { deepRemoveDefaults } from '../utils/zod.js';
@@ -133,7 +133,7 @@ const callServiceActionSchema = schemaForType<
actionBaseSchema.extend({
action: z.literal('call-service'),
service: z.string(),
service_data: z.object({}).passthrough().optional(),
data: z.object({}).passthrough().optional(),
}),
);
@@ -498,7 +498,7 @@ export const frigateCardPTZSchema = z.preprocess(
tap_action: {
action: 'call-service',
service: data['service'],
service_data: data[`data_${name}`],
data: data[`data_${name}`],
},
};
delete out[`data_${name}`];