Skip to content

Commit

Permalink
Update z2m.class.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Furaxworld authored Mar 10, 2024
1 parent 3cdfb35 commit dcb36b2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion core/class/z2m.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,20 @@ public static function cronDaily() {
return;
}
shell_exec("ls -1tr " . __DIR__ . "/../../data/backup/*.zip | head -n -10 | xargs -d '\n' rm -f -- >> /dev/null 2>&1");
/* * *************************Message for Zigbee2MQTT update****************************** */
$localVersion = config::byKey('zigbee2mqttVersion', 'z2m', '');
if ($localVersion!='') {
$releaseVersion = file_get_contents('https://raw.githubusercontent.com/Koenkk/zigbee2mqtt/master/package.json');
if ($releaseVersion !== false) {
$releaseVersion = json_decode($releaseVersion, true);
if (is_array($releaseVersion) && json_last_error() == '' && isset($releaseVersion['version']) && $localVersion !== $releaseVersion['version']) {
log::add('z2m', 'info', 'Nouvelle version de Zigbee2MQTT disponible : '.$releaseVersion['version'].' (Relancez les dépendances du plugin Jeezigbee pour effectuer la mise à jour)');
message::add('z2m', __('Nouvelle version de Zigbee2MQTT disponible' ,__FILE__) . ' : '.$releaseVersion['version'].' (Relancez les dépendances du plugin Jeezigbee pour effectuer la mise à jour)', null, null);
}
}
}
}

public static function cron() {
foreach (eqLogic::byType('z2m', true) as $eqLogic) {
$autorefresh = $eqLogic->getConfiguration('autorefresh');
Expand Down

0 comments on commit dcb36b2

Please sign in to comment.