Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smartplugin: add pause_item (instead of suspend item) #657

Merged
merged 7 commits into from
Jul 3, 2024

Conversation

Morg42
Copy link
Member

@Morg42 Morg42 commented Jun 25, 2024

This item more or less replaces the suspend_item, but it hard-stops and re-runs the plugin instead of trying to suspend it while being active.

Modified and adjusten SmartPlugin and MqttPlugin as well as both sample plugins and their plugin.yaml files.

Works with adjusted zigbee2mqtt Plugin; plugin wishing to implement this need to

  • be restartable (though metadata restartable is not queried)
  • implement code snippets in init, run, stop, parse_item, update_item (see sample plugins)

Also cleaned up SmartPlugin, commented the reason for using class members and added some type hinting.

As far as I can see, the changes should be non-breaking.

@Morg42 Morg42 requested review from msinn and onkelandy June 25, 2024 13:20
@Morg42 Morg42 self-assigned this Jun 25, 2024
dev/sample_mqttplugin/__init__.py Outdated Show resolved Hide resolved
dev/sample_mqttplugin/__init__.py Show resolved Hide resolved
dev/sample_mqttplugin/__init__.py Show resolved Hide resolved
dev/sample_mqttplugin/__init__.py Show resolved Hide resolved
lib/model/smartplugin.py Show resolved Hide resolved
@Morg42
Copy link
Member Author

Morg42 commented Jul 3, 2024

On merging, also merge smarthomeNG/plugins#945 to mitigate breaking changes to plugins using the old suspend_item mechanics.

@onkelandy onkelandy merged commit 65903b9 into smarthomeNG:develop Jul 3, 2024
5 checks passed
@Morg42 Morg42 deleted the smartplugin-1 branch July 3, 2024 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants