mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 14:44:05 -08:00
70ae90fa3c
* ⚡ Update `lintfix` script * 👕 Remove unneeded lint exceptions * 👕 Run baseline `lintfix` * 👕 Apply `node-param-description-miscased-url` (#3441) * 👕 Apply `rule node-param-placeholder-miscased-id` (#3443) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply `node-param-option-name-wrong-for-upsert` (#3446) * 👕 Apply `node-param-min-value-wrong-for-limit` (#3442) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * Apply `node-param-display-name-wrong-for-dynamic-options` (#3454) * 🔨 fix * ⚡ Fix `Assigned To` fields Co-authored-by: Michael Kret <michael.k@radency.com> * 👕 Apply `rule node-param-default-wrong-for-number` (#3453) * 👕 Apply `node-param-default-wrong-for-string` (#3452) Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * Apply `node-param-display-name-miscased` (#3449) * 🔨 fix * 🔨 exceptions * ⚡ review fixes * 👕 Apply `node-param-description-lowercase-first-char` (#3451) * ⚡ fix * ⚡ review fixes * ⚡ fix Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Apply `node-param-description-wrong-for-dynamic-options` (#3456) * Rule working as intended * Add rule * 🔥 Remove repetitions * 👕 Add exceptions Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * 👕 Small fix for `node-param-description-wrong-for-dynamic-options` * 👕 Apply `node-param-default-wrong-for-fixed-collection` (#3460) * 👕 Apply `node-param-description-line-break-html-tag` (#3462) * 👕 Run baseline `lintfix` * 👕 Apply `node-param-options-type-unsorted-items` (#3459) * ⚡ fix * 🔨 exceptions * Add exception for Salesmate and Zoom Co-authored-by: Michael Kret <michael.k@radency.com> Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * ⚡ Restore `lintfix` command Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: Michael Kret <88898367+michael-radency@users.noreply.github.com> Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com> Co-authored-by: Michael Kret <michael.k@radency.com> Co-authored-by: brianinoa <54530642+brianinoa@users.noreply.github.com>
345 lines
7.6 KiB
TypeScript
345 lines
7.6 KiB
TypeScript
import {
|
||
INodeProperties,
|
||
} from 'n8n-workflow';
|
||
|
||
export const lightOperations: INodeProperties[] = [
|
||
{
|
||
displayName: 'Operation',
|
||
name: 'operation',
|
||
type: 'options',
|
||
noDataExpression: true,
|
||
displayOptions: {
|
||
show: {
|
||
resource: [
|
||
'light',
|
||
],
|
||
},
|
||
},
|
||
options: [
|
||
{
|
||
name: 'Delete',
|
||
value: 'delete',
|
||
description: 'Delete a light',
|
||
},
|
||
{
|
||
name: 'Get',
|
||
value: 'get',
|
||
description: 'Retrieve a light',
|
||
},
|
||
{
|
||
name: 'Get All',
|
||
value: 'getAll',
|
||
description: 'Retrieve all lights',
|
||
},
|
||
{
|
||
name: 'Update',
|
||
value: 'update',
|
||
description: 'Update a light',
|
||
},
|
||
],
|
||
default: 'update',
|
||
},
|
||
];
|
||
|
||
export const lightFields: INodeProperties[] = [
|
||
|
||
/* -------------------------------------------------------------------------- */
|
||
/* light:delete */
|
||
/* -------------------------------------------------------------------------- */
|
||
{
|
||
displayName: 'Light ID',
|
||
name: 'lightId',
|
||
type: 'string',
|
||
required: true,
|
||
displayOptions: {
|
||
show: {
|
||
operation: [
|
||
'delete',
|
||
],
|
||
resource: [
|
||
'light',
|
||
],
|
||
},
|
||
},
|
||
default: '',
|
||
},
|
||
|
||
/* -------------------------------------------------------------------------- */
|
||
/* light:getAll */
|
||
/* -------------------------------------------------------------------------- */
|
||
{
|
||
displayName: 'Return All',
|
||
name: 'returnAll',
|
||
type: 'boolean',
|
||
displayOptions: {
|
||
show: {
|
||
operation: [
|
||
'getAll',
|
||
],
|
||
resource: [
|
||
'light',
|
||
],
|
||
},
|
||
},
|
||
default: false,
|
||
description: 'Whether to return all results or only up to a given limit',
|
||
},
|
||
{
|
||
displayName: 'Limit',
|
||
name: 'limit',
|
||
type: 'number',
|
||
displayOptions: {
|
||
show: {
|
||
operation: [
|
||
'getAll',
|
||
],
|
||
resource: [
|
||
'light',
|
||
],
|
||
returnAll: [
|
||
false,
|
||
],
|
||
},
|
||
},
|
||
typeOptions: {
|
||
minValue: 1,
|
||
maxValue: 500,
|
||
},
|
||
default: 100,
|
||
description: 'Max number of results to return',
|
||
},
|
||
|
||
/* -------------------------------------------------------------------------- */
|
||
/* light:get */
|
||
/* -------------------------------------------------------------------------- */
|
||
{
|
||
displayName: 'Light ID',
|
||
name: 'lightId',
|
||
type: 'string',
|
||
required: true,
|
||
displayOptions: {
|
||
show: {
|
||
operation: [
|
||
'get',
|
||
],
|
||
resource: [
|
||
'light',
|
||
],
|
||
},
|
||
},
|
||
default: '',
|
||
},
|
||
|
||
/* -------------------------------------------------------------------------- */
|
||
/* light:update */
|
||
/* -------------------------------------------------------------------------- */
|
||
{
|
||
displayName: 'Light Name or ID',
|
||
name: 'lightId',
|
||
type: 'options',
|
||
typeOptions: {
|
||
loadOptionsMethod: 'getLights',
|
||
},
|
||
required: true,
|
||
displayOptions: {
|
||
show: {
|
||
operation: [
|
||
'update',
|
||
],
|
||
resource: [
|
||
'light',
|
||
],
|
||
},
|
||
},
|
||
default: '',
|
||
},
|
||
{
|
||
displayName: 'On',
|
||
name: 'on',
|
||
type: 'boolean',
|
||
required: true,
|
||
displayOptions: {
|
||
show: {
|
||
operation: [
|
||
'update',
|
||
],
|
||
resource: [
|
||
'light',
|
||
],
|
||
},
|
||
},
|
||
default: true,
|
||
description: 'On/Off state of the light',
|
||
},
|
||
{
|
||
displayName: 'Additional Fields',
|
||
name: 'additionalFields',
|
||
type: 'collection',
|
||
placeholder: 'Add Field',
|
||
displayOptions: {
|
||
show: {
|
||
resource: [
|
||
'light',
|
||
],
|
||
operation: [
|
||
'update',
|
||
],
|
||
},
|
||
},
|
||
default: {},
|
||
options: [
|
||
{
|
||
displayName: 'Alert Effect',
|
||
name: 'alert',
|
||
type: 'options',
|
||
options: [
|
||
{
|
||
name: 'None',
|
||
value: 'none',
|
||
description: 'The light is not performing an alert effect',
|
||
},
|
||
{
|
||
name: 'Select',
|
||
value: 'select',
|
||
description: 'The light is performing one breathe cycle',
|
||
},
|
||
{
|
||
name: 'LSelect',
|
||
value: 'lselect',
|
||
description: 'The light is performing breathe cycles for 15 seconds or until an "alert": "none" command is received',
|
||
},
|
||
],
|
||
default: '',
|
||
description: 'The alert effect, is a temporary change to the bulb’s state',
|
||
},
|
||
{
|
||
displayName: 'Brightness',
|
||
name: 'bri',
|
||
type: 'number',
|
||
typeOptions: {
|
||
minValue: 1,
|
||
maxValue: 254,
|
||
},
|
||
default: 100,
|
||
description: 'The brightness value to set the light to. Brightness is a scale from 1 (the minimum the light is capable of) to 254 (the maximum).',
|
||
},
|
||
{
|
||
displayName: 'Brightness Increments',
|
||
name: 'bri_inc',
|
||
type: 'number',
|
||
typeOptions: {
|
||
minValue: -254,
|
||
maxValue: 254,
|
||
},
|
||
default: 0,
|
||
description: 'Increments or decrements the value of the brightness. This value is ignored if the Brightness attribute is provided.',
|
||
},
|
||
{
|
||
displayName: 'Color Temperature',
|
||
name: 'ct',
|
||
type: 'number',
|
||
default: 0,
|
||
description: 'The Mired color temperature of the light. 2012 connected lights are capable of 153 (6500K) to 500 (2000K).',
|
||
},
|
||
{
|
||
displayName: 'Color Temperature Increments',
|
||
name: 'ct_inc',
|
||
type: 'number',
|
||
typeOptions: {
|
||
minValue: -65534,
|
||
maxValue: 65534,
|
||
},
|
||
default: 0,
|
||
description: 'Increments or decrements the value of the ct. ct_inc is ignored if the ct attribute is provided.',
|
||
},
|
||
{
|
||
displayName: 'Coordinates',
|
||
name: 'xy',
|
||
type: 'string',
|
||
default: '',
|
||
placeholder: '0.64394,0.33069',
|
||
description: 'The x and y coordinates of a color in CIE color space. The first entry is the x coordinate and the second entry is the y coordinate. Both x and y are between 0 and 1',
|
||
},
|
||
{
|
||
displayName: 'Coordinates Increments',
|
||
name: 'xy_inc',
|
||
type: 'string',
|
||
default: '',
|
||
placeholder: '0.5,0.5',
|
||
description: 'Increments or decrements the value of the xy. This value is ignored if the Coordinates attribute is provided. Any ongoing color transition is stopped. Max value [0.5, 0.5]',
|
||
},
|
||
{
|
||
displayName: 'Dynamic Effect',
|
||
name: 'effect',
|
||
type: 'options',
|
||
options: [
|
||
{
|
||
name: 'None',
|
||
value: 'none',
|
||
},
|
||
{
|
||
name: 'Color Loop',
|
||
value: 'colorloop',
|
||
},
|
||
],
|
||
default: '',
|
||
description: 'The dynamic effect of the light',
|
||
},
|
||
{
|
||
displayName: 'Hue',
|
||
name: 'hue',
|
||
type: 'number',
|
||
typeOptions: {
|
||
minValue: 0,
|
||
maxValue: 65535,
|
||
},
|
||
default: 0,
|
||
description: 'The hue value to set light to.The hue value is a wrapping value between 0 and 65535. Both 0 and 65535 are red, 25500 is green and 46920 is blue.',
|
||
},
|
||
{
|
||
displayName: 'Hue Increments',
|
||
name: 'hue_inc',
|
||
type: 'number',
|
||
typeOptions: {
|
||
minValue: -65534,
|
||
maxValue: 65534,
|
||
},
|
||
default: 0,
|
||
description: 'Increments or decrements the value of the hue. Hue Increments is ignored if the Hue attribute is provided.',
|
||
},
|
||
{
|
||
displayName: 'Saturation',
|
||
name: 'sat',
|
||
type: 'number',
|
||
typeOptions: {
|
||
minValue: 0,
|
||
maxValue: 254,
|
||
},
|
||
default: 0,
|
||
description: 'Saturation of the light. 254 is the most saturated (colored) and 0 is the least saturated (white).',
|
||
},
|
||
{
|
||
displayName: 'Saturation Increments',
|
||
name: 'sat_inc',
|
||
type: 'number',
|
||
typeOptions: {
|
||
minValue: -254,
|
||
maxValue: 254,
|
||
},
|
||
default: 0,
|
||
description: 'Increments or decrements the value of the sat. This value is ignored if the Saturation attribute is provided.',
|
||
},
|
||
{
|
||
displayName: 'Transition Time',
|
||
name: 'transitiontime',
|
||
type: 'number',
|
||
typeOptions: {
|
||
minVale: 1,
|
||
},
|
||
default: 4,
|
||
description: 'The duration in seconds of the transition from the light’s current state to the new state',
|
||
},
|
||
],
|
||
},
|
||
];
|