Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. getState - warning log / JS Dokumentation

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    getState - warning log / JS Dokumentation

    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      ticaki Developer last edited by

      Da muß ich passen, bei mir geht es in jedem von mir getesteten Zweig mit diesen beiden und zeigt auch den richtigen Inhalt an. Ist es möglich das die States garnicht existieren? Hast du unmittelbar um den Test herum ein Reload des Objekttab gemacht?

      S 1 Reply Last reply Reply Quote 0
      • C
        CruziX last edited by CruziX

        Das sollte glaube auch so gehen

        let exists = $(idVomDp);
        

        Müsste dann false sein, wenn er nicht vorhanden ist.
        bzw. prüfe ich dann immer
        if(!exists) {}

        1 Reply Last reply Reply Quote 0
        • AlCalzone
          AlCalzone Developer last edited by

          Hallo zusammen, nehmt doch einfach existsState(id) 🙂

          C S T 3 Replies Last reply Reply Quote 3
          • C
            CruziX @AlCalzone last edited by

            @AlCalzone sagte in getState - warning log / JS Dokumentation:

            existsState

            Die Funktion gibt es?
            Ist gar nicht in der Doku beschrieben

            AlCalzone 1 Reply Last reply Reply Quote 0
            • AlCalzone
              AlCalzone Developer @CruziX last edited by

              @CruziX Ja gibt es. Sollte eigentlich auch im Dropdown für autocomplete auftauchen:

              	/**
              	 * Checks if the state with the given ID exists
              	 */
              	function existsState(id: string): boolean;
              	/**
              	 * Checks if the object with the given ID exists
              	 */
              	function existsObject(id: string): boolean;
              

              Wenn sie nicht in der Doku steht, ist natürlich doof.

              C 1 Reply Last reply Reply Quote 0
              • C
                CruziX @AlCalzone last edited by

                @AlCalzone Das ist natürlich praktisch ^^
                Wo kann man denn die Funktionen im Code direkt ansehen?

                AlCalzone 1 Reply Last reply Reply Quote 0
                • AlCalzone
                  AlCalzone Developer @CruziX last edited by

                  @CruziX Diese Datei enthält die Definitionen für Auto-Complete und Syntax-Check:
                  https://github.com/ioBroker/ioBroker.javascript/blob/master/lib/javascript.d.ts
                  Interessant wird es ab https://github.com/ioBroker/ioBroker.javascript/blob/5055cc9cb5e017c37eb9a64f0084e2a76fba26f2/lib/javascript.d.ts#L537

                  Die Funktionen selbst kannst du dir hier anschauen (sandbox-Objekt):
                  https://github.com/ioBroker/ioBroker.javascript/blob/5055cc9cb5e017c37eb9a64f0084e2a76fba26f2/lib/sandbox.js#L452

                  1 Reply Last reply Reply Quote 1
                  • S
                    SaschaS @ticaki last edited by

                    @ticaki Der Cache des Browers hat mich in die Irre geführt.

                    1 Reply Last reply Reply Quote 0
                    • S
                      SaschaS @AlCalzone last edited by

                      @AlCalzone said in getState - warning log / JS Dokumentation:

                      Hallo zusammen, nehmt doch einfach existsState(id) 🙂

                      Die macht das Leben so viel einfacher. Die kannte ich in der Tat noch nicht..Genial 🙂

                      1 Reply Last reply Reply Quote 0
                      • T
                        ticaki Developer @AlCalzone last edited by

                        @AlCalzone
                        Danke

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

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        747
                        Online

                        31.8k
                        Users

                        80.0k
                        Topics

                        1.3m
                        Posts

                        5
                        17
                        1579
                        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