-
Couldn't load subscription status.
- Fork 27
-
I'm triying to make a simple rule IF A then B
but if I write
R1 = Rule({A: B})
R1 = Rule({temp.hot: motor.fast})
Gives me an error
TypeError: 'Set' object is not iterable
Beta Was this translation helpful? Give feedback.
All reactions
Hi, did you figure it out?
Rules are there to map sets of one domain to a single set of another, so it expects the left side to be an iterable like a tuple.
Try
R1 = Rule({(temp.hot, ): motor.fast})
That should do the trick.
Replies: 1 comment 1 reply
-
Hi, did you figure it out?
Rules are there to map sets of one domain to a single set of another, so it expects the left side to be an iterable like a tuple.
Try
R1 = Rule({(temp.hot, ): motor.fast})
That should do the trick.
Beta Was this translation helpful? Give feedback.
All reactions
-
I thought it was a simple thing, but my Python is a bit basic at the moment. Thank you very much!!
Beta Was this translation helpful? Give feedback.