Skip to content

Conversation

@cryptk
Copy link
Owner

@cryptk cryptk commented Oct 27, 2025

  • provide abstraction layer within library
  • allows interacting with omnilogic in a more pythonic way

- provide abstraction layer within library
- allows interacting with omnilogic in a more pythonic way
@cryptk cryptk force-pushed the refactor_abstracted_interface branch from 3cb6294 to 5d1029f Compare October 27, 2025 21:36
- Create EquipmentDict collection supporting lookup by name or system_id
- Replace list[Equipment] with EquipmentDict in Backyard and Bow classes
- Add validation for equipment identifiers and duplicate name warnings
- Refactor OmniEquipment to call update() from __init__ for proper hook execution
- Add _update_equipment() methods to Backyard and Bow for child equipment updates
- Update items() to return (system_id, name, item) tuples

This enables intuitive equipment access: backyard.bow["Pool"] or backyard.bow[3]
while allowing compatibility with iteration and length operations.
@cryptk cryptk force-pushed the refactor_abstracted_interface branch from 4f20fbe to 086426f Compare October 30, 2025 04:42
- Add OmniEquipmentNotReadyError for equipment in non-ready states
- Add OmniEquipmentNotInitializedError for uninitialized equipment
- Add OmniConnectionError for controller communication failures
- Export all exceptions in __init__.py for easy importing
- Replace ValueError with OmniEquipmentNotInitializedError in ColorLogicLight methods

All exceptions inherit from OmniLogicLocalError base class and include
comprehensive docstrings with usage examples.
…system

- Implement @auto_refresh decorator that automatically refreshes equipment
  state after control methods
- Add update_if_older_than() with asyncio.Lock to prevent redundant API calls
- Refactor equipment classes to pass OmniLogic instance instead of OmniLogicAPI
  for explicit dependency injection
- Remove complex automatic refresh system in favor of explicit state tracking.
- Add dirty flags to OmniLogic and update refresh() with flexible
  if_dirty/if_older_than/force parameters for better user control.
@cryptk cryptk force-pushed the refactor_abstracted_interface branch from 163b9b9 to 68da82d Compare October 30, 2025 21:33
…ilter and Pump

- Filter includes run_preset_speed method for LOW/MEDIUM/HIGH presets
- All MSPConfig and Telemetry attributes exposed as properties
@cryptk cryptk force-pushed the refactor_abstracted_interface branch from 2727db9 to 864e854 Compare October 30, 2025 22:12
@cryptk cryptk changed the title feat: begin major refactor of codebase feat: refactor of codebase Oct 30, 2025
cryptk added 10 commits October 30, 2025 17:17
- Also added mspconfig and telemetry type hints to all equipment classes
- @Property methods for accessing equipment by type:
  all_lights, all_filters, etc
- Add get_equipment_by_name() and get_equipment_by_id() for searching across all equipment.
…hensive status decoding

- Add telemetry properties and bitmask decoding for Chlorinator status, alerts, and errors
- Implement CSAD properties for pH/ORP monitoring and chemical dispensing control
- Add computed properties (is_on, is_generating, is_ready, has_alert, etc.) with detailed docstrings
- Clarify ORP sensor usage: primary control for chlorinator, monitoring only for CSAD
@cryptk cryptk force-pushed the refactor_abstracted_interface branch from eaf4a60 to 539f541 Compare October 31, 2025 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants