File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33from pyomnilogic_local .models .mspconfig import MSPFilter
44from pyomnilogic_local .models .telemetry import TelemetryFilter
55from pyomnilogic_local .omnitypes import FilterSpeedPresets , FilterState
6+ from pyomnilogic_local .util import OmniEquipmentNotInitializedError
67
78
89class Filter (OmniEquipment [MSPFilter , TelemetryFilter ]):
@@ -128,7 +129,7 @@ async def turn_on(self) -> None:
128129 """
129130 if self .bow_id is None or self .system_id is None :
130131 msg = "Filter bow_id and system_id must be set"
131- raise ValueError (msg )
132+ raise OmniEquipmentNotInitializedError (msg )
132133
133134 await self ._api .async_set_equipment (
134135 pool_id = self .bow_id ,
@@ -141,7 +142,7 @@ async def turn_off(self) -> None:
141142 """Turn the filter off."""
142143 if self .bow_id is None or self .system_id is None :
143144 msg = "Filter bow_id and system_id must be set"
144- raise ValueError (msg )
145+ raise OmniEquipmentNotInitializedError (msg )
145146
146147 await self ._api .async_set_equipment (
147148 pool_id = self .bow_id ,
@@ -158,7 +159,7 @@ async def run_preset_speed(self, speed: FilterSpeedPresets) -> None:
158159 """
159160 if self .bow_id is None or self .system_id is None :
160161 msg = "Filter bow_id and system_id must be set"
161- raise ValueError (msg )
162+ raise OmniEquipmentNotInitializedError (msg )
162163
163164 speed_value : int
164165 match speed :
Original file line number Diff line number Diff line change 33from pyomnilogic_local .models .mspconfig import MSPPump
44from pyomnilogic_local .models .telemetry import TelemetryPump
55from pyomnilogic_local .omnitypes import PumpState
6+ from pyomnilogic_local .util import OmniEquipmentNotInitializedError
67
78
89class Pump (OmniEquipment [MSPPump , TelemetryPump ]):
@@ -110,7 +111,7 @@ async def turn_on(self) -> None:
110111 """
111112 if self .bow_id is None or self .system_id is None :
112113 msg = "Pump bow_id and system_id must be set"
113- raise ValueError (msg )
114+ raise OmniEquipmentNotInitializedError (msg )
114115
115116 await self ._api .async_set_equipment (
116117 pool_id = self .bow_id ,
@@ -123,7 +124,7 @@ async def turn_off(self) -> None:
123124 """Turn the pump off."""
124125 if self .bow_id is None or self .system_id is None :
125126 msg = "Pump bow_id and system_id must be set"
126- raise ValueError (msg )
127+ raise OmniEquipmentNotInitializedError (msg )
127128
128129 await self ._api .async_set_equipment (
129130 pool_id = self .bow_id ,
You can’t perform that action at this time.
0 commit comments