Hello to all,
according to documentation I can use the logic object an some attributes and functions:
-logic.name: with the name of the logic as specified in logic.conf
-logic.last_time(): this function provides the last run of this logic (before the recent one)
-logic.prio: read and set of the current priority of this logic.
I can use with no problem name and prio attributes, but no way to get last_time() working.
For example if I write:
I tried with and without parenthesis, but I always get:
How can I solve?
Thanks in advance
according to documentation I can use the logic object an some attributes and functions:
-logic.name: with the name of the logic as specified in logic.conf
-logic.last_time(): this function provides the last run of this logic (before the recent one)
-logic.prio: read and set of the current priority of this logic.
I can use with no problem name and prio attributes, but no way to get last_time() working.
For example if I write:
Code:
#!/usr/bin/env python # logger.info("Hello World!") logger.info(logic.name) logger.info(logic.prio) logger.info(logic.last_time())
Code:
2014-10-26 16:46:43,123 INFO hello Hello World! -- hello.py:<module>:3 2014-10-26 16:46:43,128 INFO hello hello -- hello.py:<module>:4 2014-10-26 16:46:43,133 INFO hello 3 -- hello.py:<module>:5 2014-10-26 16:46:43,146 ERROR hello Logic: hello, File: /usr/smarthome/logics/hello.py, Line: 6, Method: <module>, Exception: 'Logic' object has no attribute 'last_time' -- scheduler.py:_task:334 Traceback (most recent call last): File "/usr/smarthome/lib/scheduler.py", line 327, in _task exec(obj.bytecode) File "/usr/smarthome/logics/hello.py", line 6, in <module> logger.info(logic.last_time()) AttributeError: 'Logic' object has no attribute 'last_time'
Thanks in advance
Kommentar