=== Universal Control for TaHoma ===
Contributors:      globus2008
Tags:              smart-home, somfy, tahoma, overkiz, automation
Requires at least: 5.8
Tested up to:      6.9
Requires PHP:      7.4
Stable tag:        1.0.4
License:           GPL-3.0-or-later
License URI:       http://www.gnu.org/licenses/gpl-3.0.txt

Universal Gutenberg block to control Somfy TaHoma devices worldwide via Cloud API.

== Description ==

Universal Control for TaHoma is a powerful and lightweight WordPress plugin that allows you to integrate your Somfy TaHoma smart home directly into your website. Using the official Overkiz (Somfy) Cloud API, this block provides a seamless way to control lights, plugs, shutters, and gates.

**Key Features:**

* **Global Settings:** Enter your credentials once in the WordPress Settings and use them across all blocks.
* **Smart Status Tracking:** Real-time device status (On/Off, Position %) displayed directly on the button.
* **Smart Toggle Mode:** Intelligent switching that knows whether to send "Open" or "Close" based on current state.
* **Performance First:** Built-in session caching (Transient API) to prevent rate-limiting and IP bans from Somfy servers.
* **Multi-server Support:** Works with standard TaHomalink and European Overkiz HA1 servers.
* **Privacy & Security:** Communication is handled server-side. Your credentials are never exposed to the frontend.

== Installation ==

1. Upload the plugin folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Go to **Settings > TaHoma Control** and enter your Somfy credentials.
4. Add the **Universal Control for TaHoma** block to any page or post using the Gutenberg editor.

== External services ==

This plugin connects to the Somfy TaHoma / Overkiz Cloud API to control smart home devices. 

* **Service:** Somfy TaHoma Cloud (Overkiz API)
* **Usage:** Used to authenticate the user, list available devices, and send execution commands (e.g., open/close shutters).
* **Data sent:** User login credentials (email and password), server preference, and device identifiers (URLs). Credentials are sent encrypted via HTTPS.
* **Privacy and Terms:**
    * Somfy Privacy Policy: https://www.somfy.com/en-en/privacy-policy
    * Somfy Terms and Conditions: https://www.somfypro.co.uk/general-conditions-of-sale

== Source Code & Build Instructions ==

The human-readable source code for this plugin is included in the `src/` directory. To build the plugin from source:
1. Install Node.js and npm.
2. Run `npm install` in the plugin directory.
3. Run `npm run build` to generate the production files in the `build/` directory.

== Frequently Asked Questions ==

= Why does my device not appear in the list? =
Ensure your device is supported. The plugin currently supports On/Off Plugs, Lights, Roller Shutters, Venetian Blinds, Gates, and Garage Doors.

= I see "Session expired" or "Error" on the button. =
Check your credentials in the Global Settings. If you have too many blocks polling at once, Somfy might temporarily rate-limit your requests. The plugin uses caching to minimize this risk.

== Screenshots ==

1. Global Settings page in the WordPress admin.
2. The TaHoma block in the Gutenberg editor with device selection.
3. Live button on the frontend showing a Light status.

== Changelog ==

= 1.0.4 =
* New plugin name and slug

= 1.0.3 =
* Non-compiled version included in src folder
* Use of wp_enqueue commands
* Documented use of an external service in readme file

= 1.0.2 =
* Direct access protection.

= 1.0.1 =
* Screens inserted.

= 1.0.0 =
* Initial release.