Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Entwicklung
    4. im Adapter (nicht JS) einen Teilbaum löschen

    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

    im Adapter (nicht JS) einen Teilbaum löschen

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

      Hallo Community,

      wie kann ich in meinem Adapter (nicht JS) einen Teilbaum löschen? Also lösche alle Channels und States unter dem Knoten Adapter.0.Ebene1.*

      Mit

      let states = await this.getStatesAsync('Ebene1.*');
      for (const idS in states) {
      this.delObjectAsync(idS);
      }
      erwische ich zwar alle States, die Channel bleiben aber übrig.
      Danke für euren Support!

      UncleSam 1 Reply Last reply Reply Quote 0
      • UncleSam
        UncleSam Developer @HGlab last edited by

        @hglab Gibt es nicht ein getObjectsAsync()?

        H 1 Reply Last reply Reply Quote 0
        • H
          HGlab @UncleSam last edited by HGlab

          @unclesam said in im Adapter (nicht JS) einen Teilbaum löschen:

          getObjectsAsync

          Ah! Es gibt getAdapterObjectsAsync. Muss ich mich mal reinlesen wie das funktioniert...

          1 Reply Last reply Reply Quote 0
          • H
            HGlab last edited by

            ich hab es jetzt wie folgt gelöst (der Ausgangspunkt ist das Device "DIE")

            this.deleteDeviceAsync('DIE');
            let states = await this.getStatesAsync('*.DIE.*');  //device and channels werden gelöscht
            for (const idS in states) {                         //und nun noch alle States löschen
               this.delObjectAsync(idS);
            }
            
            1 Reply Last reply Reply Quote 0
            • First post
              Last post

            Support us

            ioBroker
            Community Adapters
            Donate

            650
            Online

            31.9k
            Users

            80.2k
            Topics

            1.3m
            Posts

            2
            4
            196
            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