Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
Nall-chan committed Aug 25, 2024
1 parent 6cd0344 commit 16accad
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions Bosch SmartHome IO/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ public function GetConfigurationForm(): string
$Form['actions'][1]['popup']['items'][2]['caption'] = sprintf($this->Translate("Press the Bosch Smart Home Controller's front-side button number %d, until the LED begin flashing.\r\n\r\nEnter your Bosch Smart Home Controller system password into the Textbox below\r\n and then click the \"Pair\" button."), $SHCButton);
$Form['actions'][1]['visible'] = true;
} else {
if ($this->ReadAttributeString(self::Attribute_License) != IPS_GetLicensee()){
$Form['actions'][3]['popup']['items'][0]['caption']=$this->Translate("Your Symcon license has changed.\r\nPlease delete the old connection in Symcon and your Bosch Smart Home App,\r\n and start re-pairing with Symcon.");
if ($this->ReadAttributeString(self::Attribute_License) != IPS_GetLicensee()) {
$Form['actions'][3]['popup']['items'][0]['caption'] = $this->Translate("Your Symcon license has changed.\r\nPlease delete the old connection in Symcon and your Bosch Smart Home App,\r\n and start re-pairing with Symcon.");
$Form['actions'][3]['visible'] = true;
}
}
Expand Down Expand Up @@ -336,18 +336,18 @@ public function StartPairing(string $Password): string
return $this->Translate('Pairing error! Button pressed? Password correct?');
}

public function ResetPairing():string
public function ResetPairing(): string
{
if ($this->SHCPollId != '') {
$this->Unsubscribe();
}
if ($this->CreateNewCert()){
$this->isPaired=false;
$this->SetStatus(self::IS_NotPaired);
return 'MESSAGE:' . $this->Translate('Pairing deleted.');
}
$this->SetStatus(self::IS_NoCert);
return $this->Translate('No certificate available');
if ($this->CreateNewCert()) {
$this->isPaired = false;
$this->SetStatus(self::IS_NotPaired);
return 'MESSAGE:' . $this->Translate('Pairing deleted.');
}
$this->SetStatus(self::IS_NoCert);
return $this->Translate('No certificate available');

}
/**
Expand Down Expand Up @@ -676,21 +676,21 @@ private function GetTempFile(string $Type): string
return $TmpFileName;
}

private function DeleteTempFile(string $Type):void
private function DeleteTempFile(string $Type): void
{
if ($this->{'TempFile' . $Type} != '') {
if (file_exists($this->{'TempFile' . $Type})) {
@unlink($this->{'TempFile' . $Type});
}
}
}
}

private function SendRequest(string $RequestURL, string $RequestMethod = \BoschSHC\HTTP::GET, string $Payload = '', int $Timeout = 5000, array $RequestHeader = []): bool|string
{
if (!$this->Host) {
return false;
}
$CurlURL = $this->Host . $RequestURL;
$CurlURL = $this->Host . $RequestURL;
/** @var array $_IPS */
$this->SendDebug('RequestMethod:' . $_IPS['THREAD'], $RequestMethod, 0);
$this->SendDebug('RequestURL:' . $_IPS['THREAD'], $CurlURL, 0);
Expand Down Expand Up @@ -778,7 +778,7 @@ private function CreateNewCert(): bool
{
$this->SendDebug('CreateNewCert', 'start', 0);
$this->DeleteTempFile(self::Attribute_MyCert);
$this->DeleteTempFile(self::Attribute_PrivateKey);
$this->DeleteTempFile(self::Attribute_PrivateKey);
$basedir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $this->InstanceID;
$configfile = $basedir . '.cnf';
$newLine = "\r\n";
Expand Down

0 comments on commit 16accad

Please sign in to comment.