Squash-merge PR #251: fix appliance course labels and AC setup timeouts
- Add confirmed Samsung Table_02 washer course mappings (69-79, 88) - Add confirmed dishwasher course mappings (82, 8a, a7, a8, 8c, 88) - Localize new washer/dishwasher course labels in en, cs, nl - Decode device-provided personal washer course names from TLV payloads - Show unrecognized washer enum bytes as 'Unknown (0xNN)' - Normalize select current-state and options through one display path - Bound first-setup subdevice enumeration with a shared time budget Co-authored-by: galaxysj <224385302+galaxysj@users.noreply.github.com>
This commit is contained in:
1 parent
55765fdf9a
commit
00db7890f5
19 files changed
+771
-49
No files matched your search
@@ -6,6 +6,10 @@ and callable forms of SelectDesc.options.
|
||||
from typing import ClassVar, cast
|
||||
|
||||
from custom_components.localthings.coordinator import LocalThingsCoordinator
|
||||
from custom_components.localthings.registry.capabilities.laundry import (
|
||||
cycle_select,
|
||||
washer_cycle_fallback,
|
||||
)
|
||||
from custom_components.localthings.registry.capability import Capability
|
||||
from custom_components.localthings.registry.discovery import BoundEntity
|
||||
from custom_components.localthings.registry.entities import SelectDesc
|
||||
@@ -113,3 +117,79 @@ async def test_unknown_vendor_option_round_trips_to_exact_raw_value():
|
||||
assert entity.options[-1] == "Future Vendor Mode"
|
||||
await entity.async_select_option("Future Vendor Mode")
|
||||
assert coordinator.writes == ["FutureVendorMode"]
|
||||
|
||||
|
||||
async def test_washer_diagnostic_cycle_values_share_one_display_and_write_path():
|
||||
"""Regression for Course_69/EditCourseList_696F... from real hardware."""
|
||||
|
||||
class _WritableCoordinator(_FakeCoordinator):
|
||||
data: ClassVar[dict] = {"cycle": "69"}
|
||||
|
||||
def __init__(self, last_resources):
|
||||
super().__init__(last_resources)
|
||||
self.writes = []
|
||||
|
||||
async def async_send_command(self, bound, value):
|
||||
self.writes.append(value)
|
||||
|
||||
desc = cycle_select(
|
||||
translation_key="washer_cycle",
|
||||
icon="mdi:washing-machine",
|
||||
table_href="/st/washercourse/vs/0",
|
||||
display_fn=washer_cycle_fallback,
|
||||
)
|
||||
capability = Capability(href="/course/vs/0", entities=(desc,))
|
||||
bound = BoundEntity(href="/course/vs/0", capability=capability, desc=desc)
|
||||
resources = {
|
||||
"/course/vs/0": {"x.com.samsung.da.options": ["Course_69"]},
|
||||
"/st/washercourse/vs/0": {
|
||||
"x.com.samsung.da.st.courseTable": "Table_02",
|
||||
},
|
||||
"/wm/editcourse/vs/0": {
|
||||
"x.com.samsung.da.editCourseList": (
|
||||
"EditCourseList_696F757801719688706D6A7376726C6E6B777479F1F3"
|
||||
),
|
||||
},
|
||||
"/wm/personalcourse/vs/0": {
|
||||
"x.com.samsung.da.courses": [
|
||||
"F1_0106EC868DEC98B7",
|
||||
"F3_0109EC9A94EAB8B0EBB3B4",
|
||||
],
|
||||
},
|
||||
}
|
||||
coordinator = _WritableCoordinator(resources)
|
||||
entity = LocalThingsSelect(cast(LocalThingsCoordinator, coordinator), bound)
|
||||
first_name = bytes.fromhex("EC868DEC98B7").decode("utf-8")
|
||||
second_name = bytes.fromhex("EC9A94EAB8B0EBB3B4").decode("utf-8")
|
||||
|
||||
# Known catalog states stay as HA translation keys; the frontend renders
|
||||
# this confirmed Table_02 mapping as "AI Wash".
|
||||
assert entity.current_option == "69"
|
||||
assert entity.options == [
|
||||
"69",
|
||||
"6f",
|
||||
"75",
|
||||
"78",
|
||||
"01",
|
||||
"71",
|
||||
"96",
|
||||
"88",
|
||||
"70",
|
||||
"6d",
|
||||
"6a",
|
||||
"73",
|
||||
"76",
|
||||
"72",
|
||||
"6c",
|
||||
"6e",
|
||||
"6b",
|
||||
"77",
|
||||
"74",
|
||||
"79",
|
||||
first_name,
|
||||
second_name,
|
||||
]
|
||||
|
||||
await entity.async_select_option("6f")
|
||||
await entity.async_select_option(first_name)
|
||||
assert coordinator.writes == ["6F", "F1"]
|
||||
Reference in new issue
Block a user