diff --git a/Home Connect Device/module.php b/Home Connect Device/module.php index 3ea6536..ffac008 100644 --- a/Home Connect Device/module.php +++ b/Home Connect Device/module.php @@ -168,6 +168,16 @@ public function ReceiveData($String) $this->SendDebug('ReceiveData', $String, 0); $data = json_decode($String, true); switch ($data['Event']) { + case 'DISCONNECTED': + if (@IPS_GetObjectIDByIdent('OperationState', $this->InstanceID)) { + // Offline device set OperationState to Inactive + $this->SetValue('OperationState', 'BSH.Common.EnumType.OperationState.Inactive'); + } + break; + case 'CONNECTED': + // Device comes online, request states + $this->refreshDeviceState($this->needsInitialization()); + break; case 'STATUS': case 'NOTIFY': $items = json_decode($data['Data'], true)['items'];