Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Commit

Permalink
Fix #49 #51 #48 and #50 , update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidy committed Nov 14, 2020
1 parent 92d458f commit 25ab714
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ celerybeat.pid
# SageMath parsed files
*.sage.py

dockertest/

# Environments
.env
.venv
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ This component does need a dependency on `pywizlight` like @sbidy's component wh
| ESP15_SHTW1_01I | X | X | | | |
| ESP03_SHRGB1W_01 | X | X | X | X | X | Philips Color &. Tunable-White A21 |
| ESP06_SHDW9_01 | X | | | | X | Philips Soft White A19 |
| ESP03_SHRGBP_31 | X | X | X | X | X | Trio Leuchten WiZ LED |
| ESP03_SHRGB1C_01 | X | X | X | X | X | WiZ LED EAN 8718699787059 |
| ESP17_SHTW9_01 | X | X | | | X | WiZ Filament Bulb EAN 8718699786793 |


Please report as issue your builb type with a feature list:

Expand All @@ -51,7 +55,8 @@ Please report as issue your builb type with a feature list:
- Setting a rhythm as a scene

## Next improvement:
- testing with other hardware -- **Contribution required !!**
- Add Bulb Feature Management via YAML files
- Testing with other hardware -- **Contribution required !!**
- Config Flow Support

## Pull request in HA core
Expand Down
20 changes: 16 additions & 4 deletions custom_components/wiz_light/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,18 @@ def color_temp(self):
@property
def min_mireds(self):
"""Return the coldest color_temp that this light supports."""
if self._bulbtype == "ESP17_SHTW9_01":
return color_utils.color_temperature_kelvin_to_mired(5000)
# default temp
return color_utils.color_temperature_kelvin_to_mired(6500)

@property
def max_mireds(self):
"""Return the warmest color_temp that this light supports."""
if self._bulbtype == "ESP17_SHTW9_01" or \
self._bulbtype == "ESP03_SHRGBP_31":
return color_utils.color_temperature_kelvin_to_mired(2000)
# default temp
return color_utils.color_temperature_kelvin_to_mired(2500)

@property
Expand All @@ -153,13 +160,16 @@ def supported_features(self) -> int:
if self._bulbtype == "ESP06_SHDW9_01" or self._bulbtype == "ESP06_SHDW1_01":
return SUPPORT_BRIGHTNESS | SUPPORT_EFFECT
# Color Temp and dimmer - not tested
if self._bulbtype == "ESP01_SHTW1C_31":
if self._bulbtype == "ESP01_SHTW1C_31" or self._bulbtype == "ESP17_SHTW9_01":
return SUPPORT_BRIGHTNESS | SUPPORT_COLOR_TEMP
# Firlament bulbs support only dimmer (tested)
if self._bulbtype == "ESP56_SHTW3_01" or self._bulbtype == "ESP15_SHTW1_01I":
return SUPPORT_BRIGHTNESS | SUPPORT_COLOR_TEMP | SUPPORT_EFFECT
# Full feature support (color) - not tested
if self._bulbtype == "ESP01_SHRGB1C_31" or self._bulbtype == "ESP01_SHRGB_03":
if self._bulbtype == "ESP01_SHRGB1C_31" or \
self._bulbtype == "ESP01_SHRGB_03" or \
self._bulbtype == "ESP03_SHRGBP_31" or \
self._bulbtype == "ESP03_SHRGB1C_01":
return (
SUPPORT_BRIGHTNESS | SUPPORT_COLOR | SUPPORT_COLOR_TEMP | SUPPORT_EFFECT
)
Expand Down Expand Up @@ -230,7 +240,8 @@ async def update_state(self):
except Exception as ex:
_LOGGER.error(ex)
await self.update_state_unavailable()
_LOGGER.debug("[wizlight %s] updated state: %s", self._light.ip, self._state)
_LOGGER.debug("[wizlight %s] updated state: %s",
self._light.ip, self._state)

def update_brightness(self):
"""Update the brightness."""
Expand All @@ -256,7 +267,8 @@ def update_temperature(self):
if colortemp is None or colortemp == 0:
return
try:
temperature = color_utils.color_temperature_kelvin_to_mired(colortemp)
temperature = color_utils.color_temperature_kelvin_to_mired(
colortemp)
self._temperature = temperature

# pylint: disable=broad-except
Expand Down

0 comments on commit 25ab714

Please sign in to comment.