Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional function - Undefined variable 'timeout' #1220

Closed
JulienCheny opened this issue Aug 14, 2022 · 2 comments
Closed

Conditional function - Undefined variable 'timeout' #1220

JulienCheny opened this issue Aug 14, 2022 · 2 comments

Comments

@JulienCheny
Copy link

Description

Hi,
I can't execute any function there is an error for all of them. It say that the "timeout" variable isn't defined.
This bug happens even to the default program.

Versions:

  • Mycodo Version: 8.14.0
  • Raspberry Pi Version: 4B
  • Raspbian OS Version: Debian GNU/Linux 11 (bullseye)

Reproducibility

  1. Go to Function
  2. Add "Conditional Controller"
  3. Open the Configure panel of the function just added
  4. Save the default program

Expected behavior

The timeout variable should be took from the "Timeout (seconds)" edit field
And initialized before this :
control = DaemonControl(pyro_timeout={timeout})

Error

Traceback (most recent call last):
File "/var/mycodo-root/mycodo/controllers/base_controller.py", line 72, in run
self.initialize_variables()
File "/var/mycodo-root/mycodo/controllers/controller_conditional.py", line 133, in initialize_variables
spec.loader.exec_module(conditional_run)
File "", line 790, in exec_module
File "", line 228, in _call_with_frames_removed
File "/home/pi/Mycodo/mycodo/user_python_code/conditional_861387d0-33d5-482d-ac0e-c904716674e0.py", line 6, in
control = DaemonControl(pyro_timeout={timeout})
NameError: name 'timeout' is not defined

Generated program

1: import os
2: import sys
3: sys.path.append(os.path.abspath('/var/mycodo-root'))
4: from mycodo.controllers.base_conditional import AbstractConditional
5: from mycodo.mycodo_client import DaemonControl
6: control = DaemonControl(pyro_timeout={timeout})
7: ...

@kizniche
Copy link
Owner

Fix released. Thanks for the bug report.

@kizniche
Copy link
Owner

This issue has been mentioned on Radical DIY Forum. There might be relevant details there:

https://forum.radicaldiy.com/t/mycodo-v8-14-0-release/1136/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants