From a67c6078c505078252beb0fd4bbfa419a54c543c Mon Sep 17 00:00:00 2001 From: Martin Bauer Date: Sun, 2 Oct 2022 12:40:42 +0200 Subject: [PATCH] Local modification --- espmusicmouse/.vscode/settings.json | 12 +++++++++++- espmusicmouse/host_driver/main.py | 12 +++++++----- espmusicmouse/host_driver/mqtt_json.py | 6 ++++-- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/espmusicmouse/.vscode/settings.json b/espmusicmouse/.vscode/settings.json index ce5562c..a49f994 100644 --- a/espmusicmouse/.vscode/settings.json +++ b/espmusicmouse/.vscode/settings.json @@ -43,5 +43,15 @@ "cinttypes": "cpp", "utility": "cpp", "typeinfo": "cpp" - } + }, + "vsmqtt.brokerProfiles": [ + { + "name": "homeassistant", + "host": "homeassistant", + "port": 1883, + "username": "musicmouse", + "clientId": "vsmqtt_client", + "password": "KNLEFLZF94yA6Zhj141", + } + ] } \ No newline at end of file diff --git a/espmusicmouse/host_driver/main.py b/espmusicmouse/host_driver/main.py index fe66eca..2b7eadb 100755 --- a/espmusicmouse/host_driver/main.py +++ b/espmusicmouse/host_driver/main.py @@ -69,6 +69,7 @@ class MusicMouseState: def led_ring_effect(self, effect_cfg): self.current_led_ring_effect = effect_cfg self.protocol.led_ring_effect(effect_cfg) + self.protocol.shelve_led_effect(effect_cfg) def button_leds(self, brightness): assert 0 <= brightness <= 1 @@ -191,11 +192,12 @@ class Controller: 'rgb_color': [255, 74, 254] }, } - hass_service(self.hass, - "light", - "turn_on", - entity_id="light.kinderzimmer_fluter", - **colors[message.touch_button]) + hass_service( + self.hass, + "light", + "turn_on", + entity_id=["light.kinderzimmer_fluter", "light.music_mouse_regal_licht"], + **colors[message.touch_button]) elif isinstance(message, TouchButtonRelease): figure = self.mmstate.active_figure diff --git a/espmusicmouse/host_driver/mqtt_json.py b/espmusicmouse/host_driver/mqtt_json.py index 565c852..0ed5fe2 100644 --- a/espmusicmouse/host_driver/mqtt_json.py +++ b/espmusicmouse/host_driver/mqtt_json.py @@ -74,8 +74,10 @@ class ShelveLightMqtt: eff = EffectSwipeAndChange() eff.swipe.secondary_color = current_color eff.swipe.primary_color = self._last_color - eff.swipe.bell_curve_width_in_leds = 5 - eff.swipe.swipe_speed = 180 + eff.swipe.bell_curve_width_in_leds = 10 + eff.swipe.transition_width = 30 + eff.swipe.start_position = 0 + eff.swipe.swipe_speed = 260 eff.change.color1 = current_color eff.change.color2 = self._last_color elif s['effect'] == "twocolor":