diff --git a/src/Commands/Discover.php b/src/Commands/Discover.php index 60f557c..0f2f6f4 100644 --- a/src/Commands/Discover.php +++ b/src/Commands/Discover.php @@ -15,6 +15,7 @@ namespace FastyBird\Connector\Viera\Commands; +use DateTimeImmutable; use DateTimeInterface; use Doctrine\DBAL; use FastyBird\Connector\Viera; @@ -132,6 +133,10 @@ protected function execute(Input\InputInterface $input, Output\OutputInterface $ return Console\Command\Command::FAILURE; } + $executedTime = $this->clock->getNow(); + assert($executedTime instanceof DateTimeImmutable); + $this->executedTime = $executedTime->modify('-5 second'); + $io = new Style\SymfonyStyle($input, $output); $io->title((string) $this->translator->translate('//viera-connector.cmd.discover.title')); @@ -304,8 +309,6 @@ function (string|int|null $answer) use ($connectors): Documents\Connectors\Conne $io->info((string) $this->translator->translate('//viera-connector.cmd.discover.messages.starting')); - $this->executedTime = $this->clock->getNow(); - $serviceCmd = $symfonyApp->find(DevicesCommands\Connector::NAME); $result = $serviceCmd->run(new Input\ArrayInput([ diff --git a/src/Commands/Install.php b/src/Commands/Install.php index b28697c..81c379c 100644 --- a/src/Commands/Install.php +++ b/src/Commands/Install.php @@ -15,6 +15,7 @@ namespace FastyBird\Connector\Viera\Commands; +use DateTimeImmutable; use DateTimeInterface; use Doctrine\DBAL; use FastyBird\Connector\Viera; @@ -1713,6 +1714,8 @@ private function discoverDevices(Style\SymfonyStyle $io, Entities\Connectors\Con } $executedTime = $this->clock->getNow(); + assert($executedTime instanceof DateTimeImmutable); + $executedTime = $executedTime->modify('-5 second'); $symfonyApp = $this->getApplication();