mirror of
https://github.com/python-kasa/python-kasa.git
synced 2026-10-21 12:12:56 +00:00
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:
@@ -29,6 +29,7 @@ from .light import Light
|
||||
from .lighteffect import LightEffect
|
||||
from .lightpreset import LightPreset
|
||||
from .lightstripeffect import LightStripEffect
|
||||
from .lightstripsegment import LightStripSegment
|
||||
from .lighttransition import LightTransition
|
||||
from .matter import Matter
|
||||
from .mop import Mop
|
||||
@@ -83,6 +84,7 @@ __all__ = [
|
||||
"SmartLightEffect",
|
||||
"PowerProtection",
|
||||
"OverheatProtection",
|
||||
"LightStripSegment",
|
||||
"Speaker",
|
||||
"HomeKit",
|
||||
"Matter",
|
||||
|
||||
Reference in New Issue
Block a user