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

Compilation fails when using for condition #396

Closed
ptatrai opened this issue Jun 4, 2019 · 1 comment · Fixed by esphome/esphome#616
Closed

Compilation fails when using for condition #396

ptatrai opened this issue Jun 4, 2019 · 1 comment · Fixed by esphome/esphome#616

Comments

@ptatrai
Copy link

ptatrai commented Jun 4, 2019

Operating environment/Installation (Hass.io/Docker/pip/etc.):

pip, esphome version 1.13.4

ESP (ESP32/ESP8266, Board/Sonoff):

ESP8266

Affected component:

for condition

Description of problem:
Compilation fails. Configuration and traceback is provided below.

Problem-relevant YAML-configuration entries:

esphome:
  name: test
  platform: ESP8266
  board: esp8285

output:
  - platform: gpio
    pin: 
      number: GPIO2
      mode: OUTPUT
    id: oled

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO12
      mode: INPUT_PULLUP
      inverted: True
    internal: true
    id: buttonUp
    name: "Tlacidlo 1"
    on_press:
      - output.turn_on: oled 
    on_release:
      - if:
          condition:
            not:
              for:
                time: 1.5s
                condition:
                  binary_sensor.is_on: buttonUp
          then:
            output.turn_off: oled

Traceback (if applicable):

INFO Reading configuration...
INFO Generating C++ source...
Traceback (most recent call last):
  File "/home/ptatrai/.local/bin/esphome", line 11, in <module>
    sys.exit(main())
  File "/home/ptatrai/.local/lib/python2.7/site-packages/esphome/__main__.py", line 483, in main
    return run_esphome(sys.argv)
  File "/home/ptatrai/.local/lib/python2.7/site-packages/esphome/__main__.py", line 473, in run_esphome
    return POST_CONFIG_ACTIONS[args.command](args, config)
  File "/home/ptatrai/.local/lib/python2.7/site-packages/esphome/__main__.py", line 272, in command_compile
    exit_code = write_cpp(config)
  File "/home/ptatrai/.local/lib/python2.7/site-packages/esphome/__main__.py", line 147, in write_cpp
    CORE.flush_tasks()
  File "/home/ptatrai/.local/lib/python2.7/site-packages/esphome/core.py", line 616, in flush_tasks
    next(task)
  File "/home/ptatrai/.local/lib/python2.7/site-packages/esphome/core.py", line 421, in _wrapper_generator
    for x in var:
  File "/home/ptatrai/.local/lib/python2.7/site-packages/esphome/core.py", line 421, in _wrapper_generator
    for x in var:
  File "/home/ptatrai/.local/lib/python2.7/site-packages/esphome/core.py", line 421, in _wrapper_generator
    for x in var:
  File "/home/ptatrai/.local/lib/python2.7/site-packages/esphome/core.py", line 421, in _wrapper_generator
    for x in var:
  File "/home/ptatrai/.local/lib/python2.7/site-packages/esphome/core.py", line 421, in _wrapper_generator
    for x in var:
  File "/home/ptatrai/.local/lib/python2.7/site-packages/esphome/core.py", line 421, in _wrapper_generator
    for x in var:
  File "/home/ptatrai/.local/lib/python2.7/site-packages/esphome/core.py", line 421, in _wrapper_generator
    for x in var:
  File "/home/ptatrai/.local/lib/python2.7/site-packages/esphome/core.py", line 421, in _wrapper_generator
    for x in var:
  File "/home/ptatrai/.local/lib/python2.7/site-packages/esphome/core.py", line 421, in _wrapper_generator
    for x in var:
  File "/home/ptatrai/.local/lib/python2.7/site-packages/esphome/core.py", line 421, in _wrapper_generator
    for x in var:
  File "/home/ptatrai/.local/lib/python2.7/site-packages/esphome/core.py", line 421, in _wrapper_generator
    for x in var:
  File "/home/ptatrai/.local/lib/python2.7/site-packages/esphome/core.py", line 421, in _wrapper_generator
    for x in var:
  File "/home/ptatrai/.local/lib/python2.7/site-packages/esphome/core.py", line 417, in _wrapper_generator
    var = gen.send(var)
  File "/home/ptatrai/.local/lib/python2.7/site-packages/esphome/cpp_helpers.py", line 42, in register_component
    u"configuration.".format(id_))
ValueError: Component ID forcondition was not declared to inherit from Component, or was registered twice. Please create a bug report with your configuration.

Additional information and things you've tried:

OttoWinter added a commit to esphome/esphome that referenced this issue Jun 4, 2019
@ptatrai
Copy link
Author

ptatrai commented Jun 4, 2019

Confirming that esphome/esphome@5085c3c fixed the issue.

OttoWinter added a commit to esphome/esphome that referenced this issue Jun 6, 2019
OttoWinter added a commit to esphome/esphome that referenced this issue Jun 8, 2019
@esphome esphome locked and limited conversation to collaborators Jun 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant