hoffmation-base 2.22.4 → 2.22.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,7 +30,12 @@ class TuyaGarageOpener extends tuyaDevice_1.TuyaDevice {
30
30
  }
31
31
  break;
32
32
  case this._switchId:
33
- this._switchState = state.val === true;
33
+ if (this.settings.invertSensor) {
34
+ this._switchState = state.val === true;
35
+ }
36
+ else {
37
+ this._switchState = state.val === false;
38
+ }
34
39
  break;
35
40
  }
36
41
  super.update(idSplit, state, initial, true);
@@ -79,10 +79,10 @@ class ZigbeeLedRGBCCT extends zigbeeDimmer_1.ZigbeeDimmer {
79
79
  }
80
80
  this.log(models_1.LogLevel.Debug, `LED Schalten An: ${pValue}\tHelligkeit: ${brightness}%\tFarbe: "${color}"\tColorTemperatur: ${colorTemp}\tTransition Time: ${transitionTime}`);
81
81
  const formattedColor = services_1.Utils.formatHex(color);
82
- if (formattedColor !== null) {
83
- this.setState(this._stateIdColor, color);
82
+ if (formattedColor !== null && pValue) {
83
+ this.setState(this._stateIdColor, formattedColor);
84
84
  }
85
- if (colorTemp > -1) {
85
+ if (colorTemp > -1 && pValue) {
86
86
  this.setState(this._stateIdColorTemp, colorTemp);
87
87
  }
88
88
  super.setLight(pValue, timeout, force, brightness, transitionTime);
@@ -13,4 +13,8 @@ export declare class ZigbeeInnr142C extends ZigbeeLedRGBCCT {
13
13
  protected readonly _stateNameColorTemp: string;
14
14
  protected readonly _debounceStateDelay: number;
15
15
  constructor(pInfo: IoBrokerDeviceInfo);
16
+ /**
17
+ * @inheritDoc
18
+ */
19
+ setLight(pValue: boolean, timeout?: number, force?: boolean, brightness?: number, transitionTime?: number, color?: string, colorTemp?: number): void;
16
20
  }
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ZigbeeInnr142C = void 0;
4
4
  const deviceType_1 = require("../deviceType");
5
5
  const BaseDevices_1 = require("./BaseDevices");
6
+ const models_1 = require("../../../models");
7
+ const services_1 = require("../../services");
6
8
  class ZigbeeInnr142C extends BaseDevices_1.ZigbeeLedRGBCCT {
7
9
  constructor(pInfo) {
8
10
  super(pInfo, deviceType_1.DeviceType.ZigbeeInnr142C);
@@ -18,5 +20,36 @@ class ZigbeeInnr142C extends BaseDevices_1.ZigbeeLedRGBCCT {
18
20
  this._stateIdState = `${this.info.fullID}.state`;
19
21
  this._stateIdTransitionTime = `${this.info.fullID}.transition_time`;
20
22
  }
23
+ /**
24
+ * @inheritDoc
25
+ */
26
+ setLight(pValue, timeout, force, brightness = -1, transitionTime, color = '', colorTemp = -1) {
27
+ if (this._stateIdState === '') {
28
+ this.log(models_1.LogLevel.Error, `Keine State ID bekannt.`);
29
+ return;
30
+ }
31
+ if (!this.ioConn) {
32
+ this.log(models_1.LogLevel.Error, `Keine Connection bekannt.`);
33
+ return;
34
+ }
35
+ if (pValue && brightness === -1 && this.brightness < 10) {
36
+ brightness = 10;
37
+ }
38
+ this.log(models_1.LogLevel.Debug, `LED Schalten An: ${pValue}\tHelligkeit: ${brightness}%\tFarbe: "${color}"\tColorTemperatur: ${colorTemp}\tTransition Time: ${transitionTime}`);
39
+ if (this._lightOn !== pValue || this._brightness !== brightness) {
40
+ super.setLight(pValue, timeout, force, brightness, transitionTime);
41
+ }
42
+ const formattedColor = services_1.Utils.formatHex(color);
43
+ if (!pValue) {
44
+ return;
45
+ }
46
+ // Farben nur beim Einschalten setzen
47
+ if (formattedColor !== null && this.color !== formattedColor) {
48
+ this.setState(this._stateIdColor, formattedColor);
49
+ }
50
+ if (colorTemp > -1 && this.colortemp !== colorTemp) {
51
+ this.setState(this._stateIdColorTemp, colorTemp);
52
+ }
53
+ }
21
54
  }
22
55
  exports.ZigbeeInnr142C = ZigbeeInnr142C;