Skip to content

v2.0.0

Choose a tag to compare

@hnw hnw released this 26 Aug 03:12
· 16 commits to main since this release

Release Notes: Version 2.0.0 - The Automation & Deployment Overhaul

This is a landmark release for switchbot-actions, elevating it from a simple utility to a robust, reliable, and more powerful automation engine. Version 2.0.0 introduces official multi-architecture Docker support, completely revamps the automation trigger system for simplicity and power, and significantly improves the developer and command-line experience.

This update includes major breaking changes aimed at improving configuration clarity, security, and future extensibility. Please review the "Breaking Changes" section carefully before upgrading.


⚠️ Breaking Changes

To enhance usability and consistency, several configuration keys and structures have been changed.

1. Unified Timer Trigger Configuration

The biggest change is the simplification of time-based triggers. The separate switchbot_timer and mqtt_timer sources have been removed. To create a time-based rule, you now simply add a duration key to a standard switchbot or mqtt source.

Before:

if:
  source: "switchbot_timer"
  duration: "5m"
  conditions:
    motion_detected: false

After (v2.0.0):

if:
  source: "switchbot"
  duration: "5m"
  conditions:
    motion_detected: false

2. Secure shell_command Syntax

For improved security against command injection, the shell_command action now requires the command and its arguments to be specified as a list of strings instead of a single string.

Before:

then:
  type: "shell_command"
  command: "echo 'Button pressed'"

After (v2.0.0):

then:
  type: "shell_command"
  command: ["echo", "Button pressed"]

3. Simplified Scanner Configuration

The scanner configuration has been made more intuitive. The cycle key has been removed and replaced with wait. You now define how long to scan (duration) and how long to wait between scans (wait).

Before:

scanner:
  cycle: 10
  duration: 3

After (v2.0.0):

scanner:
  duration: 3
  wait: 7 # The idle time between scans

4. Renamed prometheus_exporter Key

The top-level configuration key prometheus_exporter has been renamed to prometheus for brevity.

Before:

prometheus_exporter:
  enabled: true

After (v.2.0.0):

prometheus:
  enabled: true

🎉 New Features

1. Official Multi-Arch Docker Support

You can now run switchbot-actions effortlessly using our new official Docker images, available on GitHub Container Registry (ghcr.io/hnw/switchbot-actions). We provide support for a wide range of architectures, including:

  • linux/amd64
  • linux/arm64
  • linux/arm/v7
  • linux/arm/v6 (ideal for Raspberry Pi Zero)

This makes deployment easier than ever. See the updated Deployment Guide for detailed instructions.


🚀 Enhancements

1. Powerful and Intuitive CLI

The command-line interface has been completely overhauled for a better user experience:

  • Grouped Help: Options are now grouped by function (General, Scanner, Prometheus, MQTT) for clarity. Run switchbot-actions --help to see the new layout.
  • Boolean Flags: Easily enable or disable components with flags like --scanner / --no-scanner and --mqtt / --no-mqtt.
  • Granular Verbosity: The --verbose (-v) flag now has multiple levels:
    • -v: Enables DEBUG logging for the automation engine.
    • -vv: Enables DEBUG logging for the entire application.
    • -vvv: Enables DEBUG logging for all libraries, including bleak.

2. Improved Reliability with End-to-End Testing

We've introduced a comprehensive suite of end-to-end tests that validate core automation pathways in our CI pipeline. This ensures that key integrations, like triggering a webhook from an MQTT message, are continuously tested, leading to a more stable and reliable application.

3. Modernized Project Tooling

The project's backend has been modernized for better maintainability and robustness:

  • Poetry Migration: We now use Poetry for dependency management, ensuring reproducible builds.

Full Changelog: v1.5.0...v2.0.0