Merge pull request #675 from DJ2LS/dev-fix-modem-port

support different server ports
This commit is contained in:
DJ2LS 2024-03-04 07:14:56 -08:00 committed by GitHub
commit d2ee01479a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 14 additions and 1 deletions

View File

@ -126,6 +126,7 @@ function testHamlib() {
max="65534"
min="1025"
v-model="settings.local.port"
@change="onChange"
/>
</div>
@ -137,6 +138,7 @@ function testHamlib() {
placeholder="modem host (default 127.0.0.1)"
id="modem_port"
v-model="settings.local.host"
@change="onChange"
/>
</div>
</div>

View File

@ -1,4 +1,5 @@
[NETWORK]
modemaddress = 127.0.0.1
modemport = 5000
[STATION]

View File

@ -10,6 +10,7 @@ class CONFIG:
config_types = {
'NETWORK': {
'modemaddress': str,
'modemport': int,
},
'STATION': {

View File

@ -345,4 +345,13 @@ if __name__ == "__main__":
# initialize database default values
DatabaseManager(app.event_manager).initialize_default_values()
wsm.startThreads(app)
app.run()
conf = app.config_manager.read()
modemaddress = conf['NETWORK']['modemaddress']
modemport = conf['NETWORK']['modemport']
if not modemaddress:
modemaddress = '127.0.0.1'
if not modemport:
modemport = 5000
app.run(modemaddress, modemport)