Add the ability to modify the base radio frequency.

This commit is contained in:
Robert Strouse 2023-06-01 14:21:58 -07:00
parent 33fc37fa3d
commit cd173525b1
5 changed files with 21 additions and 5 deletions

View file

@ -378,6 +378,15 @@
</div>
<div class="field-group" style="display:inline-block;width:auto;min-width:247px;margin-top:-20px;vertical-align:top;">
<div class="field-group">
<input id="slidFrequency" name="frequency" type="range" min="433330" max="433499" step="1" style="width:100%;" oninput="somfy.frequencyChanged(this);" />
<label for="slidRxBandwidth" style="display:block;font-size:1em;margin-top:0px;margin-left:7px;">
<span>Base Frequency </span>
<span style="float:right;display:inline-block;margin-right:7px;">
<span id="spanFrequency" style="color:black;"></span><span>MHz</span>
</span>
</label>
</div>
<div class="field-group" style="margin-top:-10px;">
<input id="slidRxBandwidth" name="rxBandwidth" type="range" min="5803" max="81250" step="1" style="width:100%;" oninput="somfy.rxBandwidthChanged(this);" />
<label for="slidRxBandwidth" style="display:block;font-size:1em;margin-top:0px;margin-left:7px;">
<span>RX Bandwidth </span>

View file

@ -928,6 +928,8 @@ class Somfy {
document.getElementById('selRadioType').value = somfy.transceiver.config.type;
document.getElementById('selRadioProto').value = somfy.transceiver.config.proto;
document.getElementById('spanMaxShades').innerText = somfy.maxShades;
document.getElementById('spanFrequency').innerText = (Math.round(somfy.transceiver.config.frequency * 1000) / 1000).fmt('#,##0.000');
document.getElementById('slidFrequency').value = Math.round(somfy.transceiver.config.frequency * 1000);
document.getElementById('spanRxBandwidth').innerText = (Math.round(somfy.transceiver.config.rxBandwidth * 100) / 100).fmt('#,##0.00');
document.getElementById('slidRxBandwidth').value = Math.round(somfy.transceiver.config.rxBandwidth * 100);
document.getElementById('spanTxPower').innerText = somfy.transceiver.config.txPower;
@ -971,6 +973,7 @@ class Somfy {
MISOPin: getIntValue('selTransMISOPin'),
TXPin: getIntValue('selTransTXPin'),
RXPin: getIntValue('selTransRXPin'),
frequency: (Math.round(parseFloat(document.getElementById('spanFrequency').innerText) * 1000)) / 1000,
rxBandwidth: (Math.round(parseFloat(document.getElementById('spanRxBandwidth').innerText) * 100)) / 100,
txPower: parseInt(document.getElementById('spanTxPower').innerText, 10),
deviation: (Math.round(parseFloat(document.getElementById('spanDeviation').innerText) * 100)) / 100
@ -1897,6 +1900,9 @@ class Somfy {
rxBandwidthChanged(el) {
document.getElementById('spanRxBandwidth').innerText = (el.value / 100).fmt('#,##0.00');
};
frequencyChanged(el) {
document.getElementById('spanFrequency').innerText = (el.value / 1000).fmt('#,##0.000');
}
txPowerChanged(el) {
console.log(el.value);
let lvls = [-30, -20, -15, -10, -6, 0, 5, 7, 10, 11, 12];