Add strip segment module for configurable light strip length (#1744)

A light strip can be cut shorter than it ships, and the device has to be
told how much of it is actually there so effects and colours span the
right distance. The Tapo app exposes this as "Light Strip Length".
python-kasa has no way to read or change it, so the setting is missing
from Home Assistant.

This change exposes a new feature backed by `segment` component:
- add a `Segment` module: `REQUIRED_COMPONENT = "segment"`,
`QUERY_GETTER_NAME = "get_device_segment"`
- expose one Number feature, `strip_segments`, range 0-50,
`Category.Config`
- add a `segments` property and `set_segments()`, which writes
`set_device_segment`
This commit is contained in:
nopoz
2026-10-04 06:56:51 -07:00
committed by GitHub
parent 9030179aad
commit dc0745ad93
4 changed files with 114 additions and 0 deletions

View File

@@ -163,6 +163,9 @@ class Module(ABC):
PowerProtection: Final[ModuleName[smart.PowerProtection]] = ModuleName(
"PowerProtection"
)
LightStripSegment: Final[ModuleName[smart.LightStripSegment]] = ModuleName(
"LightStripSegment"
)
HomeKit: Final[ModuleName[smart.HomeKit]] = ModuleName("HomeKit")
Matter: Final[ModuleName[smart.Matter]] = ModuleName("Matter")