Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions pyomnilogic_local/colorlogiclight.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def __init__(self, omni: OmniLogic, mspconfig: MSPColorLogicLight, telemetry: Te
super().__init__(omni, mspconfig, telemetry)

@property
def model(self) -> ColorLogicLightType:
def equip_type(self) -> ColorLogicLightType:
"""Returns the model of the light."""
return self.mspconfig.equip_type

Expand Down Expand Up @@ -168,20 +168,30 @@ def state(self) -> ColorLogicPowerState:
@property
def show(self) -> LightShows:
"""Returns the current light show."""
return self.telemetry.show_name(self.model, self.v2_active)
return self.telemetry.show_name(self.equip_type, self.v2_active)

@property
def speed(self) -> ColorLogicSpeed:
"""Returns the current speed."""
if self.model in [ColorLogicLightType.SAM, ColorLogicLightType.TWO_FIVE, ColorLogicLightType.FOUR_ZERO, ColorLogicLightType.UCL]:
if self.equip_type in [
ColorLogicLightType.SAM,
ColorLogicLightType.TWO_FIVE,
ColorLogicLightType.FOUR_ZERO,
ColorLogicLightType.UCL,
]:
return self.telemetry.speed
# Non color-logic lights only support 1x speed
return ColorLogicSpeed.ONE_TIMES

@property
def brightness(self) -> ColorLogicBrightness:
"""Returns the current brightness."""
if self.model in [ColorLogicLightType.SAM, ColorLogicLightType.TWO_FIVE, ColorLogicLightType.FOUR_ZERO, ColorLogicLightType.UCL]:
if self.equip_type in [
ColorLogicLightType.SAM,
ColorLogicLightType.TWO_FIVE,
ColorLogicLightType.FOUR_ZERO,
ColorLogicLightType.UCL,
]:
return self.telemetry.brightness
# Non color-logic lights only support 100% brightness
return ColorLogicBrightness.ONE_HUNDRED_PERCENT
Expand Down Expand Up @@ -262,17 +272,17 @@ async def set_show(
and a warning will be logged.
"""
# Non color-logic lights do not support speed or brightness control
if self.model not in [
if self.equip_type not in [
ColorLogicLightType.SAM,
ColorLogicLightType.TWO_FIVE,
ColorLogicLightType.FOUR_ZERO,
ColorLogicLightType.UCL,
]:
if speed is not None:
_LOGGER.warning("Non colorlogic lights do not support speed control %s", self.model.name)
_LOGGER.warning("Non colorlogic lights do not support speed control %s", self.equip_type.name)
speed = ColorLogicSpeed.ONE_TIMES
if brightness is not None:
_LOGGER.warning("Non colorlogic lights do not support brightness control %s", self.model.name)
_LOGGER.warning("Non colorlogic lights do not support brightness control %s", self.equip_type.name)
brightness = ColorLogicBrightness.ONE_HUNDRED_PERCENT

if self.bow_id is None or self.system_id is None:
Expand Down
2 changes: 1 addition & 1 deletion pyomnilogic_local/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def __init__(self, omni: OmniLogic, mspconfig: MSPSensor, telemetry: Telemetry |
super().__init__(omni, mspconfig, telemetry)

@property
def sensor_type(self) -> SensorType | str:
def equip_type(self) -> SensorType | str:
"""Returns the type of sensor.

Can be AIR_TEMP, SOLAR_TEMP, WATER_TEMP, FLOW, ORP, or EXT_INPUT.
Expand Down
Loading