I have started to slowly migrate my rules to the NGRE.
However at first I have some problems and I couldn’t find an answer for these at anywhere (even at the helper libraries docs).
Have this rather simple rule:
from core import * @rule("Everyone at Home", description="Updates the state of Everyone_Home item", tags=["presence"]) @when("Member of gPhoneHome changed") def everyone_home(event): everyone_home.log.info("Updating Everyone_Home state...") if ir.getItem("Phone_Home").state == ON: events.postUpdate("Everyone_Home", "ON")
The warnings I got immediately:
- ir is undefined. Where are these defined? What should be included? The docs only says the you can use
- Also the ON state is also interpreted as an undefined variable. Are there any place here in the NGRE where are these constants are defined and be used in rules, so I don’t need to use it them as String?
- events are also undefined.
Thanks for your help