From 327189f7a524dcdf965330a134c9e2276e9b5baa Mon Sep 17 00:00:00 2001 From: Inga Stotland Date: Sat, 29 Jun 2019 23:43:56 -0700 Subject: [PATCH] test: test-mesh - Correctly stop periodic publication This changes the order of checks for an updated publication period: check for zero period first, and if this is the case, stop sending the periodic model publications. Change-Id: I2693c5a593fa23e59dd2e015348f1fd96a30c88f Signed-off-by: Anupam Roy --- test/test-mesh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/test-mesh b/test/test-mesh index c075a64..4d515e1 100755 --- a/test/test-mesh +++ b/test/test-mesh @@ -606,15 +606,15 @@ class OnOffServer(Model): def set_publication(self, period): - # We do not handle ms in this example - if period < 1000: - return - self.pub_period = period if period == 0: self.timer.cancel() return + # We do not handle ms in this example + if period < 1000: + return + self.timer.start(period/1000, self.publish) def publish(self): -- 2.7.4