thernst-de / smarthome.plugin.autoblind

Finite state machine plugin for smarthomeNG (finite state machine)
6 stars 2 forks source link

Make plugin compatible with smarthomeNG 1.4 #18

Closed onkelandy closed 6 years ago

onkelandy commented 6 years ago
gamade commented 6 years ago

+1 manual suspend function does not work in current shng develop branch.

thernst-de commented 6 years ago

I'll have a look at the issues, however it may take until February before I have time to do so.

gamade commented 6 years ago

FYI: I changed some lines in AutoBlindCliCommands.py to get the cli commands registered:

Include: from lib.plugin import Plugins

new Syntax for add_command (needs bugfix in cli plugin as well):

                cli.add_command("as_list", self.cli_list, "autoblind", "as_list: list AutoState items")
                cli.add_command("as_detail", self.cli_detail, "autoblind", "as_detail [asItem]: show details on AutoState item [asItem]")
    def _get_cli_plugin(self):
        # noinspection PyBroadException
        plugins = Plugins.get_instance()
        try:
            for plugin in plugins.return_plugins():
                if plugin._shortname == 'cli':
                    self.logger.debug("cli plugin found.")
                    return plugin
        except Exception:
            self.logger.info("cli plugin NOT found.")
            return None
gamade commented 6 years ago

Bugfix für plugins/cli/init.py (group param added)

def add_command(self, command, function, group, usage):
    """
    Add command to list of available commands
    :param command: Command to add
    :param function: Function to execute for command
    :param usage: Usage string for help-command
    """
    self.commands.add_command(command, function, group, usage)
onkelandy commented 6 years ago

Thanks for the update. Autoblind is running without any error now but I can't use the CLI commands.. Says "unknown command"?

thernst-de commented 6 years ago

A new branch "Version 1.4.0" is available which contains the adaptions. All adaptions are made based on the rc_v1.4.2-branch of SmarthomeNG

onkelandy commented 6 years ago

Looks very good, thanks alot!! Any chance that you look into the other issues and/or ideas soon?

gamade commented 6 years ago

Had an error:

2018-02-03 09:25:41 WARNING EG.entrance.window.shutter.auto.manuell Item EG.entrance.window.shutter.auto.manuell: problem evaluating sh.autoblind_plugin_functions.manual_item_update_eval('EG.entrance.window.shutter.auto.manuell', caller, source): 'SmartHome' object has no attribute 'autoblind_plugin_functions'

With removing an indent in init.py line 61: self.get_sh().autoblind_plugin_functions = AutoBlindFunctions.AbFunctions(self.get_sh()) fixed that error.

thernst-de commented 6 years ago

For the 1.4-branch, i have removed several functions, which have been marked as obsolete in the past