From be61231fe6296fa0ba097c30528fccfdf59bd425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Dupont?= Date: Sat, 25 Apr 2020 14:56:14 +0200 Subject: [PATCH] Update vigilancemeteo.class.php --- core/class/vigilancemeteo.class.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/core/class/vigilancemeteo.class.php b/core/class/vigilancemeteo.class.php index 9223eff..1623ad7 100644 --- a/core/class/vigilancemeteo.class.php +++ b/core/class/vigilancemeteo.class.php @@ -165,6 +165,13 @@ public function postUpdate() { if ($this->getConfiguration('geoloc') == "jeedom") { $postal = config::byKey('info::postalCode'); $departement = $postal[0] . $postal[1]; + if ($departement == '20') { + if ($postal[2] <= '1') { + $departement = '2A'; + } else { + $departement = '2B'; + } + } } else { $departement = geotravCmd::byEqLogicIdAndLogicalId($this->getConfiguration('geoloc'),'location:department')->execCmd(); } @@ -756,6 +763,13 @@ public function getPollen() { } if ($geoloc == "jeedom") { $departement = substr(config::byKey('info::postalCode'),0,2); + if ($departement == '20') { + if ($postal[2] <= '1') { + $departement = '2A'; + } else { + $departement = '2B'; + } + } } else { $geotrav = eqLogic::byId($geoloc); if (is_object($geotrav) && $geotrav->getEqType_name() == 'geotrav') { @@ -970,6 +984,13 @@ public function getLink() { if ($this->getConfiguration('geoloc') == "jeedom") { $postal = config::byKey('info::postalCode'); $departement = $postal[0] . $postal[1]; + if ($departement == '20') { + if ($postal[2] <= '1') { + $departement = '2A'; + } else { + $departement = '2B'; + } + } } else { $departement = geotravCmd::byEqLogicIdAndLogicalId($this->getConfiguration('geoloc'),'location:department')->execCmd(); }