From e25b183c2311ff24e67c88fe4e2c1b012050bc47 Mon Sep 17 00:00:00 2001 From: GUVWAF Date: Thu, 2 Nov 2023 20:35:57 +0100 Subject: [PATCH] Add getter/setter for AmbientLighting Module --- meshtastic/mesh_interface.py | 4 ++++ meshtastic/node.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/meshtastic/mesh_interface.py b/meshtastic/mesh_interface.py index e4ae5d5..426ed66 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -874,6 +874,10 @@ class MeshInterface: self.localNode.moduleConfig.detection_sensor.CopyFrom( fromRadio.moduleConfig.detection_sensor ) + elif fromRadio.moduleConfig.HasField("ambient_lighting"): + self.localNode.moduleConfig.ambient_lighting.CopyFrom( + fromRadio.moduleConfig.ambient_lighting + ) else: logging.debug("Unexpected FromRadio payload") diff --git a/meshtastic/node.py b/meshtastic/node.py index 37f7aba..2b64d2c 100644 --- a/meshtastic/node.py +++ b/meshtastic/node.py @@ -192,6 +192,8 @@ class Node: p.set_module_config.neighbor_info.CopyFrom(self.moduleConfig.neighbor_info) elif config_name == "detection_sensor": p.set_module_config.detection_sensor.CopyFrom(self.moduleConfig.detection_sensor) + elif config_name == "ambient_lighting": + p.set_module_config.ambient_lighting.CopyFrom(self.moduleConfig.ambient_lighting) else: our_exit(f"Error: No valid config with name {config_name}")