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

Fix one more HA scene problem #256

Merged
merged 4 commits into from
Dec 17, 2020
Merged

Fix one more HA scene problem #256

merged 4 commits into from
Dec 17, 2020

Conversation

ultratoto14
Copy link
Collaborator

I create a bunch of scenes with different kind of device configuration:

  • RGB + CCT
  • RGB + W
  • RGB
  • CCT
  • W dimmer
    Found a case that needs this fix 😄

@@ -188,7 +188,9 @@ def hs_color(self):
"""Return the hs color value."""
if self.is_color_mode:
return self._hs
if self.supported_features & SUPPORT_COLOR:
if self.supported_features & SUPPORT_COLOR and not self.has_config(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can do this:

if self.supported_features & (SUPPORT_COLOR | SUPPORT_COLOR_TEMP):

Copy link
Collaborator Author

@ultratoto14 ultratoto14 Dec 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a not, I mean, in case SUPPORT_COLOR but does not SUPPORT_COLOR_TEMP => for RGB +W lights, not RGB + CCT

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right, missed that. But you should be able to use not. self.supported_features & SUPPORT_COLOR_TEMP for consistency.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@ultratoto14 ultratoto14 requested a review from postlund December 17, 2020 20:46
@ultratoto14 ultratoto14 merged commit 6cc178f into master Dec 17, 2020
@ultratoto14 ultratoto14 deleted the scene_fix_2 branch December 17, 2020 20:56
SKULSHADY pushed a commit to SKULSHADY/localtuya that referenced this pull request Dec 28, 2024
…#275

* Fix  socket.send() raised exception.
* Fix the update_interval create multi tasks.
* Adjust the logs to for sub-device and low-power devices.
* Add msg for disconnected function.
* Workaround to fix heartbeat not being. send because update_interval less then 5 secs.
* Handle the fail connection expectations.
* Add device ID and Name in logger when add new device.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants