mirror of
https://github.com/Laxilef/OTGateway.git
synced 2026-11-25 07:43:04 +05:00
feat: merge master Ethernet support into dev
Adapt W5500 to the native network event queue and select STA or ETH from NetworkSettings. Preserve the existing dev network settings and add a separate C6 Ethernet build without BLE to fit the OTA slot. Validate with S3 and C6 Ethernet firmware builds, the shared LittleFS image, binary layout checks and targeted network transition checks.
This commit is contained in:
commit
4e71915222
21 files changed
+1007
-158
No files matched your search
@@ -97,6 +97,44 @@ const convertLegacyBackup = (data) => {
|
||||
|
||||
const result = convert(data);
|
||||
|
||||
const network = result?.network;
|
||||
if (network !== null && typeof network === 'object' && !Array.isArray(network)) {
|
||||
const hasLegacyAp = Object.prototype.hasOwnProperty.call(network, 'ap');
|
||||
const hasLegacySta = Object.prototype.hasOwnProperty.call(network, 'sta');
|
||||
if (hasLegacyAp || hasLegacySta) {
|
||||
const wifi = network.wifi !== null && typeof network.wifi === 'object' && !Array.isArray(network.wifi)
|
||||
? network.wifi : Object.create(null);
|
||||
|
||||
if (hasLegacyAp && !Object.prototype.hasOwnProperty.call(wifi, 'ap')) {
|
||||
wifi.ap = network.ap;
|
||||
}
|
||||
if (hasLegacySta && !Object.prototype.hasOwnProperty.call(wifi, 'sta')) {
|
||||
wifi.sta = network.sta;
|
||||
}
|
||||
network.wifi = wifi;
|
||||
delete network.ap;
|
||||
delete network.sta;
|
||||
}
|
||||
|
||||
if (!Object.prototype.hasOwnProperty.call(network, 'type')) {
|
||||
if (typeof network.ethernet?.enabled === 'boolean') {
|
||||
network.type = network.ethernet.enabled ? 3 : 2;
|
||||
|
||||
} else if (hasLegacyAp || hasLegacySta) {
|
||||
network.type = 2;
|
||||
}
|
||||
}
|
||||
|
||||
if (network.ethernet !== null && typeof network.ethernet === 'object' && !Array.isArray(network.ethernet)) {
|
||||
if (Object.prototype.hasOwnProperty.call(network.ethernet, 'pins')
|
||||
&& !Object.prototype.hasOwnProperty.call(network.ethernet, 'gpio')) {
|
||||
network.ethernet.gpio = network.ethernet.pins;
|
||||
}
|
||||
delete network.ethernet.pins;
|
||||
delete network.ethernet.enabled;
|
||||
}
|
||||
}
|
||||
|
||||
const opentherm = result?.settings?.opentherm;
|
||||
if (opentherm !== null && typeof opentherm === 'object') {
|
||||
delete opentherm.unit_system;
|
||||
|
||||
@@ -92,7 +92,7 @@ const setupForm = (formSelector, onResultCallback = null, noCastItems = []) => {
|
||||
});
|
||||
}
|
||||
|
||||
const setupNetworkScanForm = (formSelector, tableSelector) => {
|
||||
const setupNetworkScanForm = (formSelector, tableSelector, autorun = true) => {
|
||||
const form = document.querySelector(formSelector);
|
||||
if (!form) {
|
||||
console.error("form not found");
|
||||
@@ -261,7 +261,9 @@ const setupNetworkScanForm = (formSelector, tableSelector) => {
|
||||
};
|
||||
|
||||
form.addEventListener('submit', onSubmitFn);
|
||||
onSubmitFn();
|
||||
if (autorun) {
|
||||
onSubmitFn();
|
||||
}
|
||||
}
|
||||
|
||||
const setBusy = (busySelector, contentSelector, value, parent = undefined) => {
|
||||
|
||||
Reference in new issue
Block a user