Skip to content

Commit

Permalink
Merge pull request #84 from yoyo930021/fix-lx128-water-machine
Browse files Browse the repository at this point in the history
新增 NA-LX128 洗衣機的支援
  • Loading branch information
osk2 authored Aug 3, 2023
2 parents 5b2e44e + f82ca2a commit bcce205
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions custom_components/panasonic_smart_app/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"0x13", # Washing machine remaining washing time
"0x14", # Washing machine timer
"0x15", # Washing machine remaining time to trigger timer
"0x41", # Washing machine timer for japan model
"0x50", # Washing machine status
"0x54", # Washing machine current mode
"0x55", # Washing machine current cycle
Expand Down
2 changes: 2 additions & 0 deletions custom_components/panasonic_smart_app/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ def icon(self) -> str:
def state(self) -> int:
status = self.coordinator.data[self.index]["status"]
_current_countdown = status.get("0x13", None)
if _current_countdown is None or float(_current_countdown) < 0:
_current_countdown = status.get("0x41", None)
_LOGGER.debug(f"[{self.label}] state: {_current_countdown}")
return _current_countdown if _current_countdown else STATE_UNAVAILABLE

Expand Down
2 changes: 2 additions & 0 deletions custom_components/panasonic_smart_app/smartApp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
EXCEPTION_DEVICE_NOT_RESPONDING,
EXCEPTION_INVALID_REFRESH_TOKEN,
EXCEPTION_DEVICE_JP_INFO,
EXCEPTION_DEVICE_JP_FAILED,
)
from .utils import chunks
from . import urls
Expand Down Expand Up @@ -287,6 +288,7 @@ async def request(
EXCEPTION_DEVICE_OFFLINE,
EXCEPTION_DEVICE_NOT_RESPONDING,
EXCEPTION_DEVICE_JP_INFO,
EXCEPTION_DEVICE_JP_FAILED,
]
if resp.get("StateMsg") in offline_exceptions:
auth = headers.get("auth", None)
Expand Down
3 changes: 2 additions & 1 deletion custom_components/panasonic_smart_app/smartApp/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
EXCEPTION_DEVICE_OFFLINE = "deviceOffline"
EXCEPTION_DEVICE_NOT_RESPONDING = "deviceNoResponse"
EXCEPTION_DEVICE_JP_INFO = "503:DeviceJPInfo:aStatusCode"
EXCEPTION_DEVICE_JP_FAILED = ":DeviceJPInfo:GetCommandTransResult failed"
EXCEPTION_TOKEN_EXPIRED = "無法依據您的CPToken,auth取得相關資料"
EXCEPTION_INVALID_REFRESH_TOKEN = "無效RefreshToken"
EXCEPTION_CPTOKEN_EXPIRED = "此CPToken已經逾時"
EXCEPTION_REACH_RATE_LIMIT = "系統檢測您當前超量使用"
EXCEPTION_REACH_RATE_LIMIT = "系統檢測您當前超量使用"

0 comments on commit bcce205

Please sign in to comment.