Address PR #251 review feedback: no invented English fallback text
washer_cycle_fallback no longer wraps an unrecognized code in an 'Unknown (0xNN)' label -- that baked untranslatable English into a component built to be fully translatable. It now only ever surfaces a device-provided personal-course name; an unrecognized standard code displays as its raw value, same as before PR #251. Also translates nl.json's '69'/'88' washer labels left in English (same review), and makes de.json's own 'smart' states consistent with the 'Intelligente Lüftung' translation already used for smartventilation.
This commit is contained in:
6 files changed
+24
-22
No files matched your search
@@ -95,7 +95,8 @@ class TestCourseHelpers:
|
||||
}
|
||||
assert laundry.personal_course_labels(resources) == {}
|
||||
|
||||
def test_washer_cycle_fallback_uses_labels_then_safe_unknown_text(self):
|
||||
def test_washer_cycle_fallback_only_labels_personal_courses(self):
|
||||
"""No invented English label for an unrecognized code (PR #251 review)."""
|
||||
resources = {
|
||||
"/wm/personalcourse/vs/0": {
|
||||
"x.com.samsung.da.courses": ["F1_0106EC868DEC98B7"],
|
||||
@@ -103,8 +104,8 @@ class TestCourseHelpers:
|
||||
}
|
||||
expected = bytes.fromhex("EC868DEC98B7").decode("utf-8")
|
||||
assert laundry.washer_cycle_fallback("F1", resources) == expected
|
||||
assert laundry.washer_cycle_fallback("69", resources) == "Unknown (0x69)"
|
||||
assert laundry.washer_cycle_fallback("6f", resources) == "Unknown (0x6F)"
|
||||
assert laundry.washer_cycle_fallback("69", resources) is None
|
||||
assert laundry.washer_cycle_fallback("6f", resources) is None
|
||||
assert laundry.washer_cycle_fallback("Normal", resources) is None
|
||||
|
||||
|
||||
|
||||
@@ -237,7 +237,7 @@ def test_confirmed_course_names_are_localized():
|
||||
},
|
||||
"nl": {
|
||||
"washer": (
|
||||
"AI Wash",
|
||||
"AI wassen",
|
||||
"Wol",
|
||||
"Spijkergoed",
|
||||
"Blouses",
|
||||
@@ -254,7 +254,7 @@ def test_confirmed_course_names_are_localized():
|
||||
"Katoen",
|
||||
"Spoelen + centrifugeren",
|
||||
"Alleen centrifugeren",
|
||||
"Pet Care",
|
||||
"Huisdierverzorging",
|
||||
),
|
||||
"dishwasher": (
|
||||
"Auto",
|
||||
|
||||
Reference in new issue
Block a user