Skip to content

Commit

Permalink
Bug fixing for MrSteam
Browse files Browse the repository at this point in the history
RUFF checks
  • Loading branch information
gazoodle committed Feb 27, 2025
1 parent 973a016 commit 5ab57be
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 9 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ https://www.gnu.org/licenses/gpl-3.0.html
shared global config?
- Expose the master timeouts as configurations and the ud timeouts as controls
- Keep looking to see if there is a time sync mechanism
- Use the config ver and status ver check in simulator to make sure partial block updates are acceptable

## Done/Fixed in 1.0.7
- Move on with MrSteam device detection, it ought to load the facade cleanly now
Expand Down
16 changes: 11 additions & 5 deletions src/geckolib/automation/async_facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,21 +234,27 @@ def _scan_outputs(self) -> None:
self._sensors.extend(
[
GeckoSensor(
self, "Mr.Steam On/Off", self._spa.accessors["UserMode"]
self,
"Mr.Steam On/Off",
self._spa.accessors[GeckoConstants.KEY_MRSTEAM_USER_MODE],
),
GeckoSensor(
self, "Mr.Steam Aroma", self._spa.accessors["UserAroma"]
self,
"Mr.Steam Aroma",
self._spa.accessors[GeckoConstants.KEY_MRSTEAM_USER_AROMA],
),
GeckoSensor(
self,
"Mr.Steam Temperature",
self._spa.accessors["UserSetpointG"],
self._spa.accessors["TempUnits"],
self._spa.accessors[GeckoConstants.KEY_MRSTEAM_USER_SETPOINT_G],
self._spa.accessors[GeckoConstants.KEY_TEMP_UNITS],
),
GeckoSensor(
self,
"Mr.Steam Runtime",
self._spa.accessors["RemainingRuntime"],
self._spa.accessors[
GeckoConstants.KEY_MRSTEAM_REMAINING_RUNTIME
],
),
]
)
Expand Down
2 changes: 1 addition & 1 deletion src/geckolib/automation/watercare.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
from typing import TYPE_CHECKING

from geckolib.const import GeckoConstants
from geckolib.driver import GeckoWatercareProtocolHandler

from .base import GeckoAutomationFacadeBase

if TYPE_CHECKING:
from geckolib.automation.async_facade import GeckoAsyncFacade
from geckolib.driver import GeckoWatercareProtocolHandler

_LOGGER = logging.getLogger(__name__)

Expand Down
5 changes: 5 additions & 0 deletions src/geckolib/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ class GeckoConstants:
KEY_LOCKMODE = "LockMode"
KEY_STANDBY = "QuietState"

KEY_MRSTEAM_USER_MODE = "UserMode"
KEY_MRSTEAM_USER_AROMA = "UserAroma"
KEY_MRSTEAM_USER_SETPOINT_G = "UserSetpointG"
KEY_MRSTEAM_REMAINING_RUNTIME = "RemainingRuntime"

KEY_USER_DEMAND_LIGHT = "UdLi"

EXCEPTION_MESSAGE_NOT_WRITABLE = (
Expand Down
1 change: 1 addition & 0 deletions src/geckolib/driver/async_spastruct.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ def build_connections(self) -> None:
#
# Accessory support

@property
def is_mr_steam(self) -> bool:
"""Is this a MrSteam pack."""
return self.plateform_key == "mrsteam"
Expand Down
5 changes: 3 additions & 2 deletions src/geckolib/utils/cui/cui.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def _spa_problem(self) -> None:
)
)

def _build_facade_ui(self, _maxy: int, maxx: int) -> None:
def _build_facade_ui(self, _maxy: int, maxx: int) -> None: # noqa: PLR0912
if self.facade is None:
return
curx = 2
Expand Down Expand Up @@ -247,7 +247,8 @@ def _build_facade_ui(self, _maxy: int, maxx: int) -> None:
self._lines.append("We have a Mr Steam unit")
self._lines.append("")

self._lines.append(f"{self.facade.water_heater}")
if self.facade.water_heater.is_available:
self._lines.append(f"{self.facade.water_heater}")
if self.facade.inmix.is_available:
self._lines.extend(f"{zone}" for zone in self.facade.inmix.zones)
if self.facade.inmix.syncro.is_available:
Expand Down
1 change: 0 additions & 1 deletion src/geckolib/utils/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

from geckolib import VERSION, GeckoConstants, GeckoPump
from geckolib.async_spa_manager import GeckoAsyncSpaMan
from geckolib.automation import inmix
from geckolib.automation.base import GeckoAutomationBase, GeckoAutomationFacadeBase
from geckolib.config import release_config_change_waiters
from geckolib.driver.accessor import GeckoStructAccessor
Expand Down

0 comments on commit 5ab57be

Please sign in to comment.