render('charts.html.twig'); } /** * @Route("/datas", name="datas") */ public function datas( TemperatureRepository $temperatureRepository, HygrometryRepository $hygrometryRepository, ParameterBagInterface $params ): Response { $from = new \DateTime('now - 1 day'); $to = new \DateTime('now'); return $this->render('datas.html.twig', [ 'temperatures' => $temperatureRepository->findByDateRange($from, $to, 100, 'DESC'), 'hygrometries' => $hygrometryRepository->findByDateRange($from, $to, 100, 'DESC'), 'lightOnAt' => (int) $params->get('light_on_at'), 'lightOffAt' => (int) $params->get('light_off_at'), ]); } }