Ankündigung

Einklappen

Serverwartung 21.2.



Am 21.2. im Laufe des späten Abends wird eine Serverwartung durchgeführt. Das Forum ist dadurch für gut zwei Stunden nicht erreichbar.
Es wird eine Wartungsseite geschaltet.

Mehr anzeigen
Weniger anzeigen

alexa4p3: Plugin Definition ohne class_name und class_path

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    alexa4p3: Plugin Definition ohne class_name und class_path

    Hallo,

    Wenn ich das Alexa Plugin in der plugin.yaml wie folg definiere:
    Code:
    alexa4p3:
      service_port: 9001
      plugin_name: alexa4p3
    bekomme ich beim starten:
    Code:
    2019-11-23 20:21:09 INFO lib.shyaml Loading '/home/smarthome/smarthome_1.6.1/plugins/alexa4p3/plugin.yaml' to 'OrderedDict'
    2019-11-23 20:21:09 INFO lib.metadata plugin 'alexa4p3': Metadata paramlist = '['service_port']'
    2019-11-23 20:21:09 INFO lib.metadata plugin 'alexa4p3': Metadata itemdeflist = '['alexa_name', 'alexa_description', 'alexa_device', 'alexa_icon', 'alexa_actions', 'alexa_retrievable', 'alexa_proactivelyReported', 'alexa_types', 'alexa_item_range', 'alexa_item_turn_on', 'alexa_color_value_type', 'alexa_thermo_config', 'alexa[I]stream[/I](1)1(2)(3)', 'alexa_csc_uri', 'alexa_auth_cred', 'alexa_camera_imageUri']'
    2019-11-23 20:21:09 ERROR lib.plugin Plugin 'alexa4p3' exception during execution of plugin: module 'plugins.alexa4p3' has no attribute 'alexap3'
    Traceback (most recent call last):
    File "/home/smarthome/smarthome_1.6.1/lib/plugin.py", line 553, in [B]init[/B]
    exec("self.plugin = {0}.{1}.[B]new[/B]({0}.{1})".format(classpath, classname))
    File "<string>", line 1, in <module>
    AttributeError: module 'plugins.alexa4p3' has no attribute 'alexap3'
    2019-11-23 20:21:09 INFO lib.shyaml Loading '/home/smarthome/smarthome_1.6.1/plugins/alexa4p3/locale.yaml' to 'dict'
    2019-11-23 20:21:09 ERROR lib.plugin Plugin 'alexa4p3' from section 'alexa4p3' exception: 'PluginWrapper' object has no attribute 'plugin'
    Traceback (most recent call last):
    File "/home/smarthome/smarthome_1.6.1/lib/plugin.py", line 145, in [B]init[/B]
    plugin_thread = PluginWrapper(smarthome, plugin, classname, classpath, args, instance, self.meta, self._gtrans)
    File "/home/smarthome/smarthome_1.6.1/lib/plugin.py", line 571, in [B]init[/B]
    if isinstance(self.get_implementation(), SmartPlugin):
    File "/home/smarthome/smarthome_1.6.1/lib/plugin.py", line 715, in get_implementation
    return self.plugin
    AttributeError: 'PluginWrapper' object has no attribute 'plugin'
    2019-11-23 20:21:09 INFO lib.plugin Load of plugins finished

    Mit class_name und class_path funktioniert es:

    Code:
    alexa4p3:
      class_name: Alexa4P3
      class_path: plugins.alexa4p3
      service_port: 9001
      plugin_name: alexa4p3
    Mache ich was falsch oder gibt es da einen Bug im Alexa Plugin?

    LG

    mode

    PS: SmarthomeNG und plugins sind auf dem aktuellen MASTER Branch...
    Zuletzt geändert von mode; 23.11.2019, 21:26.

    #2
    Da ist ein Fehler im Plugin. In den Metadaten (plugin.yaml des Plugins) steht:
    Code:
    # Metadata for the Smart-Plugin
    plugin:
        # Global plugin attributes
        type: web                       # plugin type (gateway, interface, protocol, system, web)
    
        ...
    
        classname: alexa4p3    # class containing the plugin
    
        ...
    Der classname ist aber Case-Sensitiv. Das muss
    Code:
         classname: Alexa4P3   # class containing the plugin [FONT=Arial][/FONT]
    heissen.
    Viele Grüße
    Martin

    There is no cloud. It's only someone else's computer.

    Kommentar


      #3
      habs mal gefixt in den dev gepusht..

      Kommentar

      Lädt...
      X