Skip to content

Add light mode selection and HA compatibility fixes - #11

Open
caideone wants to merge 5 commits into
v1ack:masterfrom
caideone:codex/lelight-ha-fixes
Open

caideone wants to merge 5 commits into
v1ack:masterfrom
caideone:codex/lelight-ha-fixes

Conversation

@caideone

@caideone caideone commented Aug 16, 2026 •

Copy link
Copy Markdown

This PR adds a light type selector to the config flow and includes compatibility fixes for newer Home Assistant/BLE stacks.
Changes:

  • Add config flow option for dimmable lights (调光灯) and color temperature lights (色温灯).
  • Persist the selected light mode and expose HA light capabilities accordingly.
  • Generate unique IDs using host and light mode to avoid entity conflicts.
  • Update bless to 0.3.0 to avoid imports removed from newer bleak versions.
  • Clamp BlueZ advertisement TxPower to 20 to avoid Failed to parse advertisement errors.

Tested:

  • Python syntax check for modified Python files.
  • JSON validation for manifest and translation files.

Comment on lines +55 to +57
def group_id_from_name(group_name: str) -> int:
group_hash = sha1(group_name.strip().lower().encode("utf-8")).digest()
return group_hash[0] % 255 + 1

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This part looks suspicious. Are you sure that original app works like this?

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.

3 participants