diff --git a/custom_components/localthings/registry/by_type/vacuum_station.py b/custom_components/localthings/registry/by_type/vacuum_station.py index a4380fe..6d600e0 100644 --- a/custom_components/localthings/registry/by_type/vacuum_station.py +++ b/custom_components/localthings/registry/by_type/vacuum_station.py @@ -1,9 +1,7 @@ -"""Stick-vacuum clean/auto-empty station device registry (issue #131). +"""Stick-vacuum clean/auto-empty station device registry (issues #131 / #219). -See capabilities/vacuum_station.py's module docstring for why this only -covers the station's own dustbag/dustbin/UV-sanitize state and not any -vacuum-body control (suction, battery, cleaning mode) -- the diagnostics -dump this was built from reports none of that. +Station dustbag/dustbin/UV-sanitize state plus, when present (VS9700), +wand battery/charging via `/status/stick/vs/0`. No suction/room-map control. """ from ..capabilities import common, ignored, vacuum_station @@ -20,6 +18,7 @@ REGISTRY = DeviceRegistry( vacuum_station.DUSTBAG_USAGE, vacuum_station.DUSTBIN_SETTING, vacuum_station.CLEANSTATION_STATUS, + vacuum_station.STICK_BODY, ] ), ) diff --git a/custom_components/localthings/registry/capabilities/vacuum_station.py b/custom_components/localthings/registry/capabilities/vacuum_station.py index a75e56e..3fd660e 100644 --- a/custom_components/localthings/registry/capabilities/vacuum_station.py +++ b/custom_components/localthings/registry/capabilities/vacuum_station.py @@ -1,19 +1,14 @@ """Capabilities for the Samsung stick-vacuum clean/auto-empty station -(model A-VSKR-TP1-22-VS9500AL, "Bespoke Jet" clean station, issue #131). +(models A-VSKR-TP1-22-VS9500AL / A-VSWW-TP1-23-VS9700, issues #131 / #219). -The reporter's diagnostics dump shows no vacuum-body state at all (no -suction level, no battery, no cleaning-mode/room-mapping control, no -docked/undocked status even) -- only the clean station's own dustbag, -dustbin auto-empty settings, and UV-C sanitizing-cycle status. This -strongly suggests the WiFi/DTLS module lives in the station, not the -handheld stick: the station is the only "device" this integration's local -API can see, and the wand's own controls are unrelated hardware not -reachable this way. Modeled as its own device type -- these hrefs don't -overlap with any existing family, so there's no shared-href ambiguity to -resolve against another type (see registry/by_type/__init__.py's -docstring for that rule). +The WiFi/DTLS module lives in the clean station. Older VS9500 dumps +(#131) exposed only dustbag/dustbin/UV-C station state. VS9700 dumps +(#219) additionally expose `/status/stick/vs/0` with the wand's battery +%, cleaning/charging status, and BLE link -- still no suction/room-map +control. Modeled as its own device type -- these hrefs don't overlap with +any existing family (see registry/by_type/__init__.py's docstring). -Resources verified against the issue #131 diagnostics dump. +Resources verified against issue #131 and #219 diagnostics dumps. """ from ..capability import Capability @@ -156,3 +151,43 @@ CLEANSTATION_STATUS = Capability( ), ), ) + +# Wand body state reported through the station (VS9700 / issue #219). Absent +# on the older VS9500 dump (#131) -- discovery drops entities when the href +# is missing. +STICK_BODY = Capability( + href="/status/stick/vs/0", + poll_tier="warm", + entities=( + SensorDesc( + key="battery", + field="x.com.samsung.da.stickbattery", + device_class="battery", + state_class="measurement", + unit="%", + value_fn=int_or_none, + ), + BinarySensorDesc( + key="battery_charging", + field="x.com.samsung.da.stickcleaningstatus", + device_class="battery_charging", + value_fn=lambda v: v == "Charging", + ), + SensorDesc( + key="stick_cleaning_status", + field="x.com.samsung.da.stickcleaningstatus", + icon="mdi:vacuum", + ), + SensorDesc( + key="stick_operation_mode", + field="x.com.samsung.da.stickoperationmode", + icon="mdi:broom", + ), + BinarySensorDesc( + key="stick_ble_connected", + field="x.com.samsung.da.stickbleconnection", + device_class="connectivity", + value_fn=lambda v: v == "On", + ), + ), +) diff --git a/custom_components/localthings/translations/cs.json b/custom_components/localthings/translations/cs.json index 1b833b5..49b8ad4 100644 --- a/custom_components/localthings/translations/cs.json +++ b/custom_components/localthings/translations/cs.json @@ -108,6 +108,9 @@ }, "softener_low": { "name": "Málo aviváže" + }, + "stick_ble_connected": { + "name": "Tyč připojena přes BLE" } }, "button": { @@ -872,6 +875,12 @@ "stick_status": { "name": "Stav tyče" }, + "stick_operation_mode": { + "name": "Provozní režim tyče" + }, + "stick_cleaning_status": { + "name": "Stav čištění tyče" + }, "uvc_operation_time": { "name": "Doba provozu UV-C" }, diff --git a/custom_components/localthings/translations/de.json b/custom_components/localthings/translations/de.json index a2d33ee..92f50be 100644 --- a/custom_components/localthings/translations/de.json +++ b/custom_components/localthings/translations/de.json @@ -108,6 +108,9 @@ }, "remote_control": { "name": "Intelligente Steuerung" + }, + "stick_ble_connected": { + "name": "Stick per BLE verbunden" } }, "button": { @@ -872,6 +875,12 @@ "stick_status": { "name": "Stick-Status" }, + "stick_operation_mode": { + "name": "Stick-Betriebsmodus" + }, + "stick_cleaning_status": { + "name": "Stick-Reinigungsstatus" + }, "uvc_operation_time": { "name": "UV-C Betriebszeit" }, diff --git a/custom_components/localthings/translations/en.json b/custom_components/localthings/translations/en.json index 30839a7..0b3405a 100644 --- a/custom_components/localthings/translations/en.json +++ b/custom_components/localthings/translations/en.json @@ -108,6 +108,9 @@ }, "softener_low": { "name": "Softener low" + }, + "stick_ble_connected": { + "name": "Stick BLE connected" } }, "button": { @@ -872,6 +875,12 @@ "stick_status": { "name": "Stick status" }, + "stick_operation_mode": { + "name": "Stick operation mode" + }, + "stick_cleaning_status": { + "name": "Stick cleaning status" + }, "uvc_operation_time": { "name": "UV-C operation time" }, diff --git a/custom_components/localthings/translations/es.json b/custom_components/localthings/translations/es.json index 763d485..dba8a3b 100644 --- a/custom_components/localthings/translations/es.json +++ b/custom_components/localthings/translations/es.json @@ -304,6 +304,9 @@ }, "auto_clean_running": { "name": "Limpieza automática en curso" + }, + "stick_ble_connected": { + "name": "Aspiradora conectada por BLE" } }, "button": { @@ -1065,6 +1068,12 @@ "stick_status": { "name": "Estado de la aspiradora" }, + "stick_operation_mode": { + "name": "Modo de funcionamiento de la aspiradora" + }, + "stick_cleaning_status": { + "name": "Estado de limpieza de la aspiradora" + }, "uvc_operation_time": { "name": "Tiempo de funcionamiento UV-C" }, diff --git a/custom_components/localthings/translations/it.json b/custom_components/localthings/translations/it.json index d785c6f..45116c7 100644 --- a/custom_components/localthings/translations/it.json +++ b/custom_components/localthings/translations/it.json @@ -108,6 +108,9 @@ }, "softener_low": { "name": "Aggiungi ammorbidente" + }, + "stick_ble_connected": { + "name": "Scopa elettrica connessa via BLE" } }, "button": { @@ -872,6 +875,12 @@ "stick_status": { "name": "Stato scopa elettrica" }, + "stick_operation_mode": { + "name": "Modalità operativa scopa elettrica" + }, + "stick_cleaning_status": { + "name": "Stato pulizia scopa elettrica" + }, "uvc_operation_time": { "name": "Tempo funzionamento UV-C" }, diff --git a/custom_components/localthings/translations/ko.json b/custom_components/localthings/translations/ko.json index 540d48e..f051c67 100644 --- a/custom_components/localthings/translations/ko.json +++ b/custom_components/localthings/translations/ko.json @@ -108,6 +108,9 @@ }, "softener_low": { "name": "섬유유연제 부족" + }, + "stick_ble_connected": { + "name": "스틱 BLE 연결됨" } }, "button": { @@ -872,6 +875,12 @@ "stick_status": { "name": "스틱 청소기 상태" }, + "stick_operation_mode": { + "name": "스틱 작동 모드" + }, + "stick_cleaning_status": { + "name": "스틱 청소 상태" + }, "uvc_operation_time": { "name": "UV-C 작동 시간" }, diff --git a/custom_components/localthings/translations/nl.json b/custom_components/localthings/translations/nl.json index 4ed576e..c570311 100644 --- a/custom_components/localthings/translations/nl.json +++ b/custom_components/localthings/translations/nl.json @@ -108,6 +108,9 @@ }, "softener_low": { "name": "Wasverzachter bijna op" + }, + "stick_ble_connected": { + "name": "Steel via BLE verbonden" } }, "button": { @@ -872,6 +875,12 @@ "stick_status": { "name": "Status steel" }, + "stick_operation_mode": { + "name": "Bedieningsmodus steel" + }, + "stick_cleaning_status": { + "name": "Schoonmaakstatus steel" + }, "uvc_operation_time": { "name": "UV-C-bedrijfstijd" },