Add Event resource to Home Assistant

This commit is contained in:
Jan Oberhauser 2021-07-28 13:27:46 +02:00
parent 231c15801a
commit 1faaef1171
2 changed files with 13 additions and 13 deletions

View file

@ -15,16 +15,16 @@ export const eventOperations = [
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create an event',
},
{
name: 'Get All',
value: 'getAll',
description: 'Get all events',
},
{
name: 'Post',
value: 'post',
description: 'Post an event',
},
],
default: 'getAll',
description: 'The operation to perform.',
@ -79,7 +79,7 @@ export const eventFields = [
},
/* -------------------------------------------------------------------------- */
/* event:post */
/* event:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'Event Type',
@ -88,7 +88,7 @@ export const eventFields = [
displayOptions: {
show: {
operation: [
'post',
'create',
],
resource: [
'event',
@ -114,7 +114,7 @@ export const eventFields = [
'event',
],
operation: [
'post',
'create',
],
},
},

View file

@ -87,10 +87,10 @@ export class HomeAssistant implements INodeType {
name: 'Config',
value: 'config',
},
// {
// name: 'Event',
// value: 'event',
// },
{
name: 'Event',
value: 'event',
},
// {
// name: 'History',
// value: 'history',
@ -226,7 +226,7 @@ export class HomeAssistant implements INodeType {
const limit = this.getNodeParameter('limit', i) as number;
responseData = responseData.slice(0, limit);
}
} else if (operation === 'post') {
} else if (operation === 'create') {
const eventType = this.getNodeParameter('eventType', i) as string;
const eventAttributes = this.getNodeParameter('eventAttributes', i) as {
attributes: IDataObject[],