remove channel from networkSettings

This commit is contained in:
MichaelDvP
2023-09-19 15:19:45 +02:00
parent 6ab2135cea
commit 9f1002df9a
14 changed files with 24 additions and 35 deletions

View File

@@ -83,7 +83,6 @@ const WiFiSettingsForm: FC = () => {
updateState('networkSettings', (current_data) => ({
ssid: selectedNetwork.ssid,
bssid: selectedNetwork.bssid,
channel: selectedNetwork.channel,
password: current_data ? current_data.password : '',
hostname: current_data?.hostname,
static_ip_config: false,
@@ -178,24 +177,13 @@ const WiFiSettingsForm: FC = () => {
<ValidatedTextField
fieldErrors={fieldErrors}
name="bssid"
label={'BSSID (leave blank for SSID only)'}
label={'BSSID (' + LL.NETWORK_BLANK_BSSID() + ')'}
fullWidth
variant="outlined"
value={data.bssid}
onChange={updateFormValue}
margin="normal"
/>
<ValidatedTextField
fieldErrors={fieldErrors}
name="channel"
label="Channel (0=auto)"
fullWidth
variant="outlined"
value={numberValue(data.channel)}
onChange={updateFormValue}
type="number"
margin="normal"
/>
{(!selectedNetwork || !isNetworkOpen(selectedNetwork)) && (
<ValidatedPasswordField
fieldErrors={fieldErrors}

View File

@@ -282,6 +282,7 @@ const de: Translation = {
NETWORK_SCANNER: 'Netzwerk Suche',
NETWORK_NO_WIFI: 'Keine WiFi Netzwerke gefunden',
NETWORK_BLANK_SSID: 'Freilassen um WiFi zu deaktivieren und ETH zu aktivieren',
NETWORK_BLANK_BSSID: 'Freilassen um nur SSID für die Verbindung zu nutzen',
TX_POWER: 'Tx Leistung',
HOSTNAME: 'Hostname',
NETWORK_DISABLE_SLEEP: 'Deaktiviere WiFi Schlafmodus',

View File

@@ -282,6 +282,7 @@ const en: Translation = {
NETWORK_SCANNER: 'Network Scanner',
NETWORK_NO_WIFI: 'No WiFi networks found',
NETWORK_BLANK_SSID: 'leave blank to disable WiFi and enable ETH',
NETWORK_BLANK_BSSID: 'leave blank to use only SSID',
TX_POWER: 'Tx Power',
HOSTNAME: 'Hostname',
NETWORK_DISABLE_SLEEP: 'Disable WiFi Sleep Mode',

View File

@@ -282,6 +282,7 @@ const fr: Translation = {
NETWORK_SCANNER: 'Scan réseau',
NETWORK_NO_WIFI: 'Pas de réseau WiFi trouvé',
NETWORK_BLANK_SSID: 'laisser vide pour désactiver le WiFi', // and enable ETH // TODO translate
NETWORK_BLANK_BSSID: 'leave blank to use only SSID', // TODO translate
TX_POWER: 'Puissance Tx',
HOSTNAME: 'Nom d\'hôte',
NETWORK_DISABLE_SLEEP: 'Désactiver le mode veille du WiFi',

View File

@@ -284,6 +284,7 @@ const it: Translation = {
NETWORK_SCANNER: 'Scansione Rete',
NETWORK_NO_WIFI: 'Nessuana rete WiFi trovata',
NETWORK_BLANK_SSID: 'lasciare vuoto per disattivare WiFi',
NETWORK_BLANK_BSSID: 'leave blank to use only SSID', // TODO translate
TX_POWER: 'Potenza Tx',
HOSTNAME: 'Nome ospite',
NETWORK_DISABLE_SLEEP: 'Disabilita la modalità sospensione Wi-Fi',

View File

@@ -282,6 +282,7 @@ const nl: Translation = {
NETWORK_SCANNER: 'Netwerk Scanner',
NETWORK_NO_WIFI: 'Geen WiFi networken gevonden',
NETWORK_BLANK_SSID: 'laat leeg om WiFi uit te schakelen',
NETWORK_BLANK_BSSID: 'leave blank to use only SSID', // TODO translate
TX_POWER: 'Tx Vermogen',
HOSTNAME: 'Hostname',
NETWORK_DISABLE_SLEEP: 'WiFi Sleep Mode uitzetten',

View File

@@ -282,6 +282,7 @@ const no: Translation = {
NETWORK_SCANNER: 'Nettverk Scanner',
NETWORK_NO_WIFI: 'Ingen trådløse nett funnet',
NETWORK_BLANK_SSID: 'la feltet være blankt for å deaktivisere trådløst nettverk', // TODO translate
NETWORK_BLANK_BSSID: 'leave blank to use only SSID', // TODO translate
TX_POWER: 'Tx Effekt',
HOSTNAME: 'Hostname',
NETWORK_DISABLE_SLEEP: 'Hindre at trådløst nettverk går i Sleep Mode',

View File

@@ -282,6 +282,7 @@ const pl: BaseTranslation = {
NETWORK_SCANNER: 'Skaner sieci WiFi',
NETWORK_NO_WIFI: 'Brak sieci WiFi w zasięgu',
NETWORK_BLANK_SSID: 'pozostaw puste aby wyłączyć WiFi', // and enable ETH // TODO translate
NETWORK_BLANK_BSSID: 'leave blank to use only SSID', // TODO translate
TX_POWER: 'Moc nadawania',
HOSTNAME: 'Nazwa w sieci',
NETWORK_DISABLE_SLEEP: 'Wyłącz tryb uśpienia WiFi',

View File

@@ -282,6 +282,7 @@ const sv: Translation = {
NETWORK_SCANNER: 'Hittade nätverk',
NETWORK_NO_WIFI: 'Inga WiFi-nätverk hittades',
NETWORK_BLANK_SSID: 'lämna blankt för att inaktivera WiFi', // and enable ETH // TODO translate
NETWORK_BLANK_BSSID: 'leave blank to use only SSID', // TODO translate
TX_POWER: 'Tx Effekt',
HOSTNAME: 'Värdnamn',
NETWORK_DISABLE_SLEEP: 'Inaktivera sömnläge',

View File

@@ -282,6 +282,7 @@ const tr: Translation = {
NETWORK_SCANNER: 'Ağ Tarayıcısı',
NETWORK_NO_WIFI: 'Hiçbir Kablosuz Ağ bulunamadı',
NETWORK_BLANK_SSID: 'Kablosuz ağı devre dışı bırakmak için boş bırakın', // TODO translate
NETWORK_BLANK_BSSID: 'leave blank to use only SSID', // TODO translate
TX_POWER: 'Aktarım gücü',
HOSTNAME: 'Ana Makine Adı',
NETWORK_DISABLE_SLEEP: 'Kablosuz uyku modunu devre dışına al',

View File

@@ -38,7 +38,6 @@ export interface NetworkStatus {
export interface NetworkSettings {
ssid: string;
bssid: string;
channel: number;
password: string;
hostname: string;
static_ip_config: boolean;

View File

@@ -18,9 +18,5 @@ export const createNetworkSettingsValidator = (networkSettings: NetworkSettings)
tx_power: [
{ required: true, message: 'Tx Power is required' },
{ type: 'number', min: 0, max: 20, message: 'Tx Power must be between 0 and 20dBm' }
],
channel: [
{ required: true, message: 'Channel is required' },
{ type: 'number', min: 0, max: 13, message: 'Channel must be between 0 and 13' }
]
});

View File

@@ -78,9 +78,9 @@ void NetworkSettingsService::manageSTA() {
for (uint8_t i = 0; i < 6; i++) {
mac1[i] = (uint8_t)mac[i];
}
WiFi.begin(_state.ssid.c_str(), _state.password.c_str(), _state.channel, mac1);
WiFi.begin(_state.ssid.c_str(), _state.password.c_str(), 0, mac1);
} else {
WiFi.begin(_state.ssid.c_str(), _state.password.c_str(), _state.channel);
WiFi.begin(_state.ssid.c_str(), _state.password.c_str());
}
// set power after wifi is startet, fixed value for C3_V1

View File

@@ -34,7 +34,6 @@ class NetworkSettings {
String bssid;
String password;
String hostname;
uint8_t channel;
bool staticIPConfig;
bool enableIPv6;
bool bandwidth20;
@@ -55,7 +54,6 @@ class NetworkSettings {
// connection settings
root["ssid"] = settings.ssid;
root["bssid"] = settings.bssid;
root["channel"] = settings.channel;
root["password"] = settings.password;
root["hostname"] = settings.hostname;
root["static_ip_config"] = settings.staticIPConfig;
@@ -80,7 +78,6 @@ class NetworkSettings {
auto CORSOrigin = settings.CORSOrigin;
settings.ssid = root["ssid"] | FACTORY_WIFI_SSID;
settings.bssid = root["bssid"] | "";
settings.channel = root["channel"] | 0;
settings.password = root["password"] | FACTORY_WIFI_PASSWORD;
settings.hostname = root["hostname"] | FACTORY_WIFI_HOSTNAME;
settings.staticIPConfig = root["static_ip_config"] | false;