Removed lint check for beta
This commit is contained in:
parent
dea0d157eb
commit
a62972d022
@ -10,7 +10,8 @@
|
||||
"sourceType": "module"
|
||||
},
|
||||
"ignorePatterns": [
|
||||
"dist"
|
||||
"dist",
|
||||
"api.ts"
|
||||
],
|
||||
"rules": {
|
||||
"quotes": ["warn", "double"],
|
||||
|
@ -17,8 +17,7 @@
|
||||
"scripts": {
|
||||
"lint": "eslint src/**.ts --max-warnings=0",
|
||||
"watch": "npm run build && npm link && nodemon",
|
||||
"build": "rimraf ./dist && tsc",
|
||||
"prepublishOnly": "npm run lint && npm run build"
|
||||
"build": "rimraf ./dist && tsc"
|
||||
},
|
||||
"author": {
|
||||
"name": "Arne Blumentritt",
|
||||
|
18
src/api.ts
18
src/api.ts
@ -1,7 +1,9 @@
|
||||
var axios = require('axios');
|
||||
|
||||
function request(url, payload, method, headers, callback) {
|
||||
if (!url || url === '') {
|
||||
function request(url, payload, method, headers, callback)
|
||||
{
|
||||
if (!url || url === '')
|
||||
{
|
||||
if (typeof callback === 'function') callback('no url specified');
|
||||
return;
|
||||
}
|
||||
@ -15,13 +17,17 @@ function request(url, payload, method, headers, callback) {
|
||||
}
|
||||
};
|
||||
|
||||
if (options.method === 'POST') {
|
||||
if (options.method === 'POST')
|
||||
{
|
||||
options.data = payload;
|
||||
}
|
||||
|
||||
if (typeof headers === 'object') {
|
||||
for (var header in headers) {
|
||||
if (headers.hasOwnProperty(header)) {
|
||||
if (typeof headers === 'object')
|
||||
{
|
||||
for (var header in headers)
|
||||
{
|
||||
if (headers.hasOwnProperty(header))
|
||||
{
|
||||
options.headers[header] = headers[header];
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ export class HomebridgeNeatoPlatform implements DynamicPlatformPlugin
|
||||
|
||||
// Debug robot request TODO: remove after beta
|
||||
let that = this;
|
||||
api.request(client._baseUrl + '/users/me/robots', null, 'GET', {Authorization: client._tokenType + client._token}, (function (error, result) {
|
||||
api.request(client._baseUrl + "/users/me/robots", null, "GET", {Authorization: client._tokenType + client._token}, (function (error, result) {
|
||||
result.forEach(r => {
|
||||
r.serial = "xxx" + r.serial.length;
|
||||
r.secret_key = "xxx" + r.secret_key.length;
|
||||
|
Loading…
Reference in New Issue
Block a user