mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
⚡ Add Event resource to Home Assistant
This commit is contained in:
parent
231c15801a
commit
1faaef1171
|
@ -15,16 +15,16 @@ export const eventOperations = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
options: [
|
options: [
|
||||||
|
{
|
||||||
|
name: 'Create',
|
||||||
|
value: 'create',
|
||||||
|
description: 'Create an event',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'Get All',
|
name: 'Get All',
|
||||||
value: 'getAll',
|
value: 'getAll',
|
||||||
description: 'Get all events',
|
description: 'Get all events',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'Post',
|
|
||||||
value: 'post',
|
|
||||||
description: 'Post an event',
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
default: 'getAll',
|
default: 'getAll',
|
||||||
description: 'The operation to perform.',
|
description: 'The operation to perform.',
|
||||||
|
@ -79,7 +79,7 @@ export const eventFields = [
|
||||||
},
|
},
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* event:post */
|
/* event:create */
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
displayName: 'Event Type',
|
displayName: 'Event Type',
|
||||||
|
@ -88,7 +88,7 @@ export const eventFields = [
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
operation: [
|
operation: [
|
||||||
'post',
|
'create',
|
||||||
],
|
],
|
||||||
resource: [
|
resource: [
|
||||||
'event',
|
'event',
|
||||||
|
@ -114,7 +114,7 @@ export const eventFields = [
|
||||||
'event',
|
'event',
|
||||||
],
|
],
|
||||||
operation: [
|
operation: [
|
||||||
'post',
|
'create',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -87,10 +87,10 @@ export class HomeAssistant implements INodeType {
|
||||||
name: 'Config',
|
name: 'Config',
|
||||||
value: 'config',
|
value: 'config',
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// name: 'Event',
|
name: 'Event',
|
||||||
// value: 'event',
|
value: 'event',
|
||||||
// },
|
},
|
||||||
// {
|
// {
|
||||||
// name: 'History',
|
// name: 'History',
|
||||||
// value: 'history',
|
// value: 'history',
|
||||||
|
@ -226,7 +226,7 @@ export class HomeAssistant implements INodeType {
|
||||||
const limit = this.getNodeParameter('limit', i) as number;
|
const limit = this.getNodeParameter('limit', i) as number;
|
||||||
responseData = responseData.slice(0, limit);
|
responseData = responseData.slice(0, limit);
|
||||||
}
|
}
|
||||||
} else if (operation === 'post') {
|
} else if (operation === 'create') {
|
||||||
const eventType = this.getNodeParameter('eventType', i) as string;
|
const eventType = this.getNodeParameter('eventType', i) as string;
|
||||||
const eventAttributes = this.getNodeParameter('eventAttributes', i) as {
|
const eventAttributes = this.getNodeParameter('eventAttributes', i) as {
|
||||||
attributes: IDataObject[],
|
attributes: IDataObject[],
|
||||||
|
|
Loading…
Reference in a new issue