Code Monkey home page Code Monkey logo

Comments (9)

wkelton avatar wkelton commented on July 4, 2024 1

white_value was removed: home-assistant/core#76926

Blog post: https://developers.home-assistant.io/blog/2022/08/18/light_white_value_removed/

I'm not sure if this fully fixes this (due to the change of the deprecation), but I tried with this diff and was able to get it working for my use case:

diff --git a/pyledshop/WifiLedShopLight.py b/pyledshop/WifiLedShopLight.py
index 2710306..8abf50c 100644
--- a/pyledshop/WifiLedShopLight.py
+++ b/pyledshop/WifiLedShopLight.py
@@ -8,14 +8,13 @@ from homeassistant.components.light import (
     ATTR_COLOR_TEMP,
     ATTR_EFFECT,
     ATTR_HS_COLOR,
-    ATTR_WHITE_VALUE,
+    ATTR_WHITE,
     EFFECT_COLORLOOP,
     EFFECT_RANDOM,
     PLATFORM_SCHEMA,
     SUPPORT_BRIGHTNESS,
     SUPPORT_COLOR,
     SUPPORT_EFFECT,
-    SUPPORT_WHITE_VALUE,
     LightEntity,
 )
 import homeassistant.util.color as color_util
@@ -131,8 +130,8 @@ class WifiLedShopLight(LightEntity):
         self.set_color(r, g, b)
         return

-    if ATTR_WHITE_VALUE in kwargs:
-        self.set_white(kwargs[ATTR_WHITE_VALUE])
+    if ATTR_WHITE in kwargs:
+        self.set_white(kwargs[ATTR_WHITE])
         return

     if ATTR_EFFECT in kwargs:
@@ -268,4 +267,4 @@ class WifiLedShopLight(LightEntity):

   @property
   def supported_features(self):
-    return (SUPPORT_COLOR | SUPPORT_BRIGHTNESS | SUPPORT_WHITE_VALUE | SUPPORT_EFFECT)
+    return (SUPPORT_COLOR | SUPPORT_BRIGHTNESS | SUPPORT_EFFECT)

from sp108e_ws2815.

fraanz97 avatar fraanz97 commented on July 4, 2024 1

@fraanz97 Here it is in "pictures". :) Edit the file: custom_components/sp108e_ws2815/pyledshop/WifiLedShopLight.py I'm using the "Studio Code Server" addon for this (but here are many ways you can edit a file). Go down a bit (around line 11) and change like this: Green is I changed the line, red is I removed a line. image Then continue down to around line 133 and change like this: image Lastly go down to the end of the file and change like this: image All done. Just restart HA. :)

Thank you so much. It works

from sp108e_ws2815.

wkelton avatar wkelton commented on July 4, 2024

Experiencing the same issue.

from sp108e_ws2815.

Snille avatar Snille commented on July 4, 2024

@wkelton Thank you, worked for me! :)

from sp108e_ws2815.

fraanz97 avatar fraanz97 commented on July 4, 2024

white_value was removed: home-assistant/core#76926

Blog post: https://developers.home-assistant.io/blog/2022/08/18/light_white_value_removed/

I'm not sure if this fully fixes this (due to the change of the deprecation), but I tried with this diff and was able to get it working for my use case:

diff --git a/pyledshop/WifiLedShopLight.py b/pyledshop/WifiLedShopLight.py
index 2710306..8abf50c 100644
--- a/pyledshop/WifiLedShopLight.py
+++ b/pyledshop/WifiLedShopLight.py
@@ -8,14 +8,13 @@ from homeassistant.components.light import (
     ATTR_COLOR_TEMP,
     ATTR_EFFECT,
     ATTR_HS_COLOR,
-    ATTR_WHITE_VALUE,
+    ATTR_WHITE,
     EFFECT_COLORLOOP,
     EFFECT_RANDOM,
     PLATFORM_SCHEMA,
     SUPPORT_BRIGHTNESS,
     SUPPORT_COLOR,
     SUPPORT_EFFECT,
-    SUPPORT_WHITE_VALUE,
     LightEntity,
 )
 import homeassistant.util.color as color_util
@@ -131,8 +130,8 @@ class WifiLedShopLight(LightEntity):
         self.set_color(r, g, b)
         return

-    if ATTR_WHITE_VALUE in kwargs:
-        self.set_white(kwargs[ATTR_WHITE_VALUE])
+    if ATTR_WHITE in kwargs:
+        self.set_white(kwargs[ATTR_WHITE])
         return

     if ATTR_EFFECT in kwargs:
@@ -268,4 +267,4 @@ class WifiLedShopLight(LightEntity):

   @property
   def supported_features(self):
-    return (SUPPORT_COLOR | SUPPORT_BRIGHTNESS | SUPPORT_WHITE_VALUE | SUPPORT_EFFECT)
+    return (SUPPORT_COLOR | SUPPORT_BRIGHTNESS | SUPPORT_EFFECT)

Hi, i have the same issue. This fix should work but I don't know where I have to put to make it work.
Can you help me? Thank you

from sp108e_ws2815.

Snille avatar Snille commented on July 4, 2024

@fraanz97 Here it is in "pictures". :)
Edit the file: custom_components/sp108e_ws2815/pyledshop/WifiLedShopLight.py
I'm using the "Studio Code Server" addon for this (but here are many ways you can edit a file).
Go down a bit (around line 11) and change like this: Green is I changed the line, red is I removed a line.
image
Then continue down to around line 133 and change like this:
image
Lastly go down to the end of the file and change like this:
image
All done. Just restart HA. :)

from sp108e_ws2815.

samhstein avatar samhstein commented on July 4, 2024

hi,

sorry for the delay been / still am traveling for a bit. if somebody can submit a pull request i can
merge it, other wise will be close till the end of the month until i can make the changes and
test...

thanks, sam

from sp108e_ws2815.

cskiwi avatar cskiwi commented on July 4, 2024

@samhstein: Done: #21

from sp108e_ws2815.

samhstein avatar samhstein commented on July 4, 2024

updated both branches, will hopefully get the config-flow set as the default

from sp108e_ws2815.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.