Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vacuum platform #425

Closed
wants to merge 73 commits into from
Closed
Changes from 3 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
6e07a55
First try to add scenes.
ultratoto14 Nov 9, 2020
1006981
Remove unecessary constants.
ultratoto14 Nov 10, 2020
2ca5a15
Merge branch 'master' into light_scenes
ultratoto14 Nov 15, 2020
8d91d92
Merge branch 'master' into light_scenes
ultratoto14 Nov 16, 2020
9be72d1
Update internal state whatever mode is.
ultratoto14 Nov 16, 2020
352ba58
Add RGB only scenes.
ultratoto14 Nov 16, 2020
9ca3efb
Fix brightness issues.
ultratoto14 Nov 17, 2020
26f5e17
Merge branch 'master' into light_scenes
ultratoto14 Nov 17, 2020
457bae1
Follow review comments.
ultratoto14 Nov 17, 2020
92f2372
Merge pull request #146 from ultratoto14/light_scenes
ultratoto14 Nov 18, 2020
4793e09
Cover fake positioning revised (#162)
rospogrigio Nov 18, 2020
3356b3d
Wrong check that enable music mode evry time.
ultratoto14 Nov 18, 2020
1dbae75
Give error if no DPS are found in config flow (#167)
postlund Nov 18, 2020
5ec66f2
Merge branch 'master' into music_mode_fix
ultratoto14 Nov 18, 2020
5eeb4c4
Merge pull request #168 from ultratoto14/music_mode_fix
ultratoto14 Nov 18, 2020
27af622
Store product key in config entry (#170)
postlund Nov 19, 2020
f376d85
Fix broken exception logging (#173)
postlund Nov 20, 2020
5668595
Add missing variable to log point (#174)
postlund Nov 20, 2020
52c62c5
Fix typo of dp_id in fan platform (#178)
postlund Nov 22, 2020
14333b2
Use color picker white point.
ultratoto14 Nov 23, 2020
3ecae04
overzealous check.
ultratoto14 Nov 23, 2020
095f649
Merge pull request #182 from rospogrigio/white_point
ultratoto14 Nov 23, 2020
a74af93
Fix for issue #186 (wrong initialization values for _timer_start and …
rospogrigio Nov 24, 2020
b50ee8b
Properly close discovery listeners (#225)
postlund Dec 7, 2020
3b7e806
Update README.md
cjj25 Nov 28, 2020
1d58abd
Update README.md
cjj25 Nov 30, 2020
10e55e6
Add support for passive devices (#171)
postlund Dec 15, 2020
e7d58be
Add localtuya.set_dp service (#236)
postlund Dec 15, 2020
aeb27a4
Fix improper closing in config flow (#237)
postlund Dec 15, 2020
d0653d4
Fix HA scenes with bulb without color_temp
ultratoto14 Dec 15, 2020
89dabfc
Reduce heartbeat interval.
ultratoto14 Dec 15, 2020
d2a307f
Merge pull request #239 from rospogrigio/tighter_heartbeat
ultratoto14 Dec 15, 2020
3737dec
Merge branch 'master' into light_fixes
ultratoto14 Dec 15, 2020
2d2a621
Merge pull request #238 from rospogrigio/light_fixes
ultratoto14 Dec 15, 2020
c28fac7
This makes lights smoothly fade from one state to a new state, withou…
maartenweyns Dec 15, 2020
a6e8f28
Fixed editor line indentation
maartenweyns Dec 15, 2020
3cf15f2
Merge pull request #240 from maartenweyns/master
ultratoto14 Dec 15, 2020
f72cbc0
Run pylint from tox (#243)
postlund Dec 17, 2020
52bf9cc
Add dependabot config (#249)
postlund Dec 17, 2020
acd70b6
Fix name issue from pylint changes (#252)
postlund Dec 17, 2020
ad0f80f
Bump homeassistant from 2020.12.0 to 2020.12.1 (#244)
dependabot-preview[bot] Dec 17, 2020
f5add5a
Bump codespell from 1.17.1 to 2.0.0
dependabot-preview[bot] Dec 17, 2020
be29474
Bump flake8 from 3.8.3 to 3.8.4
dependabot-preview[bot] Dec 17, 2020
3a49403
Use debug message for timeout.
ultratoto14 Dec 17, 2020
8e1e349
Fix HA scene, one more.
dependabot-preview[bot] Dec 17, 2020
41a1e78
Merge branch 'master' into scene_fix_2
ultratoto14 Dec 17, 2020
6869a0a
Bump mypy from 0.782 to 0.790 (#245)
dependabot-preview[bot] Dec 17, 2020
654c6cd
Support adding and removing entities to devices (#191)
postlund Dec 17, 2020
acf3e6e
Merge branch 'master' into scene_fix_2
ultratoto14 Dec 17, 2020
444ec78
Fix review comment.
ultratoto14 Dec 17, 2020
fd404cb
Merge branch 'master' into timeout_log
ultratoto14 Dec 17, 2020
6cc178f
Merge pull request #256 from rospogrigio/scene_fix_2
ultratoto14 Dec 17, 2020
0518f58
Merge branch 'master' into timeout_log
ultratoto14 Dec 17, 2020
d8de7e3
Merge pull request #255 from rospogrigio/timeout_log
ultratoto14 Dec 17, 2020
94d1c93
Bump homeassistant from 2020.12.1 to 2020.12.2
dependabot-preview[bot] Dec 30, 2020
9bfeb10
Cover fake position persistent (#213)
rospogrigio Dec 30, 2020
397e99f
allow set small / large values for low and high speed for fans
Jan 1, 2021
4b361c4
Merge pull request #290 from itairaz1/allow-small-large-values-for-fan
ultratoto14 Jan 2, 2021
29622f3
Bump homeassistant from 2020.12.2 to 2021.1.0
dependabot-preview[bot] Jan 6, 2021
5637060
Fixed close button disabled with 'none' positioning mode
rospogrigio Jan 6, 2021
e030c38
Bump homeassistant from 2021.1.0 to 2021.1.1
dependabot-preview[bot] Jan 9, 2021
8483cb6
Bump homeassistant from 2021.1.1 to 2021.1.3
dependabot-preview[bot] Jan 15, 2021
496fb1a
Bump homeassistant from 2021.1.3 to 2021.1.4
dependabot-preview[bot] Jan 16, 2021
1a5fd2f
Bump mypy from 0.790 to 0.800
dependabot-preview[bot] Jan 22, 2021
09f6de8
Updated manigest.json adding "version" field
rospogrigio Mar 4, 2021
9a240bc
Swtiching to version 3.2.1 in manifest.json
rospogrigio Mar 4, 2021
66fdc16
Make connection retries every minute (#288)
postlund Mar 5, 2021
57fe963
Bump pylint from 2.6.0 to 2.7.2 (#373)
dependabot-preview[bot] Mar 8, 2021
93b6ad6
Bump mypy from 0.800 to 0.812 (#363)
dependabot-preview[bot] Mar 8, 2021
dd8c669
Merge branch 'master' of https://github.com/unfilet/localtuya into va…
unfilet Mar 24, 2021
2816988
remove space
unfilet Mar 24, 2021
33dd70b
add state variants
unfilet Mar 29, 2021
481ffa8
remove error method; update set fan speed
unfilet Mar 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 22 additions & 18 deletions custom_components/localtuya/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,24 +325,28 @@ async def async_turn_on(self, **kwargs):
if brightness is None:
brightness = self._brightness
hs = kwargs[ATTR_HS_COLOR]
if self.__is_color_rgb_encoded():
rgb = color_util.color_hsv_to_RGB(
hs[0], hs[1], int(brightness * 100 / self._upper_brightness)
)
color = "{:02x}{:02x}{:02x}{:04x}{:02x}{:02x}".format(
round(rgb[0]),
round(rgb[1]),
round(rgb[2]),
round(hs[0]),
round(hs[1] * 255 / 100),
brightness,
)
if hs[1] == 0 and self.has_config(CONF_BRIGHTNESS):
states[self._config.get(CONF_BRIGHTNESS)] = brightness
states[self._config.get(CONF_COLOR_MODE)] = MODE_WHITE
else:
color = "{:04x}{:04x}{:04x}".format(
round(hs[0]), round(hs[1] * 10.0), brightness
)
states[self._config.get(CONF_COLOR)] = color
states[self._config.get(CONF_COLOR_MODE)] = MODE_COLOR
if self.__is_color_rgb_encoded():
rgb = color_util.color_hsv_to_RGB(
hs[0], hs[1], int(brightness * 100 / self._upper_brightness)
)
color = "{:02x}{:02x}{:02x}{:04x}{:02x}{:02x}".format(
round(rgb[0]),
round(rgb[1]),
round(rgb[2]),
round(hs[0]),
round(hs[1] * 255 / 100),
brightness,
)
else:
color = "{:04x}{:04x}{:04x}".format(
round(hs[0]), round(hs[1] * 10.0), brightness
)
states[self._config.get(CONF_COLOR)] = color
states[self._config.get(CONF_COLOR_MODE)] = MODE_COLOR

if ATTR_COLOR_TEMP in kwargs and (features & SUPPORT_COLOR_TEMP):
if brightness is None:
Expand All @@ -366,7 +370,7 @@ def status_updated(self):
self._state = self.dps(self._dp_id)
supported = self.supported_features
self._effect = None
if supported & SUPPORT_BRIGHTNESS:
if supported & SUPPORT_BRIGHTNESS and self.has_config(CONF_BRIGHTNESS):
self._brightness = self.dps_conf(CONF_BRIGHTNESS)

if supported & SUPPORT_COLOR:
Expand Down