Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

新增 NA-LX128 洗衣機的支援 #84

Merged
merged 2 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -281,6 +282,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 = "系統檢測您當前超量使用"