Skip to content

Commit 8a86504

Browse files
authored
fix: temporarially remove input validation from debug set-equipment (#97)
1 parent 2e72b08 commit 8a86504

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

pyomnilogic_local/api/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ async def async_set_equipment(
373373
self,
374374
pool_id: int,
375375
equipment_id: int,
376-
is_on: int | bool,
376+
is_on: int | bool | str,
377377
is_countdown_timer: bool = False,
378378
start_time_hours: int = 0,
379379
start_time_minutes: int = 0,

pyomnilogic_local/cli/debug/commands.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,22 +182,15 @@ def set_equipment(ctx: click.Context, bow_id: int, equip_id: int, is_on: str) ->
182182
ensure_connection(ctx)
183183
omni: OmniLogicAPI = ctx.obj["OMNI"]
184184

185+
is_on_value: int | bool | str
185186
# Parse is_on parameter - can be bool-like string or integer
186187
is_on_lower = is_on.lower()
187188
if is_on_lower in ("true", "on", "yes", "1"):
188-
is_on_value: int | bool = True
189+
is_on_value = True
189190
elif is_on_lower in ("false", "off", "no", "0"):
190191
is_on_value = False
191192
else:
192-
# Try to parse as integer for variable speed equipment
193-
try:
194-
is_on_value = int(is_on)
195-
if not 0 <= is_on_value <= 100:
196-
click.echo(f"Error: Integer value must be between 0-100, got {is_on_value}", err=True)
197-
raise click.Abort
198-
except ValueError as exc:
199-
click.echo(f"Error: Invalid value '{is_on}'. Use true/false, on/off, or 0-100 for speed.", err=True)
200-
raise click.Abort from exc
193+
is_on_value = is_on
201194

202195
# Execute the command
203196
try:

0 commit comments

Comments
 (0)