Skip to content

Commit

Permalink
Merge pull request #58 from noahhusby/refact/subscribe-model
Browse files Browse the repository at this point in the history
Add seperate objects to controller
  • Loading branch information
noahhusby authored Sep 25, 2024
2 parents 4011287 + a471b6c commit 3f76872
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions aiorussound/rio.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,14 @@ async def _load_controller(self, controller_id: int) -> Optional[Controller]:
device_str, "firmwareVersion"
)
controller = Controller(
controller_id, controller_type, mac_address, firmware_version, {}
controller_id,
controller_type,
self,
controller_device_str(controller_id),
mac_address,
firmware_version,
{},
)
controller.client = self
controller.device_str = controller_device_str(controller_id)
return controller
except CommandError:
return None
Expand Down Expand Up @@ -465,11 +469,13 @@ async def select_source(self, source: int) -> str:


@dataclass
class Controller(AbstractControlSurface):
class Controller:
"""Data class representing a Russound controller."""

controller_id: int
controller_type: str
client: RussoundClient
device_str: str
mac_address: Optional[str]
firmware_version: Optional[str]
zones: dict[int, ZoneControlSurface] = field(default_factory=dict)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "aiorussound"
version = "4.0.2"
version = "4.0.3"
description = "Asyncio client for Russound RIO devices."
authors = ["Noah Husby <[email protected]>"]
maintainers = ["Noah Husby <[email protected]>"]
Expand Down

0 comments on commit 3f76872

Please sign in to comment.