Skip to content

Commit e25b183

Browse files
committed
Add getter/setter for AmbientLighting Module
1 parent 236d30f commit e25b183

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

meshtastic/mesh_interface.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,10 @@ def _handleFromRadio(self, fromRadioBytes):
874874
self.localNode.moduleConfig.detection_sensor.CopyFrom(
875875
fromRadio.moduleConfig.detection_sensor
876876
)
877+
elif fromRadio.moduleConfig.HasField("ambient_lighting"):
878+
self.localNode.moduleConfig.ambient_lighting.CopyFrom(
879+
fromRadio.moduleConfig.ambient_lighting
880+
)
877881

878882
else:
879883
logging.debug("Unexpected FromRadio payload")

meshtastic/node.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ def writeConfig(self, config_name):
192192
p.set_module_config.neighbor_info.CopyFrom(self.moduleConfig.neighbor_info)
193193
elif config_name == "detection_sensor":
194194
p.set_module_config.detection_sensor.CopyFrom(self.moduleConfig.detection_sensor)
195+
elif config_name == "ambient_lighting":
196+
p.set_module_config.ambient_lighting.CopyFrom(self.moduleConfig.ambient_lighting)
195197
else:
196198
our_exit(f"Error: No valid config with name {config_name}")
197199

0 commit comments

Comments
 (0)