Skip to content

Commit

Permalink
Wip on segments and scenes
Browse files Browse the repository at this point in the history
  • Loading branch information
Galorhallen committed Oct 17, 2024
1 parent e558279 commit cfa91cf
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 39 deletions.
3 changes: 0 additions & 3 deletions src/govee_local_api/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,10 @@ async def turn_on_off(self, device: GoveeDevice, status: bool) -> None:
async def set_segment_color(
self, device: GoveeDevice, segment: int, rgb: Tuple[int, int, int]
) -> None:
<<<<<<< Updated upstream
=======
if not device.capabilities:
self._logger.warning("Capabilities not available for device %s", device)
return

>>>>>>> Stashed changes
if GoveeLightFeatures.SEGMENT_CONTROL not in device.capabilities.features:
self._logger.warning(
"Segment control is not supported by device %s", device
Expand Down
3 changes: 0 additions & 3 deletions src/govee_local_api/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,7 @@ async def turn_on(self) -> None:
async def set_segment_color(
self, segment: int, color: Tuple[int, int, int]
) -> None:
<<<<<<< Updated upstream
=======
self._segments_color[segment - 1] = color
>>>>>>> Stashed changes
await self._controller.set_segment_color(self, segment, color)

async def turn_off(self) -> None:
Expand Down
33 changes: 0 additions & 33 deletions src/govee_local_api/light_capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ class GoveeLightFeatures(Enum):
COLOR_KELVIN_TEMPERATURE = auto()
BRIGHTNESS = auto()
SEGMENT_CONTROL = auto()
<<<<<<< Updated upstream
SCENE_CONTROL = auto()


=======


class GoveeLightColorMode(Enum):
Expand All @@ -23,7 +18,6 @@ class GoveeLightColorMode(Enum):
SCENE = auto()


>>>>>>> Stashed changes
COMMON_FEATURES = {
GoveeLightFeatures.COLOR_RGB,
GoveeLightFeatures.COLOR_KELVIN_TEMPERATURE,
Expand All @@ -45,13 +39,10 @@ def __init__(
self.segments = segments
self.scenes = scenes

<<<<<<< Updated upstream
=======
@property
def segments_count(self) -> int:
return len(self.segments)

>>>>>>> Stashed changes
def __repr__(self) -> str:
return f"GoveeLightCapabilities(features={self.features!r}, segments={self.segments!r}, scenes={self.scenes!r})"

Expand All @@ -78,13 +69,6 @@ def __str__(self) -> str:
]


<<<<<<< Updated upstream
COMMON_CAPABILITIES = GoveeLightCapabilities(COMMON_FEATURES)
BRIGHTNESS_ONLY_CAPABILITIES = GoveeLightCapabilities(BRIGHTNESS_ONLY)
SEGMENTS_CAPABILITIES = GoveeLightCapabilities(
{*COMMON_FEATURES, GoveeLightFeatures.SEGMENT_CONTROL}, SEGMENT_CODES, {}
)
=======
COMMON_CAPABILITIES = GoveeLightCapabilities(COMMON_FEATURES, [], {})
BRIGHTNESS_ONLY_CAPABILITIES = GoveeLightCapabilities(BRIGHTNESS_ONLY, [], {})

Expand All @@ -98,7 +82,6 @@ def _create_with_segment_capabilities(segmentCount: int) -> GoveeLightCapabiliti
{},
)

>>>>>>> Stashed changes

GOVEE_LIGHT_CAPABILITIES: dict[str, GoveeLightCapabilities] = {
# Models with common features
Expand All @@ -122,11 +105,7 @@ def _create_with_segment_capabilities(segmentCount: int) -> GoveeLightCapabiliti
"H6110": COMMON_CAPABILITIES,
"H6117": COMMON_CAPABILITIES,
"H6159": COMMON_CAPABILITIES,
<<<<<<< Updated upstream
"H615A": COMMON_CAPABILITIES,
=======
"H615A": _create_with_segment_capabilities(0),
>>>>>>> Stashed changes
"H615B": COMMON_CAPABILITIES,
"H615C": COMMON_CAPABILITIES,
"H615D": COMMON_CAPABILITIES,
Expand All @@ -135,17 +114,6 @@ def _create_with_segment_capabilities(segmentCount: int) -> GoveeLightCapabiliti
"H6168": COMMON_CAPABILITIES,
"H6172": COMMON_CAPABILITIES,
"H6173": COMMON_CAPABILITIES,
<<<<<<< Updated upstream
"H618A": COMMON_CAPABILITIES,
"H618C": COMMON_CAPABILITIES,
"H618E": COMMON_CAPABILITIES,
"H618F": COMMON_CAPABILITIES,
"H619A": SEGMENTS_CAPABILITIES,
"H619B": SEGMENTS_CAPABILITIES,
"H619C": SEGMENTS_CAPABILITIES,
"H619D": SEGMENTS_CAPABILITIES,
"H619E": SEGMENTS_CAPABILITIES,
=======
"H618A": _create_with_segment_capabilities(15),
"H618C": COMMON_CAPABILITIES,
"H618E": COMMON_CAPABILITIES,
Expand All @@ -155,7 +123,6 @@ def _create_with_segment_capabilities(segmentCount: int) -> GoveeLightCapabiliti
"H619C": _create_with_segment_capabilities(10),
"H619D": _create_with_segment_capabilities(10),
"H619E": _create_with_segment_capabilities(10),
>>>>>>> Stashed changes
"H619Z": COMMON_CAPABILITIES,
"H61A0": COMMON_CAPABILITIES,
"H61A1": COMMON_CAPABILITIES,
Expand Down

0 comments on commit cfa91cf

Please sign in to comment.