Skip to content
  • Home
  • Aktuell
  • Tags
  • 0 Ungelesen 0
  • Kategorien
  • Unreplied
  • Beliebt
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Standard: (Kein Skin)
  • Kein Skin
Einklappen
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Entwicklung
  4. Adapterentwicklung/Funktion wird nicht ausgeführt

NEWS

  • Jahresrückblick 2025 – unser neuer Blogbeitrag ist online! ✨
    BluefoxB
    Bluefox
    17
    1
    3.1k

  • Neuer Blogbeitrag: Monatsrückblick - Dezember 2025 🎄
    BluefoxB
    Bluefox
    13
    1
    1.1k

  • Weihnachtsangebot 2025! 🎄
    BluefoxB
    Bluefox
    25
    1
    2.4k

Adapterentwicklung/Funktion wird nicht ausgeführt

Geplant Angeheftet Gesperrt Verschoben Entwicklung
5 Beiträge 4 Kommentatoren 465 Aufrufe 4 Watching
  • Älteste zuerst
  • Neuste zuerst
  • Meiste Stimmen
Antworten
  • In einem neuen Thema antworten
Anmelden zum Antworten
Dieses Thema wurde gelöscht. Nur Nutzer mit entsprechenden Rechten können es sehen.
  • N Offline
    N Offline
    NemoN
    schrieb am zuletzt editiert von
    #1

    Moin zusammen,

    ich bin gerade dabei mich in die Adapter-Entwicklung einzuarbeiten. Ich starte mit einem ganz einfachen "scheduled" Test-Adapter. Soweit so gut. Leider wird meine Funktion queryHomeServer() nicht ausgeführt. Habe ich da ein Denk-Fehler??

    home.0	2019-06-19 23:40:00.310	info	config password: test1234
    home.0	2019-06-19 23:40:00.310	info	config email: 123@test.com
    home.0	2019-06-19 23:40:00.302	info	starting. Version 0.0.1 in /opt/iobroker/node_modules/iobroker.home, node: v8.16.0
    home.0	2019-06-19 23:40:00.206	debug	statesDB connected
    home.0	2019-06-19 23:40:00.193	debug	objectDB connected
    host.iobrokerdev	2019-06-19 23:40:00.011	info	instance system.adapter.home.0 started with pid 30801
    

    Eigentlich sollte doch dann noch "entering queryHomeServer" ausgegeben werden und der Adapter beendet werden. Passiert aber nicht. Der Adapter bleibt im Speicher. Auch

    this.log.debug("should never should reach this point. Exiting!")
    this.stop(); // stop adapter right here (on schedule mode)
    

    wird nicht erreicht :white_frowning_face:

    "use strict";
    
    /*
     * Created with @iobroker/create-adapter v1.15.1
     */
    
    // The adapter-core module gives you access to the core ioBroker functions
    // you need to create an adapter
    const utils = require("@iobroker/adapter-core");
    
    class Home extends utils.Adapter {
    
    	/**
    	 * @param {Partial<ioBroker.AdapterOptions>} [options={}]
    	 */
    	constructor(options) {
    		super({
    			...options,
    			name: "home",
    		});
    
    		this.on("ready", this.onReady.bind(this));
    		this.on("unload", this.onUnload.bind(this));
    	}
    
    	/**
    	 * Is called when databases are connected and adapter received configuration.
    	 */
    	async onReady() {
    		// Initialize your adapter here
    
    		// The adapters config (in the instance object everything under the attribute "native") is accessible via
    		// this.config:
    		this.log.info("config email: " + this.config.email);
    		this.log.info("config password: " + this.config.password);
    
    		if (!this.config.email) {
    			this.log.warn("email is empty. Exiting!");
    			this.stop();
    		} else if (!this.config.password) {
    			this.log.warn("password empty. Exiting!");
    			this.stop();
    		}
    
    		queryHomeServer();
    
    		this.log.debug("should never should reach this point. Exiting!")
    		this.stop(); // stop adapter right here (on schedule mode)
    	}
    	
    	/**
    	 * Is called when adapter shuts down - callback has to be called under any circumstances!
    	 * @param {() => void} callback
    	 */
    	onUnload(callback) {
    		try {
    			this.log.info("cleaned everything up...");
    			callback();
    		} catch (e) {
    			callback();
    		}
    	}
    	
    	/**
    	 * queryHomeServer
    	 */
    	queryHomeServer() {
    		 this.log.debug("entering queryHomeServer");
    
    		 this.stop(); // stop adapter right here (on shedule mode)
    	}
    }
    
    // @ts-ignore parent is a valid property on module
    if (module.parent) {
    	// Export the constructor in compact mode
    	/**
    	 * @param {Partial<ioBroker.AdapterOptions>} [options={}]
    	 */
    	module.exports = (options) => new Home(options);
    } else {
    	// otherwise start the instance directly
    	new Home();
    }
    
    
    AlCalzoneA 1 Antwort Letzte Antwort
    0
    • arteckA Offline
      arteckA Offline
      arteck
      Developer Most Active
      schrieb am zuletzt editiert von
      #2

      setzte die klammer aus Zeile 72 auf Zeile 63..

      zigbee hab ich, zwave auch, nuc's genauso und HA auch

      1 Antwort Letzte Antwort
      0
      • N Offline
        N Offline
        NemoN
        schrieb am zuletzt editiert von
        #3

        Danke für die schnelle Hilfe. Klappt. Gut zu wissen das die Funktionen außerhalb der "class" definiert werden müssen. Ich hatte mich an den onUnload / onReady Methoden orientiert...

        Jey CeeJ 1 Antwort Letzte Antwort
        0
        • N NemoN

          Danke für die schnelle Hilfe. Klappt. Gut zu wissen das die Funktionen außerhalb der "class" definiert werden müssen. Ich hatte mich an den onUnload / onReady Methoden orientiert...

          Jey CeeJ Online
          Jey CeeJ Online
          Jey Cee
          Developer
          schrieb am zuletzt editiert von
          #4

          @NemoN sagte in Adapterentwicklung/Funktion wird nicht ausgeführt:

          Gut zu wissen das die Funktionen außerhalb der "class" definiert werden müssen.

          Nein müssen sie nicht, es geht auch innerhalb der Class.

          this.queryHomeServer()
          

          Persönlicher Support
          Spenden -> paypal.me/J3YC33

          1 Antwort Letzte Antwort
          1
          • N NemoN

            Moin zusammen,

            ich bin gerade dabei mich in die Adapter-Entwicklung einzuarbeiten. Ich starte mit einem ganz einfachen "scheduled" Test-Adapter. Soweit so gut. Leider wird meine Funktion queryHomeServer() nicht ausgeführt. Habe ich da ein Denk-Fehler??

            home.0	2019-06-19 23:40:00.310	info	config password: test1234
            home.0	2019-06-19 23:40:00.310	info	config email: 123@test.com
            home.0	2019-06-19 23:40:00.302	info	starting. Version 0.0.1 in /opt/iobroker/node_modules/iobroker.home, node: v8.16.0
            home.0	2019-06-19 23:40:00.206	debug	statesDB connected
            home.0	2019-06-19 23:40:00.193	debug	objectDB connected
            host.iobrokerdev	2019-06-19 23:40:00.011	info	instance system.adapter.home.0 started with pid 30801
            

            Eigentlich sollte doch dann noch "entering queryHomeServer" ausgegeben werden und der Adapter beendet werden. Passiert aber nicht. Der Adapter bleibt im Speicher. Auch

            this.log.debug("should never should reach this point. Exiting!")
            this.stop(); // stop adapter right here (on schedule mode)
            

            wird nicht erreicht :white_frowning_face:

            "use strict";
            
            /*
             * Created with @iobroker/create-adapter v1.15.1
             */
            
            // The adapter-core module gives you access to the core ioBroker functions
            // you need to create an adapter
            const utils = require("@iobroker/adapter-core");
            
            class Home extends utils.Adapter {
            
            	/**
            	 * @param {Partial<ioBroker.AdapterOptions>} [options={}]
            	 */
            	constructor(options) {
            		super({
            			...options,
            			name: "home",
            		});
            
            		this.on("ready", this.onReady.bind(this));
            		this.on("unload", this.onUnload.bind(this));
            	}
            
            	/**
            	 * Is called when databases are connected and adapter received configuration.
            	 */
            	async onReady() {
            		// Initialize your adapter here
            
            		// The adapters config (in the instance object everything under the attribute "native") is accessible via
            		// this.config:
            		this.log.info("config email: " + this.config.email);
            		this.log.info("config password: " + this.config.password);
            
            		if (!this.config.email) {
            			this.log.warn("email is empty. Exiting!");
            			this.stop();
            		} else if (!this.config.password) {
            			this.log.warn("password empty. Exiting!");
            			this.stop();
            		}
            
            		queryHomeServer();
            
            		this.log.debug("should never should reach this point. Exiting!")
            		this.stop(); // stop adapter right here (on schedule mode)
            	}
            	
            	/**
            	 * Is called when adapter shuts down - callback has to be called under any circumstances!
            	 * @param {() => void} callback
            	 */
            	onUnload(callback) {
            		try {
            			this.log.info("cleaned everything up...");
            			callback();
            		} catch (e) {
            			callback();
            		}
            	}
            	
            	/**
            	 * queryHomeServer
            	 */
            	queryHomeServer() {
            		 this.log.debug("entering queryHomeServer");
            
            		 this.stop(); // stop adapter right here (on shedule mode)
            	}
            }
            
            // @ts-ignore parent is a valid property on module
            if (module.parent) {
            	// Export the constructor in compact mode
            	/**
            	 * @param {Partial<ioBroker.AdapterOptions>} [options={}]
            	 */
            	module.exports = (options) => new Home(options);
            } else {
            	// otherwise start the instance directly
            	new Home();
            }
            
            
            AlCalzoneA Offline
            AlCalzoneA Offline
            AlCalzone
            Developer
            schrieb am zuletzt editiert von
            #5

            @NemoN queryHomeServer ist eine Instanz-Methode und muss daher wie log und stop mit this. aufgerufen werden.

            Warum `sudo` böse ist: https://forum.iobroker.net/post/17109

            1 Antwort Letzte Antwort
            0
            Antworten
            • In einem neuen Thema antworten
            Anmelden zum Antworten
            • Älteste zuerst
            • Neuste zuerst
            • Meiste Stimmen


            Support us

            ioBroker
            Community Adapters
            Donate

            671

            Online

            32.6k

            Benutzer

            82.3k

            Themen

            1.3m

            Beiträge
            Community
            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen | Einwilligungseinstellungen
            ioBroker Community 2014-2025
            logo
            • Anmelden

            • Du hast noch kein Konto? Registrieren

            • Anmelden oder registrieren, um zu suchen
            • Erster Beitrag
              Letzter Beitrag
            0
            • Home
            • Aktuell
            • Tags
            • Ungelesen 0
            • Kategorien
            • Unreplied
            • Beliebt
            • GitHub
            • Docu
            • Hilfe