mirror of
https://github.com/meshtastic/python.git
synced 2026-04-20 14:58:54 -04:00
Module config progress
This commit is contained in:
@@ -532,15 +532,18 @@ class MeshInterface:
|
||||
# stream API fromRadio.config_complete_id
|
||||
logging.debug(f"Config complete ID {self.configId}")
|
||||
self._handleConfigComplete()
|
||||
|
||||
elif fromRadio.HasField("packet"):
|
||||
self._handlePacketFromRadio(fromRadio.packet)
|
||||
|
||||
elif fromRadio.rebooted:
|
||||
# Tell clients the device went away. Careful not to call the overridden
|
||||
# subclass version that closes the serial port
|
||||
MeshInterface._disconnected(self)
|
||||
|
||||
self._startConfig() # redownload the node db etc...
|
||||
elif fromRadio.config:
|
||||
|
||||
elif fromRadio.config or fromRadio.moduleConfig:
|
||||
if fromRadio.config.HasField("device"):
|
||||
self.localNode.localConfig.device.CopyFrom(fromRadio.config.device)
|
||||
elif fromRadio.config.HasField("position"):
|
||||
@@ -553,6 +556,20 @@ class MeshInterface:
|
||||
self.localNode.localConfig.display.CopyFrom(fromRadio.config.display)
|
||||
elif fromRadio.config.HasField("lora"):
|
||||
self.localNode.localConfig.lora.CopyFrom(fromRadio.config.lora)
|
||||
|
||||
elif fromRadio.moduleConfig.HasField("mqtt"):
|
||||
self.localNode.moduleConfig.mqtt.CopyFrom(fromRadio.moduleConfig.mqtt)
|
||||
elif fromRadio.moduleConfig.HasField("serial"):
|
||||
self.localNode.moduleConfig.serial.CopyFrom(fromRadio.moduleConfig.serial)
|
||||
elif fromRadio.moduleConfig.HasField("external_notification"):
|
||||
self.localNode.moduleConfig.external_notification.CopyFrom(fromRadio.moduleConfig.external_notification)
|
||||
elif fromRadio.moduleConfig.HasField("range_test"):
|
||||
self.localNode.moduleConfig.range_test.CopyFrom(fromRadio.moduleConfig.range_test)
|
||||
elif fromRadio.moduleConfig.HasField("telemetry"):
|
||||
self.localNode.moduleConfig.telemetry.CopyFrom(fromRadio.moduleConfig.telemetry)
|
||||
elif fromRadio.moduleConfig.HasField("canned_message"):
|
||||
self.localNode.moduleConfig.canned_message.CopyFrom(fromRadio.moduleConfig.canned_message)
|
||||
|
||||
else:
|
||||
logging.debug("Unexpected FromRadio payload")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user