Skip to content

Commit

Permalink
force firmware update to luna only on luna
Browse files Browse the repository at this point in the history
  • Loading branch information
zoic21 authored Mar 13, 2024
1 parent 2cc22c7 commit 9bbdb55
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
3 changes: 3 additions & 0 deletions core/class/z2m.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ public static function dependancy_end() {
}

public static function firmwareUpdate($_options = array()) {
if(file_exists('/dev/ttyLuna-Zigbee' && $_options['sub_controller'] != 'luna')){
throw new Exception(__("Attention il n'est pas possible de lancer ce type de mise à jour firmware sur votre box (vous ne pouvez lancer qu'une mise à jour de firmware Luna)", __FILE__));
}
config::save('deamonAutoMode', 0, 'z2m');
log::clear(__CLASS__ . '_firmware');
$log = log::getPathToLog(__CLASS__ . '_firmware');
Expand Down
25 changes: 14 additions & 11 deletions desktop/modal/firmware_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,33 @@
<div class="col-sm-2">
<select class="firmwareAttr form-control" data-l1key="sub_controller">
<option value="">{{Aucun}}</option>
<option value="elelabs">{{Elelabs/Popp}}</option>
<?php if(!file_exists('/dev/ttyLuna-Zigbee')){ ?>
<option value="elelabs">{{Elelabs/Popp}}</option>
<?php } ?>
<option value="luna">{{Luna}}</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">{{Port Zigbee}}</label>
<div class="col-sm-2">
<select class="configKey form-control" data-l1key="port">
<option value="none">{{Aucun}}</option>
<option value="auto">{{Auto}}</option>
<option value="gateway">{{Passerelle distante}}</option>
<option value="/dev/ttyS2">{{Atlas (/dev/ttyS2)}}</option>
<option value="/dev/ttyLuna-Zigbee">{{Luna Zigbee (/dev/ttyLuna-Zigbee)}}</option>
<?php
<select class="firmwareAttr form-control" data-l1key="port">
<?php
if(file_exists('/dev/ttyS2')){
echo ' <option value="/dev/ttyS2">{{Atlas (/dev/ttyS2)}}</option>';
}
if(file_exists('/dev/ttyLuna-Zigbee')){
echo '<option value="/dev/ttyLuna-Zigbee">{{Luna Zigbee (/dev/ttyLuna-Zigbee)}}</option>';
}
foreach (jeedom::getUsbMapping() as $name => $value) {
if(isset($findPort[$value])){
continue;
}
echo '<option value="' . $value . '">' . $name . ' (' . $value . ')</option>';
}
if(file_exists('/dev/ttyAMA0')){
echo '<option value="/dev/ttyAMA0">/dev/ttyAMA0</option>';
}
if(file_exists('/dev/ttyAMA0')){
echo '<option value="/dev/ttyAMA0">/dev/ttyAMA0</option>';
}
?>
</select>
</div>
Expand Down
4 changes: 4 additions & 0 deletions docs/fr_FR/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
>
>S'il n'y a pas d'information sur la mise à jour, c'est que celle-ci concerne uniquement de la mise à jour de documentation, de traduction ou de texte.
# 13/03/2024

- Limitation de la mise à jour du firmware zigbee à Luna sur les box Luna (évite de casser la puce Zigbee en cas de mauvais choix)

# 26/02/2024

- Correction d'un soucis sur l'installation de mqtt
Expand Down
10 changes: 5 additions & 5 deletions plugin_info/configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@
<option value="none">{{Aucun}}</option>
<option value="auto">{{Auto}}</option>
<option value="gateway">{{Passerelle distante}}</option>
<?php
<?php
if(file_exists('/dev/ttyS2')){
echo ' <option value="/dev/ttyS2">{{Atlas (/dev/ttyS2)}}</option>';
}
if(file_exists('/dev/ttyLuna-Zigbee')){
if(file_exists('/dev/ttyLuna-Zigbee')){
echo '<option value="/dev/ttyLuna-Zigbee">{{Luna Zigbee (/dev/ttyLuna-Zigbee)}}</option>';
}
foreach (jeedom::getUsbMapping() as $name => $value) {
Expand All @@ -68,9 +68,9 @@
}
echo '<option value="' . $value . '">' . $name . ' (' . $value . ')</option>';
}
if(file_exists('/dev/ttyAMA0')){
echo '<option value="/dev/ttyAMA0">/dev/ttyAMA0</option>';
}
if(file_exists('/dev/ttyAMA0')){
echo '<option value="/dev/ttyAMA0">/dev/ttyAMA0</option>';
}
?>
</select>
</div>
Expand Down

0 comments on commit 9bbdb55

Please sign in to comment.