Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Error/Bug
    4. Inkonsistenz in adapter.js

    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

    Inkonsistenz in adapter.js

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

      Mir ist da gerade was aufgefallen in adapter.js:

      1. Funktion createDevice (Zeile 1643ff.): Das Objekt wird angelegt mit "setObjectNotExists", d.h. nur wenn es nicht existiert.

      2. Funktion createChannel (Zeile 1674ff.): Das Objekt wird angelegt mit "setObject", d.h. wird überschrieben wenn es existiert.

      3. Funktion createState (Zeile 1643ff.): Das zum State gehörende Objekt wird angelegt mit "setObjectNotExists", d.h. nur wenn es nicht existiert.

      Ich gehe davon aus, dass das Verhalten in createChannel nicht absichtlich anders ist.

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

        Nochwas:

        Zeile 2186ff, die Reihenfolge der Parameter ist anders als überall sonst:

                that.getDevices = function getDevices(callback, options) {
                    if (typeof options === 'function') {
                        callback = options;
                        options = null;
                    }
        
        

        zum Vergleich:

                that.getChannelsOf = function getChannelsOf(parentDevice, options, callback) {
                    if (typeof options === 'function') {
                        callback = options;
                        options = null;
                    }
        
        
        1 Reply Last reply Reply Quote 0
        • Bluefox
          Bluefox last edited by

          @AlCalzone:

          Nochwas:

          Zeile 2186ff, die Reihenfolge der Parameter ist anders als überall sonst:

                  that.getDevices = function getDevices(callback, options) {
                      if (typeof options === 'function') {
                          callback = options;
                          options = null;
                      }
          
          

          zum Vergleich:

                  that.getChannelsOf = function getChannelsOf(parentDevice, options, callback) {
                      if (typeof options === 'function') {
                          callback = options;
                          options = null;
                      }
          
          ```` `  
          

          Sehr gute Anmerkungen. Ist gemacht:

          https://github.com/ioBroker/ioBroker.js … c7f2d2e9c5

          1 Reply Last reply Reply Quote 0
          • apollon77
            apollon77 last edited by

            Hey,

            die eine Änderung macht sinn, die andere mit der Parameterreihenfolge ist aber inkompatibel!!

            Man muss jetzt mindestens im Code checken und ggf drehen!

            Ingo

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

              Da hast du Recht, aber aktuell macht die Abfrage auf den optionalen Parameter wenig Sinn, wenn der eh hinten kommt.

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

              Support us

              ioBroker
              Community Adapters
              Donate

              933
              Online

              31.8k
              Users

              80.0k
              Topics

              1.3m
              Posts

              3
              5
              832
              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