daikin-controller-cloud
Advanced tools
Comparing version 2.3.0 to 2.4.0
@@ -73,6 +73,7 @@ import type { OnectaClient } from './onecta/oidc-client.js'; | ||
* @param {number|string} value Value to set | ||
* @param {boolean} [ignoreWritableCheck=false] Ignore the writable check | ||
* @returns {Promise<Object|boolean>} should return a true - or if a body is returned teh body object (can this happen?) | ||
*/ | ||
setData(managementPoint: any, dataPoint: any, dataPointPath: any, value: any): Promise<any>; | ||
setData(managementPoint: any, dataPoint: any, dataPointPath: any, value: any, ignoreWritableCheck?: boolean): Promise<any>; | ||
} | ||
export {}; |
@@ -167,10 +167,11 @@ "use strict"; | ||
* @param {any} value Value to be set | ||
* @param {boolean} [ignoreWritableCheck=false] Ignore the writable check | ||
* @throws Error | ||
* @private | ||
*/ | ||
#validateData(def, value) { | ||
#validateData(def, value, ignoreWritableCheck = false) { | ||
if (!def.hasOwnProperty('value') && !def.hasOwnProperty('settable')) { | ||
throw new Error('Value can not be set without dataPointPath'); | ||
} | ||
if (!def.hasOwnProperty('settable') || !def.settable) { | ||
if (!ignoreWritableCheck && (!def.hasOwnProperty('settable') || !def.settable)) { | ||
throw new Error('Value is not writable'); | ||
@@ -202,5 +203,6 @@ } | ||
* @param {number|string} value Value to set | ||
* @param {boolean} [ignoreWritableCheck=false] Ignore the writable check | ||
* @returns {Promise<Object|boolean>} should return a true - or if a body is returned teh body object (can this happen?) | ||
*/ | ||
async setData(managementPoint, dataPoint, dataPointPath, value) { | ||
async setData(managementPoint, dataPoint, dataPointPath, value, ignoreWritableCheck = false) { | ||
if (value === undefined) { | ||
@@ -214,3 +216,3 @@ value = dataPointPath; | ||
const dataPointDef = dataPointPath ? this.managementPoints[managementPoint][dataPoint][dataPointPath] : this.managementPoints[managementPoint][dataPoint]; | ||
this.#validateData(dataPointDef, value); | ||
this.#validateData(dataPointDef, value, ignoreWritableCheck); | ||
const setPath = '/v1/gateway-devices/' + this.getId() + '/management-points/' + managementPoint + '/characteristics/' + dataPoint; | ||
@@ -217,0 +219,0 @@ const setBody = { |
{ | ||
"name": "daikin-controller-cloud", | ||
"version": "2.3.0", | ||
"version": "2.4.0", | ||
"description": "Interact with Daikin Cloud devices and retrieve Tokens", | ||
@@ -5,0 +5,0 @@ "author": "Apollon77 <iobroker@fischer-ka.de>", |
@@ -100,2 +100,5 @@ # daikin-controller-cloud | ||
## Changelog: | ||
### 2.4.0 (2024-07-17) | ||
* (Apollon77) Allows to ignore the check if a state is writable on setData | ||
### 2.3.0 (2024-07-12) | ||
@@ -102,0 +105,0 @@ * (Apollon77) Block API request maximum for 24h and then check again |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71456
799
178