New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

iobroker.innogy-smarthome

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iobroker.innogy-smarthome - npm Package Compare versions

Comparing version 0.2.0 to 0.2.2

2

io-package.json
{
"common": {
"name": "innogy-smarthome",
"version": "0.2.0",
"version": "0.2.2",
"title": "Innogy Smarthome Adapter",

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -1,37 +0,45 @@

var controllerDir;
var appName;
'use strict';
function getAppName() {
var parts = __dirname.replace(/\\/g, '/').split('/');
const fs = require('fs');
const path = require('path');
let controllerDir;
let appName;
/**
* returns application name
*
* The name of the application can be different and this function finds it out.
*
* @returns {string}
*/
function getAppName() {
const parts = __dirname.replace(/\\/g, '/').split('/');
return parts[parts.length - 2].split('.')[0];
}
// Get js-controller directory to load libs
/**
* looks for js-controller home folder
*
* @param {boolean} isInstall
* @returns {string}
*/
function getControllerDir(isInstall) {
var fs = require('fs');
// Find the js-controller location
var controllerDir = __dirname.replace(/\\/g, '/');
controllerDir = controllerDir.split('/');
if (controllerDir[controllerDir.length - 3] === 'adapter') {
controllerDir.splice(controllerDir.length - 3, 3);
controllerDir = controllerDir.join('/');
} else if (controllerDir[controllerDir.length - 3] === 'node_modules') {
controllerDir.splice(controllerDir.length - 3, 3);
controllerDir = controllerDir.join('/');
if (fs.existsSync(controllerDir + '/node_modules/' + appName + '.js-controller')) {
controllerDir += '/node_modules/' + appName + '.js-controller';
} else if (fs.existsSync(controllerDir + '/node_modules/' + appName.toLowerCase() + '.js-controller')) {
controllerDir += '/node_modules/' + appName.toLowerCase() + '.js-controller';
} else if (!fs.existsSync(controllerDir + '/controller.js')) {
if (!isInstall) {
console.log('Cannot find js-controller');
process.exit(10);
} else {
process.exit();
const possibilities = [
'iobroker.js-controller',
'ioBroker.js-controller',
];
/** @type {string} */
let controllerPath;
for (const pkg of possibilities) {
try {
const possiblePath = require.resolve(pkg);
if (fs.existsSync(possiblePath)) {
controllerPath = possiblePath;
break;
}
}
} else if (fs.existsSync(__dirname + '/../../node_modules/' + appName.toLowerCase() + '.js-controller')) {
controllerDir.splice(controllerDir.length - 2, 2);
return controllerDir.join('/') + '/node_modules/' + appName.toLowerCase() + '.js-controller';
} else {
} catch (e) { /* not found */ }
}
if (controllerPath == null) {
if (!isInstall) {

@@ -44,12 +52,22 @@ console.log('Cannot find js-controller');

}
return controllerDir;
// we found the controller
return path.dirname(controllerPath);
}
// Read controller configuration file
function getConfig() {
var fs = require('fs');
if (fs.existsSync(controllerDir + '/conf/' + appName + '.json')) {
return JSON.parse(fs.readFileSync(controllerDir + '/conf/' + appName + '.json'));
} else if (fs.existsSync(controllerDir + '/conf/' + appName.toLowerCase() + '.json')) {
return JSON.parse(fs.readFileSync(controllerDir + '/conf/' + appName.toLowerCase() + '.json'));
/**
* reads controller base settings
*
* @alias getConfig
* @returns {object}
*/
function getConfig() {
let configPath;
if (fs.existsSync(
configPath = path.join(controllerDir, 'conf', appName + '.json')
)) {
return JSON.parse(fs.readFileSync(configPath, 'utf8'));
} else if (fs.existsSync(
configPath = path.join(controllerDir, 'conf', + appName.toLowerCase() + '.json')
)) {
return JSON.parse(fs.readFileSync(configPath, 'utf8'));
} else {

@@ -59,9 +77,9 @@ throw new Error('Cannot find ' + controllerDir + '/conf/' + appName + '.json');

}
appName = getAppName();
appName = getAppName();
controllerDir = getControllerDir(typeof process !== 'undefined' && process.argv && process.argv.indexOf('--install') !== -1);
const adapter = require(path.join(controllerDir, 'lib/adapter.js'));
exports.controllerDir = controllerDir;
exports.getConfig = getConfig;
exports.Adapter = require(controllerDir + '/lib/adapter.js');
exports.appName = appName;
exports.getConfig = getConfig;
exports.Adapter = adapter;
exports.appName = appName;

@@ -451,2 +451,22 @@ /* jshint -W097 */// jshint strict:false

break;
case "/types/device/FSC8.RWE/1.1/ValveType":
res.type = "string";
res.role = "indicator.valvetype";
res.read = true;
res.write = true;
res.states = {
"NormalClose": "Normal Close",
"NormalOpen": "Normal Open"
};
break;
case "/types/device/FSC8.RWE/1.1/ControlMode":
res.type = "string";
res.role = "indicator.controlmode";
res.read = true;
res.write = true;
res.states = {
"Heating": "Heating",
"Cooling": "Cooling"
};
break;
default:

@@ -453,0 +473,0 @@ res.type = "string";

{
"name": "iobroker.innogy-smarthome",
"version": "0.2.0",
"version": "0.2.2",
"description": "ioBroker Innogy SmartHome Adapter",

@@ -28,3 +28,3 @@ "author": {

"dependencies": {
"innogy-smarthome-lib": "^0.3.0"
"innogy-smarthome-lib": "^0.3.1"
},

@@ -31,0 +31,0 @@ "devDependencies": {

@@ -12,2 +12,11 @@ ![Logo](admin/innogy-smarthome.png)

### 0.2.2
Fixed reauth problems
Fixed initial auth problems
Optimized API errors
Optimized caching of descriptor files
### 0.2.1
Fixed reauth problems
### 0.2.0

@@ -14,0 +23,0 @@ Removed external OAuth2 lib

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc