Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
Nall-chan committed Dec 23, 2023
1 parent 0ffe648 commit 2b65a01
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions ClimacontrolRegulator/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,16 @@ protected function SetParamVariables(array $Params)
{
$d = new DateTime();
$d->setTime(
$Params[\HMExtended\ClimacontrolRegulator::DECALCIFICATION_HOUR],
$Params[\HMExtended\ClimacontrolRegulator::DECALCIFICATION_MINUTE],
(int) $Params[\HMExtended\ClimacontrolRegulator::DECALCIFICATION_HOUR],
(int) $Params[\HMExtended\ClimacontrolRegulator::DECALCIFICATION_MINUTE],
0,
0
);
$Params[\HMExtended\ClimacontrolRegulator::DECALCIFICATION_TIME] = $d->getTimestamp();
$d = new DateTime();
$d->setTime(
$Params[\HMExtended\ClimacontrolRegulator::PARTY_END_HOUR],
($Params[\HMExtended\ClimacontrolRegulator::PARTY_END_MINUTE] == 0 ? 0 : 30),
(int) $Params[\HMExtended\ClimacontrolRegulator::PARTY_END_HOUR],
((int) $Params[\HMExtended\ClimacontrolRegulator::PARTY_END_MINUTE] == 0 ? 0 : 30),
0,
0
);
Expand Down
8 changes: 4 additions & 4 deletions HeatingGroup/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,21 +233,21 @@ protected function SetVariable(string $Ident, $Value)
case \HMExtended\HeatingGroup::PARTY_STOP_DAY:
$Ident = \HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][2];
$d = (new DateTime())->setTimestamp((int) $this->GetValue($Ident));
$d->setDate((int) $d->format('Y'), (int) $d->format('n'), $Value);
$d->setDate((int) $d->format('Y'), (int) $d->format('n'), (int) $Value);
$Value = $d->getTimestamp();
break;
case \HMExtended\HeatingGroup::PARTY_START_MONTH:
case \HMExtended\HeatingGroup::PARTY_STOP_MONTH:
$Ident = \HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][2];
$d = (new DateTime())->setTimestamp((int) $this->GetValue($Ident));
$d->setDate((int) $d->format('Y'), $Value, (int) $d->format('j'));
$d->setDate((int) $d->format('Y'), (int) $Value, (int) $d->format('j'));
$Value = $d->getTimestamp();
break;
case \HMExtended\HeatingGroup::PARTY_START_YEAR:
case \HMExtended\HeatingGroup::PARTY_STOP_YEAR:
$Ident = \HMExtended\ValuesSet::$Variables[static::DeviceTyp][$Ident][2];
$d = (new DateTime())->setTimestamp((int) $this->GetValue($Ident));
$d->setDate(2000 + $Value, (int) $d->format('n'), (int) $d->format('j'));
$d->setDate(2000 + (int) $Value, (int) $d->format('n'), (int) $d->format('j'));
$Value = $d->getTimestamp();
if ($Value < 946767600) {
$d = new DateTime();
Expand All @@ -258,7 +258,7 @@ protected function SetVariable(string $Ident, $Value)
case \HMExtended\HeatingGroup::PARTY_START_TIME:
case \HMExtended\HeatingGroup::PARTY_STOP_TIME:
$d = (new DateTime())->setTimestamp((int) $this->GetValue($Ident));
$d->setTime(intdiv($Value, 60), ($Value % 60), 0, 0);
$d->setTime(intdiv((int) $Value, 60), ((int) $Value % 60), 0, 0);
$Value = $d->getTimestamp();
break;
}
Expand Down
4 changes: 2 additions & 2 deletions HeatingGroupHmIP/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ protected function SetParamVariables(array $Params)
{
$d = new DateTime();
$d->setTime(
intdiv($Params[\HMExtended\HeatingGroupHmIP::DECALCIFICATION_TIME], 2),
(($Params[\HMExtended\HeatingGroupHmIP::DECALCIFICATION_TIME] % 2) == 1 ? 30 : 0),
intdiv((int) $Params[\HMExtended\HeatingGroupHmIP::DECALCIFICATION_TIME], 2),
(((int) $Params[\HMExtended\HeatingGroupHmIP::DECALCIFICATION_TIME] % 2) == 1 ? 30 : 0),
0,
0
);
Expand Down

0 comments on commit 2b65a01

Please sign in to comment.