Refactor by ESLint rules

This commit is contained in:
Evgenii Abramov
2021-03-03 23:59:13 +03:00
parent b0d579838e
commit bf34ad8080

View File

@@ -3,13 +3,13 @@ module.exports = {
host: 'localhost', host: 'localhost',
port: 1883, port: 1883,
user: 'user', user: 'user',
password: 'password' password: 'password',
}, },
https: { https: {
privateKey: '/etc/letsencrypt/live/your.domain.ru/privkey.pem', privateKey: '/etc/letsencrypt/live/your.domain.ru/privkey.pem',
certificate: '/etc/letsencrypt/live/your.domain.ru/fullchain.pem', certificate: '/etc/letsencrypt/live/your.domain.ru/fullchain.pem',
port: 4433 port: 4433,
}, },
clients: [ clients: [
@@ -18,140 +18,140 @@ module.exports = {
name: 'Yandex', name: 'Yandex',
clientId: 'client', clientId: 'client',
clientSecret: 'secret', clientSecret: 'secret',
isTrusted: false isTrusted: false,
}, },
], ],
users: [ users: [
{ {
id: "1", id: '1',
username: "admin", username: 'admin',
password: "admin", password: 'admin',
name: "Administrator" name: 'Administrator',
}, },
{ {
id: "2", id: '2',
username: "user1", username: 'user1',
password: "user1", password: 'user1',
name: "User" name: 'User',
}, },
], ],
devices: [ devices: [
{ {
id: "haw-002-switch", id: 'haw-002-switch',
name: "Свет в коридоре", name: 'Свет в коридоре',
room: "Коридор", room: 'Коридор',
type: "devices.types.light", type: 'devices.types.light',
mqtt: [ mqtt: [
{ {
instance: "on", instance: 'on',
set: "/yandex/controls/light_HaW_002/state/on", set: '/yandex/controls/light_HaW_002/state/on',
state: "/yandex/controls/light_HaW_002/state" state: '/yandex/controls/light_HaW_002/state',
}, },
], ],
capabilities: [ capabilities: [
{ {
type: "devices.capabilities.on_off", type: 'devices.capabilities.on_off',
retrievable: true, retrievable: true,
}, },
], ],
}, },
{ {
id: "lvr-003-switch", id: 'lvr-003-switch',
name: "Основной свет", name: 'Основной свет',
room: "Гостиная", room: 'Гостиная',
type: "devices.types.light", type: 'devices.types.light',
mqtt: [ mqtt: [
{ {
instance: "on", instance: 'on',
set: "/yandex/controls/light_LvR_003/state/on", set: '/yandex/controls/light_LvR_003/state/on',
state: "/yandex/controls/light_LvR_003/state" state: '/yandex/controls/light_LvR_003/state',
}, },
], ],
valueMapping: [ valueMapping: [
{ {
type: "on_off", type: 'on_off',
mapping: [[false, true], [0, 1]] // [yandex, mqtt] mapping: [[false, true], [0, 1]], // [yandex, mqtt]
} },
], ],
capabilities: [ capabilities: [
{ {
type: "devices.capabilities.on_off", type: 'devices.capabilities.on_off',
retrievable: true, retrievable: true,
}, },
], ],
}, },
{ {
id: "lvr-001-weather", id: 'lvr-001-weather',
name: "В гостиной", name: 'В гостиной',
room: "Гостиная", room: 'Гостиная',
type: "devices.types.sensor", type: 'devices.types.sensor',
mqtt: [ mqtt: [
{ {
instance: "temperature", instance: 'temperature',
state: "/yandex/sensors/LvR_001_Weather/temperature" state: '/yandex/sensors/LvR_001_Weather/temperature',
}, },
{ {
instance: "humidity", instance: 'humidity',
state: "/yandex/sensors/LvR_001_Weather/humidity" state: '/yandex/sensors/LvR_001_Weather/humidity',
} },
], ],
properties: [ properties: [
{ {
type: "devices.properties.float", type: 'devices.properties.float',
retrievable: true, retrievable: true,
parameters: { parameters: {
instance: "temperature", instance: 'temperature',
unit: "unit.temperature.celsius" unit: 'unit.temperature.celsius',
}, },
}, },
{ {
type: "devices.properties.float", type: 'devices.properties.float',
retrievable: true, retrievable: true,
parameters: { parameters: {
instance: "humidity", instance: 'humidity',
unit: "unit.percent" unit: 'unit.percent',
}, },
} },
] ],
}, },
{ {
id: "plug-001-flower", id: 'plug-001-flower',
name: "Розетка для цветка", name: 'Розетка для цветка',
room: "Гостиная", room: 'Гостиная',
type: "devices.types.socket", type: 'devices.types.socket',
mqtt: [ mqtt: [
{ {
instance: "on", instance: 'on',
set: "/yandex/controls/socket_LvR_002/state/on", set: '/yandex/controls/socket_LvR_002/state/on',
state: "/yandex/controls/socket_LvR_002/state/on" state: '/yandex/controls/socket_LvR_002/state/on',
}, },
{ {
instance: "power", instance: 'power',
state: "/yandex/controls/socket_LvR_002/power" state: '/yandex/controls/socket_LvR_002/power',
}, },
], ],
capabilities: [ capabilities: [
{ {
type: "devices.capabilities.on_off", type: 'devices.capabilities.on_off',
retrievable: true, retrievable: true,
}, },
], ],
properties: [ properties: [
{ {
type: "devices.properties.float", type: 'devices.properties.float',
retrievable: true, retrievable: true,
parameters: { parameters: {
instance: "power", instance: 'power',
unit: "unit.watt" unit: 'unit.watt',
}, },
}, },
] ],
} },
/* --- end */ /* --- end */
] ],
} };