From d7ce9113bc761c36a6aaff0c3fe5bf793b1321ff Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 20 Aug 2023 23:14:08 +0200 Subject: [PATCH] Updated old Gitlab links and examples --- www/index.html | 43 +++++++++++++++++++------------------------ 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/www/index.html b/www/index.html index 4f41e1c..8ad71e3 100644 --- a/www/index.html +++ b/www/index.html @@ -91,8 +91,8 @@ create automation routines when a certain event happens, programmatically action them in your scripts, or control them all from a single consistent web interface. Discover the available integrations. - The README - is also a good place to get started. + The README is also a good place to get started. @@ -112,7 +112,7 @@

Extensions may come with optional sets of additional dependencies, and they can be easily installed through pip - see the setup.py for a full list of supported extras. The documentation also provided the required dependencies for each integration. @@ -120,24 +120,19 @@

-
pip install 'platypush[http,mqtt]'
+
pip install 'platypush[mqtt]'
-
# Enable the Z-Wave monitor -backend.zwave: - - device: /dev/ttyUSB0 - -# Enable the Z-Wave actions plugin -zwave: - - enabled: True +
# Enable the Zigbee2MQTT integration +zigbee.mqtt: + - host: 192.168.1.2 # Enable the Philips Hue plugin light.hue: - # Enable the Hue lights plugin - - enabled: True + - bridge: 192.168.1.3
@@ -149,7 +144,7 @@ Configuring an integration is as simple as defining its attributes in ~/.config/platypush/config.yaml. The attributes of each integration are the same as their documented constructors, and an - example configuration + example configuration is also provided.
@@ -173,17 +168,17 @@
from platypush.event.hook import hook from platypush.utils import run -from platypush.message.event.zwave ZwaveValueChangedEvent +from platypush.message.event.zigbee.mqtt import ZigbeeMqttDevicePropertySetEvent -@hook(ZwaveValueChangedEvent) -def on_zwave_value(event, **context): - if event.value['label'] == 'Motion Sensor': - # Turn on the lights when motion is detected - if event.value['data'] is True: - run('light.hue.on') - # Turn off the lights when motion is not detected - elif event.value['data'] is False: - run('light.hue.off') +@hook(ZigbeeMqttDevicePropertySetEvent, device='My motion sensor') +def on_sensor_value_change(event, **ctx): + has_motion = event.args.get('properties', {}).get('motion') + # Turn on the lights when motion is detected + if has_motion is True: + run('light.hue.on') + # Turn off the lights when motion is not detected + elif has_motion is False: + run('light.hue.off')