Skip to content

Commit 7f9138e

Browse files
committed
Returns booleans per the WIT contract
1 parent 68b6a54 commit 7f9138e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

samples/wasm/python/examples/branch/branch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def init(self, configuration) -> bool:
1818
imports.logger.log(imports.logger.Level.INFO, "module3/branch", "Init invoked")
1919
return True
2020

21-
def process(self, timestamp: int, input: types.DataModel) -> int:
21+
def process(self, timestamp: int, input: types.DataModel) -> bool:
2222
imports.logger.log(imports.logger.Level.INFO, "module3/branch", "processing from python")
2323

2424
if not isinstance(input, types.DataModel_Message):
@@ -31,7 +31,7 @@ def process(self, timestamp: int, input: types.DataModel) -> int:
3131

3232
if p.is_temperature():
3333
imports.logger.log(imports.logger.Level.INFO, "module3/branch", "temperature")
34-
return 0
34+
return False # first branch
3535

3636
imports.logger.log(imports.logger.Level.INFO, "module3/branch", "humidity")
37-
return 1
37+
return True # second branch

0 commit comments

Comments
 (0)