Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. [EspHome] Frage zu lambda (bzw. C++) Syntax

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    [EspHome] Frage zu lambda (bzw. C++) Syntax

    This topic has been deleted. Only users with topic management privileges can see it.
    • W
      WolfgangFB last edited by

      Ich versuche in einem ESP eine globale Variable in einem Sensor zu verabeiten und scheitere an der Syntax.

      Hier der einfach Code:

      globals:  
        - id: my_global_float
          type: float
          restore_value: no
          initial_value: '0'
      
      sensor:
        - platform: template
          name: Global_Test
          lambda: 'return {(my_global_float)};'
      
      

      Beim compilieren kommt:

      /opt/iobroker/iobroker-data/esphome.0/sauna.yaml: In lambda function:
      /opt/iobroker/iobroker-data/esphome.0/sauna.yaml:204:32: error: could not convert '{my_global_float}' from '<brace-enclosed initializer list>' to 'esphome::optional<float>'
        204 |     lambda: 'return {(my_global_float)};'
            |                                ^
            |                                |
            |                                <brace-enclosed initializer list>
      *** [.pioenvs/sauna/src/main.cpp.o] Error 1
      

      Was für einen Typecast muss ich hier vornehmen?

      1 Reply Last reply Reply Quote 0
      • First post
        Last post

      Support us

      ioBroker
      Community Adapters
      Donate
      FAQ Cloud / IOT
      HowTo: Node.js-Update
      HowTo: Backup/Restore
      Downloads
      BLOG

      880
      Online

      32.0k
      Users

      80.5k
      Topics

      1.3m
      Posts

      1
      1
      389
      Loading More Posts
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      Community
      Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
      The ioBroker Community 2014-2023
      logo