Compare commits
23
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1493467c63 | ||
|
|
61ee2972dc | ||
|
|
3d5263d792 | ||
|
|
d6639c99d4 | ||
|
|
5d9b470d7e | ||
|
|
9800cd0aa8 | ||
|
|
3469f57080 | ||
|
|
f54daf3608 | ||
|
|
e49b61e01e | ||
|
|
dbe70ffc5b | ||
|
|
7d011bfe89 | ||
|
|
9199fb7711 | ||
|
|
6611f85958 | ||
|
|
8470853fb6 | ||
|
|
e942c822a6 | ||
|
|
4a376a98aa | ||
|
|
bc9d4f4cf5 | ||
|
|
10f2aac0bd | ||
|
|
0cc9d8e511 | ||
|
|
b586277031 | ||
|
|
2a0a9f32ee | ||
|
|
8dadea6796 | ||
|
|
0715eb0829 |
No files matched your search
@@ -41,6 +41,7 @@ from .registry.capabilities.airconditioner import (
|
|||||||
HREF_TEMP_CURRENT as TEMP_CURRENT_HREF,
|
HREF_TEMP_CURRENT as TEMP_CURRENT_HREF,
|
||||||
HREF_TEMP_DESIRED as TEMP_DESIRED_HREF,
|
HREF_TEMP_DESIRED as TEMP_DESIRED_HREF,
|
||||||
HREF_TEMP_CONTROL as TEMP_CONTROL_HREF,
|
HREF_TEMP_CONTROL as TEMP_CONTROL_HREF,
|
||||||
|
HREF_TEMPS_VS as TEMPS_VS_HREF,
|
||||||
HREF_WIND_STRENGTH as WIND_STRENGTH_HREF,
|
HREF_WIND_STRENGTH as WIND_STRENGTH_HREF,
|
||||||
HREF_WIND_DIRECTION as WIND_DIRECTION_HREF,
|
HREF_WIND_DIRECTION as WIND_DIRECTION_HREF,
|
||||||
HREF_CONVENIENT as CONVENIENT_HREF,
|
HREF_CONVENIENT as CONVENIENT_HREF,
|
||||||
@@ -125,6 +126,22 @@ def _num(value):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _temps_vs_item(rep: dict) -> dict:
|
||||||
|
"""First item of the vendor `/temperatures/vs/0` items[] array.
|
||||||
|
|
||||||
|
Newer AC firmware (Tizen Lite, oneUiVersion "7.0 Air conditioner", e.g.
|
||||||
|
model TP1X_DA-AC-RAC-01011) does NOT expose the OCF-standard
|
||||||
|
/temperature/current/0 + /temperature/desired/0 pair; it reports current
|
||||||
|
and target under a single `/temperatures/vs/0` resource whose
|
||||||
|
`x.com.samsung.da.items[0]` carries current/desired/minimum/maximum/
|
||||||
|
increment/unit. Returns {} when absent, so callers fall through cleanly.
|
||||||
|
"""
|
||||||
|
items = rep.get('x.com.samsung.da.items')
|
||||||
|
if isinstance(items, (list, tuple)) and items and isinstance(items[0], dict):
|
||||||
|
return items[0]
|
||||||
|
return {}
|
||||||
|
|
||||||
|
|
||||||
class LocalThingsClimate(LocalThingsEntity, ClimateEntity):
|
class LocalThingsClimate(LocalThingsEntity, ClimateEntity):
|
||||||
"""Composite climate entity for a Samsung air conditioner."""
|
"""Composite climate entity for a Samsung air conditioner."""
|
||||||
|
|
||||||
@@ -172,24 +189,41 @@ class LocalThingsClimate(LocalThingsEntity, ClimateEntity):
|
|||||||
|
|
||||||
# -- temperature --------------------------------------------------------
|
# -- temperature --------------------------------------------------------
|
||||||
|
|
||||||
|
def _temps_vs(self) -> dict:
|
||||||
|
"""Vendor `/temperatures/vs/0` items[0] (empty {} when absent)."""
|
||||||
|
return _temps_vs_item(self._rep(TEMPS_VS_HREF))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def temperature_unit(self) -> str:
|
def temperature_unit(self) -> str:
|
||||||
raw = self._rep(TEMP_DESIRED_HREF).get('units')
|
raw = self._rep(TEMP_DESIRED_HREF).get('units')
|
||||||
|
if raw is None:
|
||||||
|
raw = self._temps_vs().get('x.com.samsung.da.unit')
|
||||||
return (UnitOfTemperature.FAHRENHEIT
|
return (UnitOfTemperature.FAHRENHEIT
|
||||||
if normalize_temp_unit(raw, '°C') == '°F'
|
if normalize_temp_unit(raw, '°C') == '°F'
|
||||||
else UnitOfTemperature.CELSIUS)
|
else UnitOfTemperature.CELSIUS)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def current_temperature(self):
|
def current_temperature(self):
|
||||||
return _num(self._rep(TEMP_CURRENT_HREF).get('temperature'))
|
v = _num(self._rep(TEMP_CURRENT_HREF).get('temperature'))
|
||||||
|
if v is None:
|
||||||
|
v = _num(self._temps_vs().get('x.com.samsung.da.current'))
|
||||||
|
return v
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def target_temperature(self):
|
def target_temperature(self):
|
||||||
return _num(self._rep(TEMP_DESIRED_HREF).get('temperature'))
|
v = _num(self._rep(TEMP_DESIRED_HREF).get('temperature'))
|
||||||
|
if v is None:
|
||||||
|
v = _num(self._temps_vs().get('x.com.samsung.da.desired'))
|
||||||
|
return v
|
||||||
|
|
||||||
def _range(self) -> list | None:
|
def _range(self) -> list | None:
|
||||||
r = self._rep(TEMP_DESIRED_HREF).get('range')
|
r = self._rep(TEMP_DESIRED_HREF).get('range')
|
||||||
return r if (isinstance(r, (list, tuple)) and len(r) == 2) else None
|
if isinstance(r, (list, tuple)) and len(r) == 2:
|
||||||
|
return r
|
||||||
|
item = self._temps_vs()
|
||||||
|
lo = _num(item.get('x.com.samsung.da.minimum'))
|
||||||
|
hi = _num(item.get('x.com.samsung.da.maximum'))
|
||||||
|
return [lo, hi] if (lo is not None and hi is not None) else None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def min_temp(self) -> float:
|
def min_temp(self) -> float:
|
||||||
@@ -203,7 +237,10 @@ class LocalThingsClimate(LocalThingsEntity, ClimateEntity):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def target_temperature_step(self) -> float:
|
def target_temperature_step(self) -> float:
|
||||||
return _num(self._rep(TEMP_CONTROL_HREF).get('increment')) or 1.0
|
return (_num(self._rep(TEMP_CONTROL_HREF).get('increment'))
|
||||||
|
or _num(self._rep(TEMP_CONTROL_HREF).get('x.com.samsung.da.increment'))
|
||||||
|
or _num(self._temps_vs().get('x.com.samsung.da.increment'))
|
||||||
|
or 1.0)
|
||||||
|
|
||||||
# -- hvac mode ----------------------------------------------------------
|
# -- hvac mode ----------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import cbor2
|
|||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
|
from homeassistant.exceptions import ServiceValidationError
|
||||||
from homeassistant.helpers import issue_registry as ir
|
from homeassistant.helpers import issue_registry as ir
|
||||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
||||||
from homeassistant.helpers.device_registry import DeviceInfo
|
from homeassistant.helpers.device_registry import DeviceInfo
|
||||||
@@ -509,13 +510,23 @@ class LocalThingsCoordinator(DataUpdateCoordinator[dict[str, Any]]):
|
|||||||
|
|
||||||
async def async_send_command(self, bound_entity: BoundEntity,
|
async def async_send_command(self, bound_entity: BoundEntity,
|
||||||
payload: Any) -> None:
|
payload: Any) -> None:
|
||||||
"""Write a value to the device. Fire-and-forget style."""
|
"""Write a value to the device. Fire-and-forget style.
|
||||||
|
|
||||||
|
A description-level validate_fn (currently SwitchDesc only) runs
|
||||||
|
here rather than per-platform, so rejecting a write with a
|
||||||
|
user-facing message -- as opposed to write_fn's silent no-op below
|
||||||
|
-- is available to every platform for free."""
|
||||||
desc = bound_entity.desc
|
desc = bound_entity.desc
|
||||||
write_fn = getattr(desc, 'write_fn', None)
|
write_fn = getattr(desc, 'write_fn', None)
|
||||||
if write_fn is None:
|
if write_fn is None:
|
||||||
return
|
return
|
||||||
href = bound_entity.href
|
href = bound_entity.href
|
||||||
rep = self._cache.get(href or '') or {}
|
rep = self._cache.get(href or '') or {}
|
||||||
|
validate_fn = getattr(desc, 'validate_fn', None)
|
||||||
|
if validate_fn is not None:
|
||||||
|
error = validate_fn(payload, rep, self._cache.snapshot())
|
||||||
|
if error:
|
||||||
|
raise ServiceValidationError(error)
|
||||||
result = write_fn(payload, rep, href)
|
result = write_fn(payload, rep, href)
|
||||||
if result is None:
|
if result is None:
|
||||||
self._log.warning("write_fn rejected payload %r for %s", payload, href)
|
self._log.warning("write_fn rejected payload %r for %s", payload, href)
|
||||||
|
|||||||
@@ -12,5 +12,5 @@
|
|||||||
"pyOpenSSL>=23.0",
|
"pyOpenSSL>=23.0",
|
||||||
"smartthings-local>=0.1.0"
|
"smartthings-local>=0.1.0"
|
||||||
],
|
],
|
||||||
"version": "0.8.0"
|
"version": "0.9.0"
|
||||||
}
|
}
|
||||||
@@ -96,4 +96,9 @@ def for_device_by_model(model_num: str, description: str) -> Optional[DeviceRegi
|
|||||||
# a modelNum carrying the '_PRAC_' (Package Room Air Conditioner) token.
|
# a modelNum carrying the '_PRAC_' (Package Room Air Conditioner) token.
|
||||||
if key is None and '_PRAC_' in (model_num or ''):
|
if key is None and '_PRAC_' in (model_num or ''):
|
||||||
key = 'airconditioner'
|
key = 'airconditioner'
|
||||||
|
# Older/simpler RAC boards (e.g. TP2X_RAC_20K, issue #37) use the plain
|
||||||
|
# '_RAC_' token instead -- distinct from '_PRAC_' above (no overlap: the
|
||||||
|
# 'P' sits between the underscore and 'RAC' in that token).
|
||||||
|
if key is None and '_RAC_' in (model_num or ''):
|
||||||
|
key = 'airconditioner'
|
||||||
return _REGISTRY_BY_KEY.get(key) if key else None
|
return _REGISTRY_BY_KEY.get(key) if key else None
|
||||||
@@ -3,27 +3,28 @@
|
|||||||
The first device whose core controls surface as a single composite HA `climate`
|
The first device whose core controls surface as a single composite HA `climate`
|
||||||
entity (see capabilities/airconditioner.py and climate.py). Power/mode/temp/wind
|
entity (see capabilities/airconditioner.py and climate.py). Power/mode/temp/wind
|
||||||
are consumed by that entity rather than exposed as separate switches/selects, so
|
are consumed by that entity rather than exposed as separate switches/selects, so
|
||||||
this registry deliberately does NOT include the common POWER caps -- on/off is
|
this registry includes *common.UNIVERSAL but deliberately NOT common.POWER --
|
||||||
the climate entity's HVACMode.OFF / TURN_ON/OFF.
|
on/off is the climate entity's HVACMode.OFF / TURN_ON/OFF. See common.POWER's
|
||||||
|
own comment in capabilities/common.py for why it's excluded.
|
||||||
|
|
||||||
Reuses common.ALARMS + common.ENERGY_METER, fridge.FIRMWARE_UPDATE (as every
|
Reuses dishwasher.DIAGNOSIS for /diagnosis/vs/0.
|
||||||
registry does), and dishwasher.DIAGNOSIS for /diagnosis/vs/0.
|
|
||||||
"""
|
"""
|
||||||
from ..capabilities import airconditioner, common, dishwasher, fridge, ignored
|
from ..capabilities import airconditioner, common, dishwasher, ignored
|
||||||
from ._base import DeviceRegistry, _build
|
from ._base import DeviceRegistry, _build
|
||||||
|
|
||||||
REGISTRY = DeviceRegistry(
|
REGISTRY = DeviceRegistry(
|
||||||
name='airconditioner',
|
name='airconditioner',
|
||||||
capabilities=_build([
|
capabilities=_build([
|
||||||
*ignored.IGNORED,
|
*ignored.IGNORED,
|
||||||
common.ALARMS,
|
*common.UNIVERSAL,
|
||||||
common.ENERGY_METER,
|
|
||||||
fridge.FIRMWARE_UPDATE,
|
|
||||||
dishwasher.DIAGNOSIS,
|
dishwasher.DIAGNOSIS,
|
||||||
airconditioner.CLIMATE,
|
airconditioner.CLIMATE,
|
||||||
airconditioner.AIR_PURIFY,
|
airconditioner.AIR_PURIFY,
|
||||||
airconditioner.AUTO_CLEAN,
|
airconditioner.AUTO_CLEAN,
|
||||||
airconditioner.AIR_FILTER,
|
airconditioner.AIR_FILTER,
|
||||||
|
airconditioner.DISPLAY_LIGHT,
|
||||||
|
airconditioner.MUTE_ONCE,
|
||||||
|
airconditioner.CURRENT_LIMIT,
|
||||||
*airconditioner.COVERAGE,
|
*airconditioner.COVERAGE,
|
||||||
]),
|
]),
|
||||||
)
|
)
|
||||||
@@ -1,19 +1,13 @@
|
|||||||
"""Dishwasher device registry."""
|
"""Dishwasher device registry."""
|
||||||
from ..capabilities import common, dishwasher, fridge, ignored, laundry, operational
|
from ..capabilities import common, dishwasher, ignored, laundry, operational
|
||||||
from ._base import DeviceRegistry, _build
|
from ._base import DeviceRegistry, _build
|
||||||
|
|
||||||
REGISTRY = DeviceRegistry(
|
REGISTRY = DeviceRegistry(
|
||||||
name='dishwasher',
|
name='dishwasher',
|
||||||
capabilities=_build([
|
capabilities=_build([
|
||||||
*ignored.IGNORED,
|
*ignored.IGNORED,
|
||||||
common.POWER_GENERIC,
|
*common.UNIVERSAL,
|
||||||
common.POWER_VS_FALLBACK,
|
*common.POWER,
|
||||||
common.KIDS_LOCK_GENERIC,
|
|
||||||
common.KIDS_LOCK_VS_FALLBACK,
|
|
||||||
common.REMOTE_CONTROL_GENERIC,
|
|
||||||
common.REMOTE_CONTROL_VS_FALLBACK,
|
|
||||||
common.ALARMS,
|
|
||||||
common.ENERGY_METER,
|
|
||||||
common.WATER_METER,
|
common.WATER_METER,
|
||||||
common.WATER_FILTER,
|
common.WATER_FILTER,
|
||||||
operational.OPERATIONAL_STATE,
|
operational.OPERATIONAL_STATE,
|
||||||
@@ -25,6 +19,5 @@ REGISTRY = DeviceRegistry(
|
|||||||
laundry.DOOR_LED,
|
laundry.DOOR_LED,
|
||||||
laundry.SOUND_MODE,
|
laundry.SOUND_MODE,
|
||||||
laundry.SOUND_VOLUME,
|
laundry.SOUND_VOLUME,
|
||||||
fridge.FIRMWARE_UPDATE,
|
|
||||||
]),
|
]),
|
||||||
)
|
)
|
||||||
@@ -9,21 +9,15 @@ objects the washer registry uses -- washer and dryer expose the same
|
|||||||
DA_WM_-family surface, so they stay consistent instead of each carrying a
|
DA_WM_-family surface, so they stay consistent instead of each carrying a
|
||||||
bespoke variant.
|
bespoke variant.
|
||||||
"""
|
"""
|
||||||
from ..capabilities import common, dryer, fridge, ignored, laundry, operational
|
from ..capabilities import common, dryer, ignored, laundry, operational
|
||||||
from ._base import DeviceRegistry, _build
|
from ._base import DeviceRegistry, _build
|
||||||
|
|
||||||
REGISTRY = DeviceRegistry(
|
REGISTRY = DeviceRegistry(
|
||||||
name='dryer',
|
name='dryer',
|
||||||
capabilities=_build([
|
capabilities=_build([
|
||||||
*ignored.IGNORED,
|
*ignored.IGNORED,
|
||||||
common.POWER_GENERIC,
|
*common.UNIVERSAL,
|
||||||
common.POWER_VS_FALLBACK,
|
*common.POWER,
|
||||||
common.KIDS_LOCK_GENERIC,
|
|
||||||
common.KIDS_LOCK_VS_FALLBACK,
|
|
||||||
common.REMOTE_CONTROL_GENERIC,
|
|
||||||
common.REMOTE_CONTROL_VS_FALLBACK,
|
|
||||||
common.ALARMS,
|
|
||||||
common.ENERGY_METER,
|
|
||||||
operational.OPERATIONAL_STATE,
|
operational.OPERATIONAL_STATE,
|
||||||
laundry.DOOR_LED,
|
laundry.DOOR_LED,
|
||||||
laundry.SOUND_MODE,
|
laundry.SOUND_MODE,
|
||||||
@@ -32,6 +26,5 @@ REGISTRY = DeviceRegistry(
|
|||||||
dryer.DRYER_SETTINGS,
|
dryer.DRYER_SETTINGS,
|
||||||
dryer.DRYER_COURSE,
|
dryer.DRYER_COURSE,
|
||||||
dryer.DRYER_DIAGNOSIS,
|
dryer.DRYER_DIAGNOSIS,
|
||||||
fridge.FIRMWARE_UPDATE,
|
|
||||||
]),
|
]),
|
||||||
)
|
)
|
||||||
@@ -1,24 +1,18 @@
|
|||||||
"""Oven device registry."""
|
"""Oven device registry."""
|
||||||
from ..capabilities import common, fridge, ignored, oven
|
from ..capabilities import common, ignored, oven
|
||||||
from ._base import DeviceRegistry, _build
|
from ._base import DeviceRegistry, _build
|
||||||
|
|
||||||
REGISTRY = DeviceRegistry(
|
REGISTRY = DeviceRegistry(
|
||||||
name='oven',
|
name='oven',
|
||||||
capabilities=_build([
|
capabilities=_build([
|
||||||
*ignored.IGNORED,
|
*ignored.IGNORED,
|
||||||
common.POWER_GENERIC,
|
*common.UNIVERSAL,
|
||||||
common.POWER_VS_FALLBACK,
|
*common.POWER,
|
||||||
common.KIDS_LOCK_GENERIC,
|
|
||||||
common.KIDS_LOCK_VS_FALLBACK,
|
|
||||||
common.REMOTE_CONTROL_GENERIC,
|
|
||||||
common.REMOTE_CONTROL_VS_FALLBACK,
|
|
||||||
common.ALARMS,
|
|
||||||
oven.OVEN_CAVITY,
|
oven.OVEN_CAVITY,
|
||||||
oven.OVEN_SETPOINT,
|
oven.OVEN_SETPOINT,
|
||||||
oven.OVEN_MODE,
|
oven.OVEN_MODE,
|
||||||
oven.OVEN_OPERATIONAL_STATE,
|
oven.OVEN_OPERATIONAL_STATE,
|
||||||
oven.OVEN_DOOR,
|
oven.OVEN_DOOR,
|
||||||
oven.OVEN_CONNECTED,
|
oven.OVEN_CONNECTED,
|
||||||
fridge.FIRMWARE_UPDATE,
|
|
||||||
]),
|
]),
|
||||||
)
|
)
|
||||||
@@ -6,16 +6,10 @@ REGISTRY = DeviceRegistry(
|
|||||||
name='refrigerator',
|
name='refrigerator',
|
||||||
capabilities=_build([
|
capabilities=_build([
|
||||||
*ignored.IGNORED,
|
*ignored.IGNORED,
|
||||||
common.POWER_GENERIC,
|
*common.UNIVERSAL,
|
||||||
common.POWER_VS_FALLBACK,
|
*common.POWER,
|
||||||
fridge.STATUS_LOCK,
|
fridge.STATUS_LOCK,
|
||||||
fridge.DOOR_ALERT,
|
fridge.DOOR_ALERT,
|
||||||
common.KIDS_LOCK_GENERIC,
|
|
||||||
common.KIDS_LOCK_VS_FALLBACK,
|
|
||||||
common.REMOTE_CONTROL_GENERIC,
|
|
||||||
common.REMOTE_CONTROL_VS_FALLBACK,
|
|
||||||
common.ALARMS,
|
|
||||||
common.ENERGY_METER,
|
|
||||||
common.WATER_FILTER,
|
common.WATER_FILTER,
|
||||||
dishwasher.DIAGNOSIS,
|
dishwasher.DIAGNOSIS,
|
||||||
fridge.ICEMAKER_NIGHTTIME,
|
fridge.ICEMAKER_NIGHTTIME,
|
||||||
@@ -28,11 +22,9 @@ REGISTRY = DeviceRegistry(
|
|||||||
fridge.SABBATH,
|
fridge.SABBATH,
|
||||||
fridge.BEVERAGE_ZONE,
|
fridge.BEVERAGE_ZONE,
|
||||||
fridge.PANTRY_ZONE,
|
fridge.PANTRY_ZONE,
|
||||||
fridge.FIRMWARE_UPDATE,
|
|
||||||
fridge.DEFROST_DELAY,
|
fridge.DEFROST_DELAY,
|
||||||
fridge.DEFROST_DELAY_NATIVE_DUPLICATE,
|
fridge.DEFROST_DELAY_NATIVE_DUPLICATE,
|
||||||
fridge.DEFROST_BLOCK_STATUS,
|
fridge.DEFROST_BLOCK_STATUS,
|
||||||
fridge.SELF_CHECK,
|
|
||||||
fridge.DOORS_FALLBACK,
|
fridge.DOORS_FALLBACK,
|
||||||
fridge.TEMPERATURES_FALLBACK,
|
fridge.TEMPERATURES_FALLBACK,
|
||||||
fridge.ICEMAKER_STATUS_FALLBACK,
|
fridge.ICEMAKER_STATUS_FALLBACK,
|
||||||
|
|||||||
@@ -1,26 +1,19 @@
|
|||||||
"""Washer device registry."""
|
"""Washer device registry."""
|
||||||
from ..capabilities import common, dishwasher, fridge, ignored, laundry, operational, washer
|
from ..capabilities import common, dishwasher, ignored, laundry, operational, washer
|
||||||
from ._base import DeviceRegistry, _build
|
from ._base import DeviceRegistry, _build
|
||||||
|
|
||||||
REGISTRY = DeviceRegistry(
|
REGISTRY = DeviceRegistry(
|
||||||
name='washer',
|
name='washer',
|
||||||
capabilities=_build([
|
capabilities=_build([
|
||||||
*ignored.IGNORED,
|
*ignored.IGNORED,
|
||||||
common.POWER_GENERIC,
|
*common.UNIVERSAL,
|
||||||
common.POWER_VS_FALLBACK,
|
*common.POWER,
|
||||||
common.KIDS_LOCK_GENERIC,
|
|
||||||
common.KIDS_LOCK_VS_FALLBACK,
|
|
||||||
common.REMOTE_CONTROL_GENERIC,
|
|
||||||
common.REMOTE_CONTROL_VS_FALLBACK,
|
|
||||||
washer.WASHER_SETTINGS,
|
washer.WASHER_SETTINGS,
|
||||||
washer.WASHER_COURSE,
|
washer.WASHER_COURSE,
|
||||||
laundry.BUZZER_SOUND,
|
laundry.BUZZER_SOUND,
|
||||||
laundry.JOB_BEGINNING_STATUS,
|
laundry.JOB_BEGINNING_STATUS,
|
||||||
common.ALARMS,
|
|
||||||
common.ENERGY_METER,
|
|
||||||
common.WATER_METER,
|
common.WATER_METER,
|
||||||
operational.OPERATIONAL_STATE,
|
operational.OPERATIONAL_STATE,
|
||||||
dishwasher.DIAGNOSIS,
|
dishwasher.DIAGNOSIS,
|
||||||
fridge.FIRMWARE_UPDATE,
|
|
||||||
]),
|
]),
|
||||||
)
|
)
|
||||||
@@ -15,7 +15,7 @@ different schema (see capabilities/__init__.py). They live only in the AC
|
|||||||
by_type registry.
|
by_type registry.
|
||||||
"""
|
"""
|
||||||
from ..capability import Capability
|
from ..capability import Capability
|
||||||
from ..entities import ClimateDesc, SensorDesc, SwitchDesc
|
from ..entities import BinarySensorDesc, ClimateDesc, SensorDesc, SwitchDesc
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Canonical AC resource hrefs. The climate entity (climate.py) binds the
|
# Canonical AC resource hrefs. The climate entity (climate.py) binds the
|
||||||
@@ -34,10 +34,12 @@ HREF_TEMP_CONTROL = '/temperature/control/vs/0' # target_temperature_step
|
|||||||
HREF_WIND_STRENGTH = '/wind/strength/vs/0' # fan_mode
|
HREF_WIND_STRENGTH = '/wind/strength/vs/0' # fan_mode
|
||||||
HREF_WIND_DIRECTION = '/wind/direction/vs/0' # swing_mode
|
HREF_WIND_DIRECTION = '/wind/direction/vs/0' # swing_mode
|
||||||
HREF_CONVENIENT = '/mode/convenient/vs/0' # preset_mode
|
HREF_CONVENIENT = '/mode/convenient/vs/0' # preset_mode
|
||||||
|
HREF_TEMPS_VS = '/temperatures/vs/0' # vendor temp fallback (items[] array)
|
||||||
|
|
||||||
CLIMATE_CONSUMED_HREFS = [
|
CLIMATE_CONSUMED_HREFS = [
|
||||||
HREF_POWER, HREF_POWER_VS, HREF_TEMP_CURRENT, HREF_TEMP_DESIRED,
|
HREF_POWER, HREF_POWER_VS, HREF_TEMP_CURRENT, HREF_TEMP_DESIRED,
|
||||||
HREF_TEMP_CONTROL, HREF_WIND_STRENGTH, HREF_WIND_DIRECTION, HREF_CONVENIENT,
|
HREF_TEMP_CONTROL, HREF_TEMPS_VS, HREF_WIND_STRENGTH, HREF_WIND_DIRECTION,
|
||||||
|
HREF_CONVENIENT,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@@ -146,6 +148,57 @@ AIR_FILTER = Capability(
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
DISPLAY_LIGHT = Capability(
|
||||||
|
href='/light/vs/0',
|
||||||
|
poll_tier='cold',
|
||||||
|
entities=(
|
||||||
|
SwitchDesc(key='display_light', field='mode',
|
||||||
|
name='Display light', icon='mdi:led-on',
|
||||||
|
entity_category='config',
|
||||||
|
value_fn=lambda v: v == 'On',
|
||||||
|
write_fn=lambda p, rep, href=None: (
|
||||||
|
['light', 'vs', '0'],
|
||||||
|
{'mode': 'On' if p == 'On' else 'Off'})),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
# Confirmed against issue #38's dump (TP1X_DA-AC-RAC-01001_0000): a single
|
||||||
|
# boolean field, no vendor prefix, mirroring the On/Off convention used
|
||||||
|
# throughout the rest of this API.
|
||||||
|
MUTE_ONCE = Capability(
|
||||||
|
href='/option/muteonce/vs/0',
|
||||||
|
poll_tier='warm',
|
||||||
|
entities=(
|
||||||
|
SwitchDesc(key='mute_once', field='muteonce',
|
||||||
|
name='Mute once', icon='mdi:volume-mute',
|
||||||
|
entity_category='config',
|
||||||
|
value_fn=lambda v: v == 'On',
|
||||||
|
write_fn=lambda p, rep, href=None: (
|
||||||
|
['option', 'muteonce', 'vs', '0'],
|
||||||
|
{'muteonce': 'On' if p == 'On' else 'Off'})),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
# Circuit-breaker current-limit setting (issue #38, TP1X board): `operation`
|
||||||
|
# toggles the limiter and `modes` picks a level out of `supportedModes`
|
||||||
|
# (seen as '3'..'9'). No vendor field-name prefix and no unit/label in the
|
||||||
|
# dump to confirm what the levels mean (amps vs. an abstract tier) --
|
||||||
|
# exposed read-only per the 'don't guess' rule rather than risking an
|
||||||
|
# unverified write to live HVAC hardware.
|
||||||
|
CURRENT_LIMIT = Capability(
|
||||||
|
href='/electriccurrent/vs/0',
|
||||||
|
poll_tier='cold',
|
||||||
|
entities=(
|
||||||
|
BinarySensorDesc(key='current_limit_enabled', field='operation',
|
||||||
|
name='Current limit enabled', icon='mdi:current-ac',
|
||||||
|
entity_category='diagnostic',
|
||||||
|
value_fn=lambda v: v == 'On'),
|
||||||
|
SensorDesc(key='current_limit_level', field='modes',
|
||||||
|
name='Current limit level', icon='mdi:current-ac',
|
||||||
|
entity_category='diagnostic'),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# AC-scoped coverage: the CLIMATE_CONSUMED_HREFS above (read by the climate
|
# AC-scoped coverage: the CLIMATE_CONSUMED_HREFS above (read by the climate
|
||||||
# entity) plus vendor duplicates / all-zero-ambiguous / plumbing resources.
|
# entity) plus vendor duplicates / all-zero-ambiguous / plumbing resources.
|
||||||
@@ -155,8 +208,6 @@ AIR_FILTER = Capability(
|
|||||||
# bound so discover() reports no coverage gap.
|
# bound so discover() reports no coverage gap.
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
_AC_IGNORED = [
|
_AC_IGNORED = [
|
||||||
# Vendor superset that duplicates the OCF /temperature/current+desired pair.
|
|
||||||
'/temperatures/vs/0',
|
|
||||||
# All-zero and ambiguously encoded on this model (2-value arrays); the
|
# All-zero and ambiguously encoded on this model (2-value arrays); the
|
||||||
# 'don't guess' rule -- leave unmodeled rather than invent entities.
|
# 'don't guess' rule -- leave unmodeled rather than invent entities.
|
||||||
'/sensors/vs/0',
|
'/sensors/vs/0',
|
||||||
@@ -164,6 +215,24 @@ _AC_IGNORED = [
|
|||||||
'/humidity/vs/0',
|
'/humidity/vs/0',
|
||||||
# Presence-personalization plumbing (empty item list here).
|
# Presence-personalization plumbing (empty item list here).
|
||||||
'/personality/presence/vs/0',
|
'/personality/presence/vs/0',
|
||||||
|
# --- TP1X/TP2X-class housekeeping / opaque blobs. These carry no
|
||||||
|
# user-actionable state or no documented write contract, so per the
|
||||||
|
# 'don't guess' rule they are ignored rather than modeled.
|
||||||
|
# /option/muteonce/vs/0 and /selfcheck/vs/0 are deliberately NOT here --
|
||||||
|
# see MUTE_ONCE above and common.SELF_CHECK (via common.UNIVERSAL) in
|
||||||
|
# the by_type registry, both of which have a confirmed, cleanly
|
||||||
|
# modelable contract.
|
||||||
|
'/airlevelcheck/vs/0', # periodic air-quality sensing scheduler plumbing
|
||||||
|
'/aisleep/vs/0', # AI-sleep feedback state (no actionable control)
|
||||||
|
'/availablecontrolsets/vs/0', # opaque hex-encoded control-set bitmap
|
||||||
|
'/da/softreset/vs/0', # soft-reset trigger plumbing
|
||||||
|
'/keepnormalstate/vs/0', # internal keep-normal flag
|
||||||
|
'/mds/absencemonitoring/vs/0', # motion-detection sensor plumbing (empty here)
|
||||||
|
'/mds/absencestate/vs/0', # motion-detection state (empty here)
|
||||||
|
'/remotedatacontrol/vs/0', # remote data-control session status
|
||||||
|
'/remotetemperature/vs/0', # external temp-sensor feed (unset on this unit)
|
||||||
|
'/reserverulesets/vs/0', # opaque hex-encoded schedule reservation blob
|
||||||
|
'/welcome/temperature/vs/0', # welcome-cooling plumbing
|
||||||
]
|
]
|
||||||
|
|
||||||
# Built as bare no-entity caps; folded into the AC registry (not global).
|
# Built as bare no-entity caps; folded into the AC registry (not global).
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ against live device dumps:
|
|||||||
/filter/waterfilter/vs/0 -> x.com.samsung.da.filterUsage / filterStatus
|
/filter/waterfilter/vs/0 -> x.com.samsung.da.filterUsage / filterStatus
|
||||||
"""
|
"""
|
||||||
from ..capability import Capability
|
from ..capability import Capability
|
||||||
from ..entities import BinarySensorDesc, SensorDesc, SwitchDesc
|
from ..entities import (
|
||||||
|
BinarySensorDesc, ButtonDesc, SelectDesc, SensorDesc, SwitchDesc,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def _num(v):
|
def _num(v):
|
||||||
@@ -231,3 +233,162 @@ WATER_FILTER = Capability(
|
|||||||
name='Filter status', icon='mdi:filter-check'),
|
name='Filter status', icon='mdi:filter-check'),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# AI energy-saving level -- '0' is off, and supportedAiLevel lists the
|
||||||
|
# additional level(s) the device offers ('1' meaning just "on" on most
|
||||||
|
# hardware, but multi-level boards have been reported). Verified cross-family:
|
||||||
|
# fridge (issue #21) and washer (issue #40) both expose this href.
|
||||||
|
#
|
||||||
|
# supportedAiLevel is a single-entry list on most captured hardware, where a
|
||||||
|
# select would offer only one real choice against an implicit "off" -- shown
|
||||||
|
# as a switch instead. '0' itself is never in supportedAiLevel but has been
|
||||||
|
# observed live as the off value of aiLevel, so the select synthesizes it
|
||||||
|
# back in as an explicit option rather than leaving no way to turn off.
|
||||||
|
#
|
||||||
|
# No translation_key: aiLevel's values are plain digit strings, and
|
||||||
|
# select.py's _display() already renders an untranslated numeric string
|
||||||
|
# as-is -- there's nothing a strings.json entry adds that's worth maintaining
|
||||||
|
# against an unknown, growing number of future levels.
|
||||||
|
|
||||||
|
|
||||||
|
def _ai_energy_supported_levels(rep):
|
||||||
|
"""supportedAiLevel as a list -- a stray scalar (e.g. a string) must not
|
||||||
|
be len()-checked as if it were a list."""
|
||||||
|
sl = rep.get('supportedAiLevel')
|
||||||
|
return list(sl) if isinstance(sl, (list, tuple)) else []
|
||||||
|
|
||||||
|
|
||||||
|
def _ai_energy_level_options(resources):
|
||||||
|
rep = resources.get('/energy/ailevel/vs/0') or {}
|
||||||
|
return ['0', *_ai_energy_supported_levels(rep)]
|
||||||
|
|
||||||
|
|
||||||
|
def _ai_energy_level_write(p, rep, href=None):
|
||||||
|
return ['energy', 'ailevel', 'vs', '0'], {'aiLevel': p}
|
||||||
|
|
||||||
|
|
||||||
|
def _ai_energy_level_switch_write(p, rep, href=None):
|
||||||
|
levels = _ai_energy_supported_levels(rep)
|
||||||
|
on_level = levels[0] if levels else '1'
|
||||||
|
return ['energy', 'ailevel', 'vs', '0'], {'aiLevel': on_level if p == 'On' else '0'}
|
||||||
|
|
||||||
|
|
||||||
|
AI_ENERGY_LEVEL = Capability(
|
||||||
|
href='/energy/ailevel/vs/0',
|
||||||
|
poll_tier='cold',
|
||||||
|
entities=(
|
||||||
|
# No `not rep` stub carve-out on either side, unlike most exists_fn
|
||||||
|
# gates in this file -- entity creation only ever runs once, against
|
||||||
|
# whichever snapshot happens to be current the moment platforms are
|
||||||
|
# set up (see entity._is_included / __init__.py's
|
||||||
|
# async_config_entry_first_refresh-before-forward-entry-setups
|
||||||
|
# ordering), while flatten() re-evaluates exists_fn every poll
|
||||||
|
# against live data. Both descriptors share key='ai_energy_level',
|
||||||
|
# so if a stub carve-out let one of them win at setup time while the
|
||||||
|
# other wins once real data lands, flatten() would feed the
|
||||||
|
# instantiated entity a value shaped for the other platform (e.g. a
|
||||||
|
# bool into a Select). Requiring real, populated data on both sides
|
||||||
|
# keeps the entity-creation decision and the live-value decision in
|
||||||
|
# permanent agreement -- the cost is this entity doesn't appear
|
||||||
|
# until a reload if the device's very first poll stubs this
|
||||||
|
# cold-tier href, the same reload already required to fix which
|
||||||
|
# platform got picked in that case.
|
||||||
|
SwitchDesc(key='ai_energy_level', field='aiLevel',
|
||||||
|
name='AI energy level', icon='mdi:leaf',
|
||||||
|
entity_category='config',
|
||||||
|
value_fn=lambda v: v != '0',
|
||||||
|
exists_fn=lambda rep, resources: (
|
||||||
|
len(_ai_energy_supported_levels(rep)) == 1),
|
||||||
|
write_fn=_ai_energy_level_switch_write),
|
||||||
|
SelectDesc(key='ai_energy_level', field='aiLevel',
|
||||||
|
name='AI energy level', icon='mdi:leaf',
|
||||||
|
entity_category='config',
|
||||||
|
options=_ai_energy_level_options,
|
||||||
|
exists_fn=lambda rep, resources: (
|
||||||
|
len(_ai_energy_supported_levels(rep)) > 1),
|
||||||
|
write_fn=_ai_energy_level_write),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
FIRMWARE_UPDATE = Capability(
|
||||||
|
href='/otninformation/vs/0',
|
||||||
|
poll_tier='cold',
|
||||||
|
entities=(
|
||||||
|
BinarySensorDesc(
|
||||||
|
key='firmware_update',
|
||||||
|
field='x.com.samsung.da.newVersionAvailable',
|
||||||
|
name='Firmware update available',
|
||||||
|
device_class='update',
|
||||||
|
entity_category='diagnostic',
|
||||||
|
value_fn=lambda v: str(v).lower() == 'true' if v is not None else None,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
SELF_CHECK = Capability(
|
||||||
|
href='/selfcheck/vs/0',
|
||||||
|
poll_tier='cold',
|
||||||
|
entities=(
|
||||||
|
SensorDesc(key='selfcheck_status', field='x.com.samsung.da.status',
|
||||||
|
name='Self-check status', icon='mdi:stethoscope',
|
||||||
|
entity_category='diagnostic'),
|
||||||
|
SensorDesc(key='selfcheck_result', field='x.com.samsung.da.result',
|
||||||
|
name='Self-check result', icon='mdi:clipboard-check-outline',
|
||||||
|
entity_category='diagnostic'),
|
||||||
|
# List of error codes from the last self-check; joined for display.
|
||||||
|
# Not every fridge reports the field, hence the exists_fn.
|
||||||
|
SensorDesc(key='selfcheck_error', field='x.com.samsung.da.error',
|
||||||
|
name='Self-check error', icon='mdi:alert-circle-outline',
|
||||||
|
entity_category='diagnostic',
|
||||||
|
exists_fn=lambda rep, resources: (
|
||||||
|
not rep or 'x.com.samsung.da.error' in rep),
|
||||||
|
value_fn=lambda v: (', '.join(v) if v else None) if isinstance(v, list) else v),
|
||||||
|
ButtonDesc(key='selfcheck_start', field='', name='Start self-check',
|
||||||
|
payload='Start', icon='mdi:play-circle-outline',
|
||||||
|
entity_category='diagnostic',
|
||||||
|
write_fn=lambda p, rep, href=None: (
|
||||||
|
['selfcheck', 'vs', '0'], {'x.com.samsung.da.status': p})),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Cross-family bundles, unpacked into every by_type registry's _build([...])
|
||||||
|
# call the same way ignored.IGNORED is (*common.UNIVERSAL / *common.POWER).
|
||||||
|
# discover() only binds a capability whose href is actually present in a
|
||||||
|
# given device's resource dump, so listing one here for a family that
|
||||||
|
# doesn't expose the href is a no-op, not a phantom entity -- see the
|
||||||
|
# adding-device-support skill's coverage-discipline section.
|
||||||
|
#
|
||||||
|
# UNIVERSAL holds every capability with no known family that both (a) has
|
||||||
|
# the href and (b) needs to model it some other way -- broadening one of
|
||||||
|
# these to a new family is a safe, harmless guess (issue #40's AI energy
|
||||||
|
# level: 2 of 6 families confirmed, blanket-added everywhere else).
|
||||||
|
#
|
||||||
|
# POWER is kept separate -- airconditioner is the one family that opts out
|
||||||
|
# of it. Canonical reason (see by_type/airconditioner.py and its test for
|
||||||
|
# pointers back here, not restatements): AC's climate entity already owns
|
||||||
|
# /power/0 and /power/vs/0 via bare, no-entity Capability objects
|
||||||
|
# (airconditioner.COVERAGE), and a second, real POWER_GENERIC/
|
||||||
|
# POWER_VS_FALLBACK cap on the same href would make _build() raise (a href
|
||||||
|
# with >1 cap must have every cap discriminated by rt_filter/match_fn, and
|
||||||
|
# the bare COVERAGE cap has neither). Kids-lock/remote-control don't have
|
||||||
|
# this conflict -- no AC dump has ever reported those hrefs -- so they stay
|
||||||
|
# in UNIVERSAL.
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
UNIVERSAL = (
|
||||||
|
ALARMS,
|
||||||
|
ENERGY_METER,
|
||||||
|
FIRMWARE_UPDATE,
|
||||||
|
SELF_CHECK,
|
||||||
|
AI_ENERGY_LEVEL,
|
||||||
|
KIDS_LOCK_GENERIC,
|
||||||
|
KIDS_LOCK_VS_FALLBACK,
|
||||||
|
REMOTE_CONTROL_GENERIC,
|
||||||
|
REMOTE_CONTROL_VS_FALLBACK,
|
||||||
|
)
|
||||||
|
|
||||||
|
POWER = (
|
||||||
|
POWER_GENERIC,
|
||||||
|
POWER_VS_FALLBACK,
|
||||||
|
)
|
||||||
@@ -8,7 +8,7 @@ wash, auto release dry) are read locally here.
|
|||||||
"""
|
"""
|
||||||
from ..capability import Capability
|
from ..capability import Capability
|
||||||
from ..entities import ButtonDesc, SelectDesc, SensorDesc, SwitchDesc
|
from ..entities import ButtonDesc, SelectDesc, SensorDesc, SwitchDesc
|
||||||
from .laundry import cycle_select, option_value, replace_in_options
|
from .laundry import bool_option_switch, cycle_select
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# /dishwasher/vs/0 — cycle wash/dry settings
|
# /dishwasher/vs/0 — cycle wash/dry settings
|
||||||
@@ -35,49 +35,20 @@ DISHWASHER_SETTINGS = Capability(
|
|||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# /course/vs/0 — cycle selection (shared laundry.cycle_select) plus the
|
# /course/vs/0 — cycle selection (shared laundry.cycle_select) plus the
|
||||||
# dishwasher-only StormWashZone / AutoDoorRelease toggles that ride in the
|
# dishwasher-only StormWashZone / AutoDoorRelease toggles that ride in the
|
||||||
# same options array. Course display names live in translations under
|
# same options array (shared laundry.bool_option_switch, same options[]
|
||||||
|
# boolean-toggle contract washer's bubble-soak/pre-wash/intensive switches
|
||||||
|
# use). Course display names live in translations under
|
||||||
# entity.select.dishwasher_cycle (see laundry.cycle_select).
|
# entity.select.dishwasher_cycle (see laundry.cycle_select).
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
def _storm_wash_write(p, rep, href=None):
|
|
||||||
if p not in ('On', 'Off'):
|
|
||||||
return None
|
|
||||||
opts = list(rep.get('x.com.samsung.da.options') or [])
|
|
||||||
if not opts:
|
|
||||||
return None
|
|
||||||
return ['course', 'vs', '0'], {
|
|
||||||
'x.com.samsung.da.options': replace_in_options(opts, 'StormWashZone', p),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _auto_release_write(p, rep, href=None):
|
|
||||||
if p not in ('On', 'Off'):
|
|
||||||
return None
|
|
||||||
opts = list(rep.get('x.com.samsung.da.options') or [])
|
|
||||||
if not opts:
|
|
||||||
return None
|
|
||||||
return ['course', 'vs', '0'], {
|
|
||||||
'x.com.samsung.da.options': replace_in_options(opts, 'AutoDoorRelease', p),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
CYCLE_OPTIONS = Capability(
|
CYCLE_OPTIONS = Capability(
|
||||||
href='/course/vs/0',
|
href='/course/vs/0',
|
||||||
entities=(
|
entities=(
|
||||||
cycle_select(translation_key='dishwasher_cycle', icon='mdi:dishwasher'),
|
cycle_select(translation_key='dishwasher_cycle', icon='mdi:dishwasher'),
|
||||||
SwitchDesc(key='storm_wash', name='Storm Wash+', icon='mdi:weather-lightning-rainy',
|
bool_option_switch('storm_wash', 'Storm Wash+', 'mdi:weather-lightning-rainy',
|
||||||
rep_fn=lambda rep: option_value(
|
'StormWashZone'),
|
||||||
rep.get('x.com.samsung.da.options'), 'StormWashZone') == 'On',
|
bool_option_switch('auto_release_dry', 'Auto release dry', 'mdi:door-open',
|
||||||
write_fn=_storm_wash_write),
|
'AutoDoorRelease', gate_on_presence=True),
|
||||||
SwitchDesc(key='auto_release_dry', name='Auto release dry', icon='mdi:door-open',
|
|
||||||
exists_fn=lambda rep, resources: any(
|
|
||||||
isinstance(o, str) and o.startswith('AutoDoorRelease_')
|
|
||||||
for o in (rep.get('x.com.samsung.da.options') or [])
|
|
||||||
),
|
|
||||||
rep_fn=lambda rep: option_value(
|
|
||||||
rep.get('x.com.samsung.da.options'), 'AutoDoorRelease') == 'On',
|
|
||||||
write_fn=_auto_release_write),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import datetime
|
|||||||
|
|
||||||
from ..capability import Capability
|
from ..capability import Capability
|
||||||
from ..entities import (
|
from ..entities import (
|
||||||
BinarySensorDesc, ButtonDesc, NumberDesc, SelectDesc, SensorDesc,
|
BinarySensorDesc, NumberDesc, SelectDesc, SensorDesc,
|
||||||
SwitchDesc, TimeDesc,
|
SwitchDesc, TimeDesc,
|
||||||
)
|
)
|
||||||
from .common import normalize_temp_unit
|
from .common import normalize_temp_unit
|
||||||
@@ -228,28 +228,6 @@ DEFROST_BLOCK_STATUS = Capability(
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
# Self-check diagnostic
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
SELF_CHECK = Capability(
|
|
||||||
href='/selfcheck/vs/0',
|
|
||||||
poll_tier='cold',
|
|
||||||
entities=(
|
|
||||||
SensorDesc(key='selfcheck_status', field='x.com.samsung.da.status',
|
|
||||||
name='Self-check status', icon='mdi:stethoscope',
|
|
||||||
entity_category='diagnostic'),
|
|
||||||
SensorDesc(key='selfcheck_result', field='x.com.samsung.da.result',
|
|
||||||
name='Self-check result', icon='mdi:clipboard-check-outline',
|
|
||||||
entity_category='diagnostic'),
|
|
||||||
ButtonDesc(key='selfcheck_start', field='', name='Start self-check',
|
|
||||||
payload='Start', icon='mdi:play-circle-outline',
|
|
||||||
entity_category='diagnostic',
|
|
||||||
write_fn=lambda p, rep, href=None: (
|
|
||||||
['selfcheck', 'vs', '0'], {'x.com.samsung.da.status': p})),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Refrigeration modes (rapid cooling)
|
# Refrigeration modes (rapid cooling)
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
@@ -580,25 +558,6 @@ FLEX_ZONE = Capability(
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
# Firmware update
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
FIRMWARE_UPDATE = Capability(
|
|
||||||
href='/otninformation/vs/0',
|
|
||||||
poll_tier='cold',
|
|
||||||
entities=(
|
|
||||||
BinarySensorDesc(
|
|
||||||
key='firmware_update',
|
|
||||||
field='x.com.samsung.da.newVersionAvailable',
|
|
||||||
name='Firmware update available',
|
|
||||||
device_class='update',
|
|
||||||
entity_category='diagnostic',
|
|
||||||
value_fn=lambda v: str(v).lower() == 'true' if v is not None else None,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Generic door pattern capability (href=None — use as pattern_cap only)
|
# Generic door pattern capability (href=None — use as pattern_cap only)
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -85,14 +85,9 @@ IGNORED: list[Capability] = [
|
|||||||
# Warranty/service-plan enrollment status — every field reads "Unknown"
|
# Warranty/service-plan enrollment status — every field reads "Unknown"
|
||||||
# on hardware not enrolled in a Samsung Care+ style program.
|
# on hardware not enrolled in a Samsung Care+ style program.
|
||||||
Capability(href='/dginformation/vs/0'),
|
Capability(href='/dginformation/vs/0'),
|
||||||
# AI energy-saving level; only one value ('1') is ever in
|
|
||||||
# supportedAiLevel on hardware seen so far, so there's no real choice
|
|
||||||
# to expose. Revisit if a device surfaces more than one supported level.
|
|
||||||
Capability(href='/energy/ailevel/vs/0'),
|
|
||||||
# OCF-native vacation-mode flag (fridge). Only one value ('RVACATION_OFF')
|
# OCF-native vacation-mode flag (fridge). Only one value ('RVACATION_OFF')
|
||||||
# has ever been seen in `modes` (issue #7's dump), same "no real choice
|
# has ever been seen in `modes` (issue #7's dump) -- no real choice to
|
||||||
# to expose yet" situation as /energy/ailevel/vs/0 above. Revisit if a
|
# expose yet. Revisit if a device surfaces it toggled on.
|
||||||
# device surfaces it toggled on.
|
|
||||||
Capability(href='/mode/0'),
|
Capability(href='/mode/0'),
|
||||||
# Opaque integer with no supportedModes/options list to interpret it
|
# Opaque integer with no supportedModes/options list to interpret it
|
||||||
# against — meaning unclear from the raw resource alone.
|
# against — meaning unclear from the raw resource alone.
|
||||||
|
|||||||
@@ -217,6 +217,59 @@ def cycle_select(*, translation_key, icon):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Plain boolean toggles over /course/vs/0's options[] array: a
|
||||||
|
# '<prefix>_On'/'<prefix>_Off' token, read-modify-written the same way as
|
||||||
|
# the 'Course' token above. Shared by washer (bubble soak, pre-wash,
|
||||||
|
# intensive -- issue #22) and dishwasher (storm wash, auto release dry) --
|
||||||
|
# both families ride this exact contract, just with different prefixes and
|
||||||
|
# different presence/validation needs on top.
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
def bool_option_write(prefix):
|
||||||
|
def write(p, rep, href=None):
|
||||||
|
if p not in ('On', 'Off'):
|
||||||
|
return None
|
||||||
|
opts = list(rep.get('x.com.samsung.da.options') or [])
|
||||||
|
if not opts:
|
||||||
|
return None
|
||||||
|
return ['course', 'vs', '0'], {
|
||||||
|
'x.com.samsung.da.options': replace_in_options(opts, prefix, p),
|
||||||
|
}
|
||||||
|
return write
|
||||||
|
|
||||||
|
|
||||||
|
def bool_option_value(prefix):
|
||||||
|
return lambda rep: option_value(rep.get('x.com.samsung.da.options'), prefix) == 'On'
|
||||||
|
|
||||||
|
|
||||||
|
def bool_option_exists(prefix):
|
||||||
|
return lambda rep, resources: option_value(
|
||||||
|
rep.get('x.com.samsung.da.options'), prefix) is not None
|
||||||
|
|
||||||
|
|
||||||
|
def bool_option_switch(key, name, icon, prefix, *, entity_category=None,
|
||||||
|
gate_on_presence=False, validate_fn=None):
|
||||||
|
"""A SwitchDesc over a '<prefix>_On'/'<prefix>_Off' options[] token.
|
||||||
|
|
||||||
|
gate_on_presence self-gates the entity off on models that never report
|
||||||
|
the token at all (washer's bubble soak/pre-wash/intensive); leave False
|
||||||
|
for a toggle every device in the family reports (dishwasher's storm
|
||||||
|
wash). validate_fn is passed straight through to SwitchDesc for callers
|
||||||
|
that need to reject a write against live device state (e.g. washer's
|
||||||
|
per-course availability check) -- this factory has no opinion on it and
|
||||||
|
building one, if needed, is the caller's job.
|
||||||
|
"""
|
||||||
|
return SwitchDesc(
|
||||||
|
key=key, name=name, icon=icon, entity_category=entity_category,
|
||||||
|
exists_fn=bool_option_exists(prefix) if gate_on_presence else None,
|
||||||
|
rep_fn=bool_option_value(prefix),
|
||||||
|
write_fn=bool_option_write(prefix),
|
||||||
|
validate_fn=validate_fn,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# /wm/jobbeginingstatus/vs/0 -- the "why did the cycle not start" reason
|
# /wm/jobbeginingstatus/vs/0 -- the "why did the cycle not start" reason
|
||||||
# (e.g. door open, no water). The vendor field is x.com.samsung.da.currentStatus
|
# (e.g. door open, no water). The vendor field is x.com.samsung.da.currentStatus
|
||||||
|
|||||||
@@ -17,10 +17,13 @@ from datetime import datetime, timezone
|
|||||||
|
|
||||||
from ..capability import Capability
|
from ..capability import Capability
|
||||||
from ..entities import BinarySensorDesc, SelectDesc, SensorDesc
|
from ..entities import BinarySensorDesc, SelectDesc, SensorDesc
|
||||||
from .laundry import cycle_select, hex_pairs, option_value, replace_in_options
|
from .laundry import (
|
||||||
|
bool_option_exists, bool_option_switch, cycle_options, cycle_select, hex_pairs, option_value,
|
||||||
|
replace_in_options,
|
||||||
|
)
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Course_XX hex codes. The 23 codes named in strings.json/translations
|
# Course_XX hex codes. 23 of the codes named in strings.json/translations
|
||||||
# under entity.select.washer_cycle.state.<id, lowercased> were captured
|
# under entity.select.washer_cycle.state.<id, lowercased> were captured
|
||||||
# from a live WW90DG6U25LEU4's x.com.samsung.da.editCourseList
|
# from a live WW90DG6U25LEU4's x.com.samsung.da.editCourseList
|
||||||
# (EditCourseList_1C1D211B1E29243328262722202325322F2E30662D8F96), matched
|
# (EditCourseList_1C1D211B1E29243328262722202325322F2E30662D8F96), matched
|
||||||
@@ -35,6 +38,13 @@ from .laundry import cycle_select, hex_pairs, option_value, replace_in_options
|
|||||||
# you'd expect to be pinned (default cycle + maintenance cycle),
|
# you'd expect to be pinned (default cycle + maintenance cycle),
|
||||||
# corroborating the positional match.
|
# corroborating the positional match.
|
||||||
#
|
#
|
||||||
|
# A further 5 codes -- '36' Wash+Dry, '37' Air Wash, '38' Cotton Dry,
|
||||||
|
# '39' Synthetics Dry, and a second, distinct '1F' Intense Cold (not the
|
||||||
|
# same code as '8F' above) -- came from a WD90T654DBN/S1 washer/dryer
|
||||||
|
# combo's editCourseList and were named from that user's app screenshot
|
||||||
|
# (issue #22). Combo units carry their own course set, so these codes
|
||||||
|
# don't imply anything about '1F' on a plain washer.
|
||||||
|
#
|
||||||
# No static fallback list of those codes is kept here, deliberately: other
|
# No static fallback list of those codes is kept here, deliberately: other
|
||||||
# washer models have a different actual course set (a second dump's active
|
# washer models have a different actual course set (a second dump's active
|
||||||
# course, '65', isn't even in the list above; models with 'AI Wash'/'Mixed
|
# course, '65', isn't even in the list above; models with 'AI Wash'/'Mixed
|
||||||
@@ -226,9 +236,58 @@ def _dosing_low(prefix):
|
|||||||
rep.get('x.com.samsung.da.options'), prefix) not in (None, 'Off')
|
rep.get('x.com.samsung.da.options'), prefix) not in (None, 'Off')
|
||||||
|
|
||||||
|
|
||||||
def _dosing_alarm_exists(prefix):
|
# Bubble soak / pre-wash / intensive-wash toggles, from the same options[]
|
||||||
return lambda rep, resources: option_value(
|
# array (issue #22 follow-up on a WD90T654DBN/S1 combo). Each rides as a
|
||||||
rep.get('x.com.samsung.da.options'), prefix) is not None
|
# plain '<Prefix>_On'/'<Prefix>_Off' token, confirmed by a dump taken with
|
||||||
|
# Bubble Soak switched on in the app (BubbleSoak_On) -- the same On/Off shape
|
||||||
|
# already used by AiOption and KidsLockBypass in this same array, so
|
||||||
|
# PreWashSetting/IntensiveSetting are assumed to follow suit.
|
||||||
|
#
|
||||||
|
# Each also has a differently-named hex-pair availability field that lines up
|
||||||
|
# positionally with editCourseList: BubbleSoakSet, PreWashAvailableSet,
|
||||||
|
# IntensiveAvailableSet. On the reporter's dump (course '30' at position 1 of
|
||||||
|
# 24), all three read 'F0' at that position and the toggle was writable --
|
||||||
|
# and the same dump's earlier state (course '1C' at position 0, 'BubbleSoak
|
||||||
|
# Off') decodes to '00' for that course, matching the app graying the
|
||||||
|
# control out there. 'F0'/'00' is treated as available/unavailable on that
|
||||||
|
# evidence. exists_fn (device-level presence) still only runs once, against
|
||||||
|
# the setup-time snapshot, so it isn't a fit for this per-course check --
|
||||||
|
# validate_fn runs on every write attempt instead (dispatched from
|
||||||
|
# coordinator.async_send_command, ahead of write_fn), rejecting an on-write
|
||||||
|
# for a course whose byte isn't 'F0' with a user-facing error rather than
|
||||||
|
# silently no-opping against the device. The read/write/presence machinery
|
||||||
|
# itself is laundry.bool_option_switch, shared with dishwasher's storm-wash/
|
||||||
|
# auto-release-dry toggles -- only this per-course gating is washer-only, so
|
||||||
|
# it stays here rather than in laundry.py (see laundry.bool_option_switch's
|
||||||
|
# docstring: it takes a prebuilt validate_fn and has no opinion on it).
|
||||||
|
def _bool_option_switch(key, name, icon, prefix, availability_field):
|
||||||
|
def validate(p, rep, resources):
|
||||||
|
"""Reject turning on when the selected course's byte in
|
||||||
|
`availability_field` isn't 'F0'. Turning off is never blocked. Falls
|
||||||
|
back to allowing the write whenever the availability data can't be
|
||||||
|
resolved (unrecognized course, missing/mismatched-length bitmap)
|
||||||
|
rather than guessing -- a false rejection is worse than an
|
||||||
|
occasional no-op write."""
|
||||||
|
if p != 'On':
|
||||||
|
return None
|
||||||
|
opts = rep.get('x.com.samsung.da.options') or []
|
||||||
|
current = option_value(opts, 'Course')
|
||||||
|
courses = cycle_options(resources)
|
||||||
|
if not current or current not in courses:
|
||||||
|
return None
|
||||||
|
raw = option_value(opts, availability_field)
|
||||||
|
if raw is None:
|
||||||
|
return None
|
||||||
|
pairs = hex_pairs(raw)
|
||||||
|
if len(pairs) != len(courses):
|
||||||
|
return None
|
||||||
|
if pairs[courses.index(current)] != 'F0':
|
||||||
|
return f"{name} isn't available on the selected cycle."
|
||||||
|
return None
|
||||||
|
|
||||||
|
return bool_option_switch(
|
||||||
|
key, name, icon, prefix,
|
||||||
|
entity_category='config', gate_on_presence=True, validate_fn=validate)
|
||||||
|
|
||||||
|
|
||||||
WASHER_COURSE = Capability(
|
WASHER_COURSE = Capability(
|
||||||
@@ -281,11 +340,17 @@ WASHER_COURSE = Capability(
|
|||||||
write_fn=_level_write('SoftenerLevel2Ctrl')),
|
write_fn=_level_write('SoftenerLevel2Ctrl')),
|
||||||
BinarySensorDesc(key='detergent_low', name='Detergent low',
|
BinarySensorDesc(key='detergent_low', name='Detergent low',
|
||||||
icon='mdi:alert-circle-outline', device_class='problem',
|
icon='mdi:alert-circle-outline', device_class='problem',
|
||||||
exists_fn=_dosing_alarm_exists('DetergentAlarm'),
|
exists_fn=bool_option_exists('DetergentAlarm'),
|
||||||
rep_fn=_dosing_low('DetergentAlarm')),
|
rep_fn=_dosing_low('DetergentAlarm')),
|
||||||
BinarySensorDesc(key='softener_low', name='Softener low',
|
BinarySensorDesc(key='softener_low', name='Softener low',
|
||||||
icon='mdi:alert-circle-outline', device_class='problem',
|
icon='mdi:alert-circle-outline', device_class='problem',
|
||||||
exists_fn=_dosing_alarm_exists('SoftenerAlarm'),
|
exists_fn=bool_option_exists('SoftenerAlarm'),
|
||||||
rep_fn=_dosing_low('SoftenerAlarm')),
|
rep_fn=_dosing_low('SoftenerAlarm')),
|
||||||
|
_bool_option_switch('bubble_soak', 'Bubble soak', 'mdi:chart-bubble',
|
||||||
|
'BubbleSoak', 'BubbleSoakSet'),
|
||||||
|
_bool_option_switch('pre_wash', 'Pre wash', 'mdi:washing-machine',
|
||||||
|
'PreWashSetting', 'PreWashAvailableSet'),
|
||||||
|
_bool_option_switch('intensive', 'Intensive', 'mdi:washing-machine',
|
||||||
|
'IntensiveSetting', 'IntensiveAvailableSet'),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
Frozen dataclasses so the future native HA component can consume them as
|
Frozen dataclasses so the future native HA component can consume them as
|
||||||
EntityDescription subclasses unchanged. Read transforms live in value_fn;
|
EntityDescription subclasses unchanged. Read transforms live in value_fn;
|
||||||
presence gating in exists_fn; write logic in write_fn on command platforms.
|
presence gating in exists_fn; write logic in write_fn on command platforms;
|
||||||
|
pre-write rejection (surfaced to the user, not just logged) in validate_fn
|
||||||
|
where a description declares one.
|
||||||
"""
|
"""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
@@ -10,6 +12,11 @@ from dataclasses import dataclass, field
|
|||||||
from typing import Any, Callable, Optional
|
from typing import Any, Callable, Optional
|
||||||
|
|
||||||
WriteFn = Optional[Callable[[Any, dict], "tuple[list[str], dict] | None"]]
|
WriteFn = Optional[Callable[[Any, dict], "tuple[list[str], dict] | None"]]
|
||||||
|
# (payload, rep, resources) -> a human-readable rejection message, or None to
|
||||||
|
# allow the write. resources is the coordinator's full href->rep snapshot, for
|
||||||
|
# the same cross-resource lookups exists_fn needs (e.g. reading a sibling
|
||||||
|
# href's live option list).
|
||||||
|
ValidateFn = Optional[Callable[[Any, dict, dict], "str | None"]]
|
||||||
|
|
||||||
|
|
||||||
def _identity(v: Any) -> Any:
|
def _identity(v: Any) -> Any:
|
||||||
@@ -61,6 +68,7 @@ class SelectDesc(SamsungEntityDescription):
|
|||||||
class SwitchDesc(SamsungEntityDescription):
|
class SwitchDesc(SamsungEntityDescription):
|
||||||
device_class: Optional[str] = None
|
device_class: Optional[str] = None
|
||||||
write_fn: WriteFn = None
|
write_fn: WriteFn = None
|
||||||
|
validate_fn: ValidateFn = None
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True, kw_only=True)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
|
|||||||
@@ -89,7 +89,12 @@
|
|||||||
"66": "Denim",
|
"66": "Denim",
|
||||||
"2d": "Silent Wash",
|
"2d": "Silent Wash",
|
||||||
"8f": "Intense Cold",
|
"8f": "Intense Cold",
|
||||||
"96": "Less Microfiber"
|
"96": "Less Microfiber",
|
||||||
|
"36": "Wash+Dry",
|
||||||
|
"37": "Air Wash",
|
||||||
|
"38": "Cotton Dry",
|
||||||
|
"39": "Synthetics Dry",
|
||||||
|
"1f": "Intense Cold"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dryer_cycle": {
|
"dryer_cycle": {
|
||||||
|
|||||||
@@ -89,7 +89,12 @@
|
|||||||
"66": "Denim",
|
"66": "Denim",
|
||||||
"2d": "Silent Wash",
|
"2d": "Silent Wash",
|
||||||
"8f": "Intense Cold",
|
"8f": "Intense Cold",
|
||||||
"96": "Less Microfiber"
|
"96": "Less Microfiber",
|
||||||
|
"36": "Wash+Dry",
|
||||||
|
"37": "Air Wash",
|
||||||
|
"38": "Cotton Dry",
|
||||||
|
"39": "Synthetics Dry",
|
||||||
|
"1f": "Intense Cold"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dryer_cycle": {
|
"dryer_cycle": {
|
||||||
|
|||||||
@@ -0,0 +1,595 @@
|
|||||||
|
{
|
||||||
|
"meta": {
|
||||||
|
"note": "Samsung Room A/C, model TP1X_DA-AC-RAC-01011 (oneUiVersion '7.0 Air conditioner', Tizen Lite). Scrubbed real /device/0 dump. Adds temperature via /temperatures/vs/0 + display light. Issue #17 (newer model class).",
|
||||||
|
"issue": 17,
|
||||||
|
"model": "TP1X_DA-AC-RAC-01011",
|
||||||
|
"oneUiVersion": "7.0 Air conditioner"
|
||||||
|
},
|
||||||
|
"device0": [
|
||||||
|
{
|
||||||
|
"rt": [
|
||||||
|
"x.com.samsung.devcol",
|
||||||
|
"oic.wk.col"
|
||||||
|
],
|
||||||
|
"if": [
|
||||||
|
"oic.if.baseline",
|
||||||
|
"oic.if.ll",
|
||||||
|
"oic.if.b"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/airlevelcheck/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.periodicSensingInterval": "1800",
|
||||||
|
"x.com.samsung.da.sensingState": "NonProcessing",
|
||||||
|
"x.com.samsung.da.lastSensingTime": "1784508715",
|
||||||
|
"x.com.samsung.da.lastSensingLevel": "Kr1",
|
||||||
|
"x.com.samsung.da.periodicSensingSkipStatus": "Off",
|
||||||
|
"x.com.samsung.da.periodicSensingSkipTime": "00000000",
|
||||||
|
"x.com.samsung.da.periodicSensingActivationState": "On",
|
||||||
|
"x.com.samsung.da.autoExeState": "Alarm",
|
||||||
|
"x.com.samsung.da.supportedAutoExeState": [
|
||||||
|
"Airpurify",
|
||||||
|
"Alarm",
|
||||||
|
"Sensing"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.startSensingOnce": "Off",
|
||||||
|
"x.com.samsung.da.autoExeSetting": "Off",
|
||||||
|
"x.com.samsung.da.supportedAutoExeSetting": [
|
||||||
|
"On",
|
||||||
|
"Off"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/aisleep/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.displayNightMode": "Off",
|
||||||
|
"x.com.samsung.da.elapsedTime": "0",
|
||||||
|
"x.com.samsung.da.requestFeedback": "Off",
|
||||||
|
"x.com.samsung.da.resultFeedback": 0,
|
||||||
|
"x.com.samsung.da.statusFeedback": "Idle",
|
||||||
|
"x.com.samsung.da.sleepTime": "14002200"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/alarms/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"rt": [
|
||||||
|
"x.com.samsung.da.alarms"
|
||||||
|
],
|
||||||
|
"if": [
|
||||||
|
"oic.if.baseline",
|
||||||
|
"oic.if.a"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.items": [
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "0",
|
||||||
|
"x.com.samsung.da.alarmType": "Device",
|
||||||
|
"x.com.samsung.da.code": "ErrorCode_OFF",
|
||||||
|
"x.com.samsung.da.triggeredTime": "2026-07-22T07:13:19",
|
||||||
|
"x.com.samsung.da.state": "Deleted"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "1",
|
||||||
|
"x.com.samsung.da.alarmType": "Device",
|
||||||
|
"x.com.samsung.da.code": "FilterAlarm_OFF",
|
||||||
|
"x.com.samsung.da.triggeredTime": "2026-07-22T07:13:19",
|
||||||
|
"x.com.samsung.da.state": "Deleted"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/availablecontrolsets/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.sets": "000000A0012C016102490F0F0000",
|
||||||
|
"x.com.samsung.da.id": "RAC",
|
||||||
|
"x.com.samsung.da.version": "1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/configuration/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.region": "0000000000",
|
||||||
|
"x.com.samsung.da.airconOptionList": [
|
||||||
|
"PRODUCT_GLOBAL",
|
||||||
|
"AI_GLOBAL_HEATPUMP_4.0",
|
||||||
|
"AI_3.0",
|
||||||
|
"Auto_To_AI",
|
||||||
|
"AI_Heat",
|
||||||
|
"ENERGY_2.0",
|
||||||
|
"HOMECARE_WIZARD_V2",
|
||||||
|
"DR",
|
||||||
|
"SingleCommand_1"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/da/softreset/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.softwarereset": "false"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/drlc/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.start": "1970-01-01T00:00:00Z",
|
||||||
|
"x.com.samsung.da.override": "Off",
|
||||||
|
"x.com.samsung.da.durationminutes": "0",
|
||||||
|
"x.com.samsung.da.drlcLevel": "0",
|
||||||
|
"x.com.samsung.da.realSaving": "Off"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/energy/consumption/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.cumulativeDate": "1784704371",
|
||||||
|
"x.com.samsung.da.cumulativeSavedPower": "-1",
|
||||||
|
"x.com.samsung.da.cumulativePower": "75025",
|
||||||
|
"x.com.samsung.da.cumulativeUnit": "Wh",
|
||||||
|
"x.com.samsung.da.instantaneousPowerUnit": "W",
|
||||||
|
"x.com.samsung.da.cumulativePowerType": "total"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/file/information/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.timeoffset": "+02:00",
|
||||||
|
"x.com.samsung.supprtedtype": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/filter/airdustfilter/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.filterUsageResolution": "1",
|
||||||
|
"x.com.samsung.da.filterCapacity": "500",
|
||||||
|
"x.com.samsung.da.filterCapacityUnit": "Hour",
|
||||||
|
"x.com.samsung.da.filterResetType": [
|
||||||
|
"replaceable",
|
||||||
|
"washable"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.filterStatus": "normal",
|
||||||
|
"x.com.samsung.da.filterUsage": "42",
|
||||||
|
"x.com.samsung.da.filterDesiredUsage": "500",
|
||||||
|
"x.com.samsung.da.supportedFilterDesiredUsage": [
|
||||||
|
"180",
|
||||||
|
"300",
|
||||||
|
"500",
|
||||||
|
"700"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/humidity/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.humidity": "0",
|
||||||
|
"x.com.samsung.da.fivepercentHumidity": "53"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/information/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.otnDUID": "**REDACTED**",
|
||||||
|
"x.com.samsung.da.modelNum": "TP1X_DA-AC-RAC-01011_0000|10275643|60010523001911F58E0049320092E900",
|
||||||
|
"x.com.samsung.da.description": "TP1X_DA-AC-RAC-01011_0000",
|
||||||
|
"x.com.samsung.da.serialNum": "**REDACTED**",
|
||||||
|
"x.com.samsung.da.serialNumOption": "**REDACTED**",
|
||||||
|
"x.com.samsung.da.items": [
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "0",
|
||||||
|
"x.com.samsung.da.description": "Version",
|
||||||
|
"x.com.samsung.da.type": "Software",
|
||||||
|
"x.com.samsung.da.number": "02762A260401",
|
||||||
|
"x.com.samsung.da.newVersionAvailable": "0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "1",
|
||||||
|
"x.com.samsung.da.description": "Version",
|
||||||
|
"x.com.samsung.da.type": "Firmware",
|
||||||
|
"x.com.samsung.da.newVersionAvailable": "0",
|
||||||
|
"x.com.samsung.da.number": "02756C25082500,FFFFFFFFFFFFFF"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "2",
|
||||||
|
"x.com.samsung.da.description": "Version",
|
||||||
|
"x.com.samsung.da.type": "Firmware",
|
||||||
|
"x.com.samsung.da.newVersionAvailable": "0",
|
||||||
|
"x.com.samsung.da.number": "02669A24092600,02636A10001200"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "3",
|
||||||
|
"x.com.samsung.da.description": "Version",
|
||||||
|
"x.com.samsung.da.type": "Firmware",
|
||||||
|
"x.com.samsung.da.newVersionAvailable": "0",
|
||||||
|
"x.com.samsung.da.number": "02672A10001000,FFFFFFFFFFFFFF"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.diagDumpType": "file",
|
||||||
|
"x.com.samsung.da.diagEndPoint": "SSM",
|
||||||
|
"x.com.samsung.da.diagLogType": [
|
||||||
|
"errCode",
|
||||||
|
"dump"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.diagMnid": "0AJT",
|
||||||
|
"x.com.samsung.da.diagSetupid": "AR4",
|
||||||
|
"x.com.samsung.da.diagProtocolType": "BLE_OCF",
|
||||||
|
"x.com.samsung.da.diagMinVersion": "3.0",
|
||||||
|
"x.com.samsung.da.diagTsId": "DA01"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/keepnormalstate/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.keepnormal": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/light/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"mode": "On",
|
||||||
|
"supportedModes": [
|
||||||
|
"On",
|
||||||
|
"Off"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/mds/absencemonitoring/vs/0",
|
||||||
|
"rep": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/mds/absencestate/vs/0",
|
||||||
|
"rep": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/mode/convenient/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.modes": "Off",
|
||||||
|
"x.com.samsung.da.supportedModes": [
|
||||||
|
"Off",
|
||||||
|
"Sleep",
|
||||||
|
"Quiet",
|
||||||
|
"Smart",
|
||||||
|
"Speed",
|
||||||
|
"MotionIndirect",
|
||||||
|
"Nano",
|
||||||
|
"NanoSleep",
|
||||||
|
"DryComfort"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/mode/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"rt": [
|
||||||
|
"x.com.samsung.da.mode"
|
||||||
|
],
|
||||||
|
"if": [
|
||||||
|
"oic.if.baseline",
|
||||||
|
"oic.if.a"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.modes": [
|
||||||
|
"Heat"
|
||||||
|
],
|
||||||
|
"workingMode": "Heat",
|
||||||
|
"x.com.samsung.da.supportedModes": [
|
||||||
|
"Auto",
|
||||||
|
"Cool",
|
||||||
|
"Dry",
|
||||||
|
"Heat",
|
||||||
|
"Wind"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.options": [
|
||||||
|
"OptionCode_56378",
|
||||||
|
"Sleep_6",
|
||||||
|
"ArtificialWorking_Off",
|
||||||
|
"Off",
|
||||||
|
"OutdoorTemp_68",
|
||||||
|
"OutdoorConnection_Connected"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/option/airpurify/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"rt": [
|
||||||
|
"x.com.samsung.da.option.airpurify"
|
||||||
|
],
|
||||||
|
"if": [
|
||||||
|
"oic.if.baseline",
|
||||||
|
"oic.if.a"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.modes": "Off",
|
||||||
|
"x.com.samsung.da.supportedModes": [
|
||||||
|
"On",
|
||||||
|
"Off"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/option/autoclean/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.status": "Stop",
|
||||||
|
"x.com.samsung.da.supportedStatus": [
|
||||||
|
"Start",
|
||||||
|
"Stop"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.progress": "0",
|
||||||
|
"x.com.samsung.da.settingStatus": "On",
|
||||||
|
"x.com.samsung.da.supportedSettingStatus": [
|
||||||
|
"On",
|
||||||
|
"Off"
|
||||||
|
],
|
||||||
|
"defaultSettingStatus": "On"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/option/muteonce/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"muteonce": "Off"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/personality/presence/vs/0",
|
||||||
|
"rep": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/power/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.power": "Off",
|
||||||
|
"operationNumber": "39",
|
||||||
|
"displayCondition": "Enable"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/realtimenotiforclient/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.timeforshortnoti": "0",
|
||||||
|
"x.com.samsung.da.longnotisubscription": "true",
|
||||||
|
"x.com.samsung.da.periodicnotisubscription": "true"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/remotedatacontrol/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.status": "Off",
|
||||||
|
"x.com.samsung.da.connectionStatus": "Disconnected"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/remotetemperature/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.temperature": "",
|
||||||
|
"x.com.samsung.da.unit": "",
|
||||||
|
"x.com.samsung.da.error": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/reserverulesets/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.sets": "3EFFFFFFFF101E121EFFFF101EFFFF000001001F0001001F001F0000009CACFFFF0000",
|
||||||
|
"x.com.samsung.da.id": "RAC",
|
||||||
|
"x.com.samsung.da.version": "1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/selfcheck/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.start": "Cancel",
|
||||||
|
"x.com.samsung.da.status": "Ready",
|
||||||
|
"x.com.samsung.da.progress": "0",
|
||||||
|
"x.com.samsung.da.result": "NA",
|
||||||
|
"x.com.samsung.da.supportedActions": [
|
||||||
|
"Start",
|
||||||
|
"Cancel"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.error": [
|
||||||
|
"DA_ERROR_NONE"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/sensors/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.cleanLevel": "1",
|
||||||
|
"x.com.samsung.da.items": [
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "0",
|
||||||
|
"x.com.samsung.da.description": "Sensor for CleanLevel",
|
||||||
|
"x.com.samsung.da.type": "CleanLevel",
|
||||||
|
"x.com.samsung.da.value": [
|
||||||
|
"1"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "2",
|
||||||
|
"x.com.samsung.da.description": "Sensor for Dust",
|
||||||
|
"x.com.samsung.da.type": "Dust",
|
||||||
|
"x.com.samsung.da.value": [
|
||||||
|
"0",
|
||||||
|
"0"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "3",
|
||||||
|
"x.com.samsung.da.description": "Sensor for FineDust",
|
||||||
|
"x.com.samsung.da.type": "FineDust",
|
||||||
|
"x.com.samsung.da.value": [
|
||||||
|
"0",
|
||||||
|
"0"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "4",
|
||||||
|
"x.com.samsung.da.description": "Sensor for SuperFineDust",
|
||||||
|
"x.com.samsung.da.type": "SuperFineDust",
|
||||||
|
"x.com.samsung.da.value": [
|
||||||
|
"0",
|
||||||
|
"0"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/temperature/control/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.increment": "1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/temperatures/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.items": [
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "0",
|
||||||
|
"x.com.samsung.da.description": "Temperature",
|
||||||
|
"x.com.samsung.da.current": "17.0",
|
||||||
|
"x.com.samsung.da.desired": "25.0",
|
||||||
|
"x.com.samsung.da.minimum": "16",
|
||||||
|
"x.com.samsung.da.maximum": "30",
|
||||||
|
"x.com.samsung.da.increment": "1",
|
||||||
|
"x.com.samsung.da.unit": "Celsius"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/welcome/temperature/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"operatingStatus": "None",
|
||||||
|
"requestId": "0000"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/wind/direction/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.modes": "Fix",
|
||||||
|
"x.com.samsung.da.supportedModes": [
|
||||||
|
"Fix",
|
||||||
|
"Up_And_Low",
|
||||||
|
"Left_And_Right",
|
||||||
|
"All"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/wind/strength/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.modes": "0",
|
||||||
|
"x.com.samsung.da.supportedModes": [
|
||||||
|
"0",
|
||||||
|
"1",
|
||||||
|
"2",
|
||||||
|
"3",
|
||||||
|
"4"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.modesName": [
|
||||||
|
"Auto",
|
||||||
|
"Low",
|
||||||
|
"Mid",
|
||||||
|
"High",
|
||||||
|
"Turbo"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/otninformation/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.target": "",
|
||||||
|
"x.com.samsung.da.newVersionAvailable": "false",
|
||||||
|
"otnStatus": "None",
|
||||||
|
"flashingProgress": "0",
|
||||||
|
"otnCompleteDate": "noHistory",
|
||||||
|
"scheduledTime": "None",
|
||||||
|
"swVersionInfo": {
|
||||||
|
"platform": "Tizen Lite",
|
||||||
|
"oneUiVersion": "7.0 Air conditioner",
|
||||||
|
"osVersion": "4.0"
|
||||||
|
},
|
||||||
|
"otnList": [
|
||||||
|
{
|
||||||
|
"type": "WIFI",
|
||||||
|
"modelId": "ARA-KR-TP1-25-ARXX00",
|
||||||
|
"versions": [
|
||||||
|
"11260401"
|
||||||
|
],
|
||||||
|
"visVersion": "260401"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/timezone/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"timezoneid": "Africa/Johannesburg",
|
||||||
|
"offset": "+02:00",
|
||||||
|
"DST": "OFF"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/connectionconfig/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"autoReconnectionMinVersion": "1.0",
|
||||||
|
"autoReconnection": "true",
|
||||||
|
"autoReconnectionProtocolType": [
|
||||||
|
"helper_hotspot",
|
||||||
|
"ble_ocf"
|
||||||
|
],
|
||||||
|
"supportedWiFiAuthType": [
|
||||||
|
"OPEN",
|
||||||
|
"WEP",
|
||||||
|
"WPA-PSK",
|
||||||
|
"WPA2-PSK",
|
||||||
|
"SAE"
|
||||||
|
],
|
||||||
|
"supportedWiFiCryptoType": [
|
||||||
|
"TKIP",
|
||||||
|
"AES",
|
||||||
|
"WEP-64",
|
||||||
|
"WEP-128"
|
||||||
|
],
|
||||||
|
"supportedWiFiFreq": [
|
||||||
|
"2.4G"
|
||||||
|
],
|
||||||
|
"calmConnectionCare": {
|
||||||
|
"version": "1.0",
|
||||||
|
"role": [
|
||||||
|
"things"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/wirelessinfo/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"macaddressWiFi": "**REDACTED**",
|
||||||
|
"macaddressBLE": "**REDACTED**",
|
||||||
|
"connectedApSsid": "**REDACTED**"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/quickcontrol/info/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"supportedVersion": "1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/dginformation/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"enrolmentstatus": "Unknown",
|
||||||
|
"devicestate": "Unknown",
|
||||||
|
"lockstatus": "Normal",
|
||||||
|
"nextduedate": "",
|
||||||
|
"workingminutes": 0,
|
||||||
|
"paymentinfo": {
|
||||||
|
"emiplan": "Unknown",
|
||||||
|
"currency": "Unknown",
|
||||||
|
"totalemi": 0,
|
||||||
|
"totalemipaid": 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
+591
@@ -0,0 +1,591 @@
|
|||||||
|
{
|
||||||
|
"meta": {
|
||||||
|
"model": "TP1X_DA-AC-RAC-01001_0000",
|
||||||
|
"device_type": "airconditioner",
|
||||||
|
"source": "issue #38 diagnostics (scrubbed)",
|
||||||
|
"note": "Newer TP1X RAC board (oneUiVersion '7.0 Air conditioner') with a fuller resource set than the ARTIK051/TP2X boards: display light, self-check, mute-once, and a circuit-breaker current-limit setting."
|
||||||
|
},
|
||||||
|
"device0": [
|
||||||
|
{
|
||||||
|
"rt": [
|
||||||
|
"x.com.samsung.devcol",
|
||||||
|
"oic.wk.col"
|
||||||
|
],
|
||||||
|
"if": [
|
||||||
|
"oic.if.baseline",
|
||||||
|
"oic.if.ll",
|
||||||
|
"oic.if.b"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/aisleep/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.displayNightMode": "Off",
|
||||||
|
"x.com.samsung.da.elapsedTime": "0",
|
||||||
|
"x.com.samsung.da.requestFeedback": "Off",
|
||||||
|
"x.com.samsung.da.resultFeedback": 0,
|
||||||
|
"x.com.samsung.da.statusFeedback": "Idle",
|
||||||
|
"x.com.samsung.da.sleepTime": "14002200"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/alarms/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"rt": [
|
||||||
|
"x.com.samsung.da.alarms"
|
||||||
|
],
|
||||||
|
"if": [
|
||||||
|
"oic.if.baseline",
|
||||||
|
"oic.if.a"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.items": [
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "0",
|
||||||
|
"x.com.samsung.da.alarmType": "Device",
|
||||||
|
"x.com.samsung.da.code": "ErrorCode_OFF",
|
||||||
|
"x.com.samsung.da.triggeredTime": "2026-07-22T12:58:00",
|
||||||
|
"x.com.samsung.da.state": "Deleted"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "1",
|
||||||
|
"x.com.samsung.da.alarmType": "Device",
|
||||||
|
"x.com.samsung.da.code": "FilterAlarm_OFF",
|
||||||
|
"x.com.samsung.da.triggeredTime": "2026-07-22T12:58:00",
|
||||||
|
"x.com.samsung.da.state": "Deleted"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/availablecontrolsets/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.sets": "AEB700A0012C01610248040F0000",
|
||||||
|
"x.com.samsung.da.id": "RAC",
|
||||||
|
"x.com.samsung.da.version": "1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/configuration/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.region": "0000000000",
|
||||||
|
"x.com.samsung.da.airconOptionList": [
|
||||||
|
"PRODUCT_GLOBAL",
|
||||||
|
"AI_GLOBAL_HEATPUMP_4.0",
|
||||||
|
"AI_3.0",
|
||||||
|
"Auto_To_AI",
|
||||||
|
"AI_Heat",
|
||||||
|
"ENERGY_2.0",
|
||||||
|
"HOMECARE_WIZARD_V2",
|
||||||
|
"DR",
|
||||||
|
"SingleCommand_1"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/connectionconfig/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"autoReconnectionMinVersion": "1.0",
|
||||||
|
"autoReconnection": "true",
|
||||||
|
"autoReconnectionProtocolType": [
|
||||||
|
"helper_hotspot",
|
||||||
|
"ble_ocf"
|
||||||
|
],
|
||||||
|
"supportedWiFiAuthType": [
|
||||||
|
"OPEN",
|
||||||
|
"WEP",
|
||||||
|
"WPA-PSK",
|
||||||
|
"WPA2-PSK",
|
||||||
|
"SAE"
|
||||||
|
],
|
||||||
|
"supportedWiFiCryptoType": [
|
||||||
|
"TKIP",
|
||||||
|
"AES",
|
||||||
|
"WEP-64",
|
||||||
|
"WEP-128"
|
||||||
|
],
|
||||||
|
"supportedWiFiFreq": [
|
||||||
|
"2.4G"
|
||||||
|
],
|
||||||
|
"calmConnectionCare": {
|
||||||
|
"version": "1.0",
|
||||||
|
"role": [
|
||||||
|
"things"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/da/softreset/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.softwarereset": "false"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/dginformation/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"enrolmentstatus": "Unknown",
|
||||||
|
"devicestate": "Unknown",
|
||||||
|
"lockstatus": "Unknown",
|
||||||
|
"nextduedate": "",
|
||||||
|
"workingminutes": 0,
|
||||||
|
"paymentinfo": {
|
||||||
|
"emiplan": "Unknown",
|
||||||
|
"currency": "Unknown",
|
||||||
|
"totalemi": 0,
|
||||||
|
"totalemipaid": 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/drlc/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.start": "2026-07-22T10:59:14Z",
|
||||||
|
"x.com.samsung.da.override": "Off",
|
||||||
|
"x.com.samsung.da.durationminutes": "1148",
|
||||||
|
"x.com.samsung.da.drlcLevel": "1",
|
||||||
|
"x.com.samsung.da.realSaving": "Off"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/electriccurrent/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"operation": "Off",
|
||||||
|
"modes": "3",
|
||||||
|
"supportedModes": [
|
||||||
|
"3",
|
||||||
|
"4",
|
||||||
|
"5",
|
||||||
|
"6",
|
||||||
|
"7",
|
||||||
|
"8",
|
||||||
|
"9"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/energy/consumption/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.cumulativeDate": "1784725078",
|
||||||
|
"x.com.samsung.da.cumulativeSavedPower": "-1",
|
||||||
|
"x.com.samsung.da.cumulativePower": "160922",
|
||||||
|
"x.com.samsung.da.cumulativeUnit": "Wh",
|
||||||
|
"x.com.samsung.da.instantaneousPowerUnit": "W",
|
||||||
|
"x.com.samsung.da.cumulativePowerType": "total"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/file/information/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.timeoffset": "+03:00",
|
||||||
|
"x.com.samsung.supprtedtype": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/filter/airdustfilter/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.filterUsageResolution": "1",
|
||||||
|
"x.com.samsung.da.filterCapacity": "500",
|
||||||
|
"x.com.samsung.da.filterCapacityUnit": "Hour",
|
||||||
|
"x.com.samsung.da.filterResetType": [
|
||||||
|
"replaceable",
|
||||||
|
"washable"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.filterStatus": "normal",
|
||||||
|
"x.com.samsung.da.filterUsage": "30",
|
||||||
|
"x.com.samsung.da.filterDesiredUsage": "500",
|
||||||
|
"x.com.samsung.da.supportedFilterDesiredUsage": [
|
||||||
|
"180",
|
||||||
|
"300",
|
||||||
|
"500",
|
||||||
|
"700"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/information/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.otnDUID": "**REDACTED**",
|
||||||
|
"x.com.samsung.da.modelNum": "TP1X_DA-AC-RAC-01001_0000|10267841|60010532001911000E0041220090A000",
|
||||||
|
"x.com.samsung.da.description": "TP1X_DA-AC-RAC-01001_0000",
|
||||||
|
"x.com.samsung.da.serialNum": "**REDACTED**",
|
||||||
|
"x.com.samsung.da.serialNumOption": "**REDACTED**",
|
||||||
|
"x.com.samsung.da.items": [
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "0",
|
||||||
|
"x.com.samsung.da.description": "Version",
|
||||||
|
"x.com.samsung.da.type": "Software",
|
||||||
|
"x.com.samsung.da.number": "02762A260401",
|
||||||
|
"x.com.samsung.da.newVersionAvailable": "0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "1",
|
||||||
|
"x.com.samsung.da.description": "Version",
|
||||||
|
"x.com.samsung.da.type": "Firmware",
|
||||||
|
"x.com.samsung.da.newVersionAvailable": "0",
|
||||||
|
"x.com.samsung.da.number": "02678A24092500,FFFFFFFFFFFFFF"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "2",
|
||||||
|
"x.com.samsung.da.description": "Version",
|
||||||
|
"x.com.samsung.da.type": "Firmware",
|
||||||
|
"x.com.samsung.da.newVersionAvailable": "0",
|
||||||
|
"x.com.samsung.da.number": "02669A24092600,02636A10001200"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "3",
|
||||||
|
"x.com.samsung.da.description": "Version",
|
||||||
|
"x.com.samsung.da.type": "Firmware",
|
||||||
|
"x.com.samsung.da.newVersionAvailable": "0",
|
||||||
|
"x.com.samsung.da.number": "02672A10001000,FFFFFFFFFFFFFF"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.diagDumpType": "file",
|
||||||
|
"x.com.samsung.da.diagEndPoint": "SSM",
|
||||||
|
"x.com.samsung.da.diagLogType": [
|
||||||
|
"errCode",
|
||||||
|
"dump"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.diagMnid": "0AJT",
|
||||||
|
"x.com.samsung.da.diagSetupid": "AR2",
|
||||||
|
"x.com.samsung.da.diagProtocolType": "BLE_OCF",
|
||||||
|
"x.com.samsung.da.diagMinVersion": "3.0",
|
||||||
|
"x.com.samsung.da.diagTsId": "DA01"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/keepnormalstate/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.keepnormal": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/light/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"mode": "On",
|
||||||
|
"supportedModes": [
|
||||||
|
"On",
|
||||||
|
"Off"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/mds/absencemonitoring/vs/0",
|
||||||
|
"rep": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/mds/absencestate/vs/0",
|
||||||
|
"rep": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/mode/convenient/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.modes": "Off",
|
||||||
|
"x.com.samsung.da.supportedModes": [
|
||||||
|
"Off",
|
||||||
|
"Sleep",
|
||||||
|
"Quiet",
|
||||||
|
"Smart",
|
||||||
|
"Speed"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/mode/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"rt": [
|
||||||
|
"x.com.samsung.da.mode"
|
||||||
|
],
|
||||||
|
"if": [
|
||||||
|
"oic.if.baseline",
|
||||||
|
"oic.if.a"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.modes": [
|
||||||
|
"Cool"
|
||||||
|
],
|
||||||
|
"workingMode": "Cool",
|
||||||
|
"x.com.samsung.da.supportedModes": [
|
||||||
|
"Auto",
|
||||||
|
"Cool",
|
||||||
|
"Dry",
|
||||||
|
"Fan",
|
||||||
|
"Heat"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.options": [
|
||||||
|
"OptionCode_54328",
|
||||||
|
"Sleep_0",
|
||||||
|
"ArtificialWorking_Off",
|
||||||
|
"ComfortAICooling_Off",
|
||||||
|
"AiTempChanged_Off",
|
||||||
|
"AiTemp_240",
|
||||||
|
"Volume_100",
|
||||||
|
"StopAutoClean_Idle",
|
||||||
|
"DiagnosisAI_Off",
|
||||||
|
"ProgressDiagnosisAI_0",
|
||||||
|
"ResultDiagnosisAI_Normal",
|
||||||
|
"ExtendOptionCode_230024",
|
||||||
|
"UpdateAllow_NotAllowed",
|
||||||
|
"DurationOn_120",
|
||||||
|
"OutdoorTemp_92",
|
||||||
|
"CoolCapa_50",
|
||||||
|
"WarmCapa_60",
|
||||||
|
"Autoclean_Off",
|
||||||
|
"WelcomeCoolingState_Off",
|
||||||
|
"WelcomeHeatingState_Off",
|
||||||
|
"OutdoorConnection_Connected"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/option/airpurify/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"rt": [
|
||||||
|
"x.com.samsung.da.option.airpurify"
|
||||||
|
],
|
||||||
|
"if": [
|
||||||
|
"oic.if.baseline",
|
||||||
|
"oic.if.a"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.modes": "Off",
|
||||||
|
"x.com.samsung.da.supportedModes": [
|
||||||
|
"On",
|
||||||
|
"Off"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/option/autoclean/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.status": "Stop",
|
||||||
|
"x.com.samsung.da.supportedStatus": [
|
||||||
|
"Start",
|
||||||
|
"Stop"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.progress": "0",
|
||||||
|
"x.com.samsung.da.settingStatus": "Off",
|
||||||
|
"x.com.samsung.da.supportedSettingStatus": [
|
||||||
|
"On",
|
||||||
|
"Off"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/option/muteonce/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"muteonce": "Off"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/otninformation/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.target": "",
|
||||||
|
"x.com.samsung.da.newVersionAvailable": "false",
|
||||||
|
"otnStatus": "None",
|
||||||
|
"flashingProgress": "0",
|
||||||
|
"otnCompleteDate": "noHistory",
|
||||||
|
"scheduledTime": "None",
|
||||||
|
"swVersionInfo": {
|
||||||
|
"platform": "Tizen Lite",
|
||||||
|
"oneUiVersion": "7.0 Air conditioner",
|
||||||
|
"osVersion": "4.0"
|
||||||
|
},
|
||||||
|
"otnList": [
|
||||||
|
{
|
||||||
|
"type": "WIFI",
|
||||||
|
"modelId": "ARA-KR-TP1-25-ARXX00",
|
||||||
|
"versions": [
|
||||||
|
"11260401"
|
||||||
|
],
|
||||||
|
"visVersion": "260401"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Micom",
|
||||||
|
"modelId": "845210267841FFFFFFFF",
|
||||||
|
"versions": [
|
||||||
|
"24092500",
|
||||||
|
"FFFFFFFF"
|
||||||
|
],
|
||||||
|
"visVersion": "240925"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Micom",
|
||||||
|
"modelId": "045210267841FFFFFFFF",
|
||||||
|
"versions": [
|
||||||
|
"24092500",
|
||||||
|
"FFFFFFFF"
|
||||||
|
],
|
||||||
|
"visVersion": "240925"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Micom",
|
||||||
|
"modelId": "04521026694110263641",
|
||||||
|
"versions": [
|
||||||
|
"24092600",
|
||||||
|
"10001200"
|
||||||
|
],
|
||||||
|
"visVersion": "240926"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Micom",
|
||||||
|
"modelId": "FGCAN3",
|
||||||
|
"versions": [
|
||||||
|
"",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"visVersion": "999999"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Micom",
|
||||||
|
"modelId": "845210266941FFFFFFFF",
|
||||||
|
"versions": [
|
||||||
|
"24092600",
|
||||||
|
"FFFFFFFF"
|
||||||
|
],
|
||||||
|
"visVersion": "240926"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/personality/presence/vs/0",
|
||||||
|
"rep": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/power/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.power": "On",
|
||||||
|
"operationNumber": "9"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/quickcontrol/info/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"supportedVersion": "1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/realtimenotiforclient/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.timeforshortnoti": "0",
|
||||||
|
"x.com.samsung.da.longnotisubscription": "false",
|
||||||
|
"x.com.samsung.da.periodicnotisubscription": "true"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/remotedatacontrol/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.status": "Off",
|
||||||
|
"x.com.samsung.da.connectionStatus": "Disconnected"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/remotetemperature/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.temperature": "",
|
||||||
|
"x.com.samsung.da.unit": "",
|
||||||
|
"x.com.samsung.da.error": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/reserverulesets/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.sets": "AEFFFFFFFF101E121EFFFF101EFFFF000001001F00010000001F0000000000FFFF1E00",
|
||||||
|
"x.com.samsung.da.id": "RAC",
|
||||||
|
"x.com.samsung.da.version": "1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/selfcheck/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.start": "Cancel",
|
||||||
|
"x.com.samsung.da.status": "Ready",
|
||||||
|
"x.com.samsung.da.progress": "0",
|
||||||
|
"x.com.samsung.da.result": "NA",
|
||||||
|
"x.com.samsung.da.supportedActions": [
|
||||||
|
"Start",
|
||||||
|
"Cancel"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.error": [
|
||||||
|
"DA_ERROR_NONE"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/temperature/control/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.increment": "1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/temperatures/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.items": [
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "0",
|
||||||
|
"x.com.samsung.da.description": "Temperature",
|
||||||
|
"x.com.samsung.da.current": "26.0",
|
||||||
|
"x.com.samsung.da.desired": "22.0",
|
||||||
|
"x.com.samsung.da.minimum": "16",
|
||||||
|
"x.com.samsung.da.maximum": "30",
|
||||||
|
"x.com.samsung.da.increment": "1",
|
||||||
|
"x.com.samsung.da.unit": "Celsius"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/timezone/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"timezoneid": "Asia/Amman",
|
||||||
|
"offset": "+03:00",
|
||||||
|
"DST": "OFF"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/welcome/temperature/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"operatingStatus": "None",
|
||||||
|
"requestId": "0000"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/wind/direction/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.modes": "All",
|
||||||
|
"x.com.samsung.da.supportedModes": [
|
||||||
|
"Fix",
|
||||||
|
"Up_And_Low",
|
||||||
|
"Left_And_Right",
|
||||||
|
"All"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/wind/strength/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.modes": "1",
|
||||||
|
"x.com.samsung.da.supportedModes": [
|
||||||
|
"0",
|
||||||
|
"1",
|
||||||
|
"2",
|
||||||
|
"3",
|
||||||
|
"4"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.modesName": [
|
||||||
|
"Auto",
|
||||||
|
"Low",
|
||||||
|
"Mid",
|
||||||
|
"High",
|
||||||
|
"Turbo"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/wirelessinfo/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"macaddressWiFi": "**REDACTED**",
|
||||||
|
"macaddressBLE": "**REDACTED**",
|
||||||
|
"connectedApSsid": "**REDACTED**"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,380 @@
|
|||||||
|
{
|
||||||
|
"meta": {
|
||||||
|
"model": "TP2X_RAC_20K",
|
||||||
|
"device_type": "airconditioner",
|
||||||
|
"source": "issue #37 diagnostics (scrubbed)",
|
||||||
|
"note": "Older/simpler RAC board reporting no oneUiVersion -- resolved via the '_RAC_' modelNum token fallback in for_device_by_model (unlike issue #38's TP1X board, which self-reports oneUiVersion)."
|
||||||
|
},
|
||||||
|
"device0": [
|
||||||
|
{
|
||||||
|
"rt": [
|
||||||
|
"x.com.samsung.devcol",
|
||||||
|
"oic.wk.col"
|
||||||
|
],
|
||||||
|
"if": [
|
||||||
|
"oic.if.baseline",
|
||||||
|
"oic.if.ll",
|
||||||
|
"oic.if.b"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/alarms/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.items": [
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "0",
|
||||||
|
"x.com.samsung.da.description": "Alarm",
|
||||||
|
"x.com.samsung.da.alarmType": "Device",
|
||||||
|
"x.com.samsung.da.code": "ErrorCode_OFF",
|
||||||
|
"x.com.samsung.da.triggeredTime": "2026-07-22T12:42:46",
|
||||||
|
"x.com.samsung.da.state": "Deleted"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "1",
|
||||||
|
"x.com.samsung.da.description": "Alarm",
|
||||||
|
"x.com.samsung.da.alarmType": "Device",
|
||||||
|
"x.com.samsung.da.code": "FilterAlarm_OFF",
|
||||||
|
"x.com.samsung.da.triggeredTime": "2026-07-22T12:42:46",
|
||||||
|
"x.com.samsung.da.state": "Deleted"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/availablecontrolsets/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.sets": "000000A0012C01610249040F0000",
|
||||||
|
"x.com.samsung.da.id": "RAC",
|
||||||
|
"x.com.samsung.da.version": "1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/configuration/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.region": "0000000000",
|
||||||
|
"x.com.samsung.da.airconOptionList": [
|
||||||
|
"SingleCommand_1",
|
||||||
|
"HOMECARE_WIZARD_V2",
|
||||||
|
"PRODUCT_GLOBAL",
|
||||||
|
"AI_RAC_GLOBAL_HEATPUMP_3.0",
|
||||||
|
"AI_3.0",
|
||||||
|
"Auto_To_AI",
|
||||||
|
"AI_Heat"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/energy/consumption/0",
|
||||||
|
"rep": {
|
||||||
|
"power": 0.0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/energy/consumption/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.instantaneousPower": "0.000000",
|
||||||
|
"x.com.samsung.da.cumulativePower": "717060",
|
||||||
|
"x.com.samsung.da.cumulativeUnit": "Wh",
|
||||||
|
"x.com.samsung.da.cumulativePowerType": "total",
|
||||||
|
"x.com.samsung.da.instantaneousPowerUnit": "W"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/file/information/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.timeoffset": "+03:00",
|
||||||
|
"x.com.samsung.supprtedtype": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/filter/airdustfilter/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.filterUsage": "39",
|
||||||
|
"x.com.samsung.da.filterUsageResolution": "1",
|
||||||
|
"x.com.samsung.da.filterDesiredUsage": "500",
|
||||||
|
"x.com.samsung.da.filterStatus": "normal",
|
||||||
|
"x.com.samsung.da.filterCapacity": "500",
|
||||||
|
"x.com.samsung.da.filterCapacityUnit": "Hour",
|
||||||
|
"x.com.samsung.da.filterResetType": [
|
||||||
|
"replaceable",
|
||||||
|
"washable"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/humidity/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.humidity": "0",
|
||||||
|
"x.com.samsung.da.fivepercentHumidity": "43"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/information/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.modelNum": "TP2X_RAC_20K|10229641|60010523001511014600003200800000",
|
||||||
|
"x.com.samsung.da.description": "TP2X_RAC_20K",
|
||||||
|
"x.com.samsung.da.serialNum": "**REDACTED**",
|
||||||
|
"x.com.samsung.da.otnDUID": "**REDACTED**",
|
||||||
|
"x.com.samsung.da.diagProtocolType": "WIFI_HTTPS",
|
||||||
|
"x.com.samsung.da.diagLogType": [
|
||||||
|
"errCode",
|
||||||
|
"dump"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.diagDumpType": "file",
|
||||||
|
"x.com.samsung.da.diagEndPoint": "SSM",
|
||||||
|
"x.com.samsung.da.diagMnid": "0AJT",
|
||||||
|
"x.com.samsung.da.diagSetupid": "010",
|
||||||
|
"x.com.samsung.da.diagMinVersion": "1.0",
|
||||||
|
"x.com.samsung.da.serialNumOption": "**REDACTED**",
|
||||||
|
"x.com.samsung.da.items": [
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "0",
|
||||||
|
"x.com.samsung.da.description": "Version",
|
||||||
|
"x.com.samsung.da.type": "Software",
|
||||||
|
"x.com.samsung.da.number": "02273A260324",
|
||||||
|
"x.com.samsung.da.newVersionAvailable": "0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "1",
|
||||||
|
"x.com.samsung.da.description": "Version",
|
||||||
|
"x.com.samsung.da.type": "Firmware",
|
||||||
|
"x.com.samsung.da.number": "102296A23012700",
|
||||||
|
"x.com.samsung.da.newVersionAvailable": "0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "2",
|
||||||
|
"x.com.samsung.da.description": "Version",
|
||||||
|
"x.com.samsung.da.type": "Firmware",
|
||||||
|
"x.com.samsung.da.newVersionAvailable": "0"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/keepnormalstate/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.keepnormal": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/mode/convenient/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.modes": "Off",
|
||||||
|
"x.com.samsung.da.supportedModes": [
|
||||||
|
"Off",
|
||||||
|
"Sleep",
|
||||||
|
"Quiet",
|
||||||
|
"Smart",
|
||||||
|
"Speed",
|
||||||
|
"MotionIndirect",
|
||||||
|
"MotionDirect",
|
||||||
|
"Nano",
|
||||||
|
"NanoSleep"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/mode/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.supportedModes": [
|
||||||
|
"Auto",
|
||||||
|
"Cool",
|
||||||
|
"Dry",
|
||||||
|
"Wind",
|
||||||
|
"Heat",
|
||||||
|
"HOMECARE_WIZARD_V2"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.modes": [
|
||||||
|
"Cool"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.options": [
|
||||||
|
"Sleep_16",
|
||||||
|
"ArtificialWorking_Off",
|
||||||
|
"ComfortAICooling_Off",
|
||||||
|
"MotionState_Normal",
|
||||||
|
"AiTempChanged_Off",
|
||||||
|
"AiTemp_240",
|
||||||
|
"OutdoorTemp_85",
|
||||||
|
"CoolCapa_35",
|
||||||
|
"WarmCapa_35",
|
||||||
|
"Light_Off",
|
||||||
|
"Volume_100",
|
||||||
|
"StopAutoClean_Idle",
|
||||||
|
"Autoclean_Off",
|
||||||
|
"DiagnosisAI_Off",
|
||||||
|
"ProgressDiagnosisAI_1",
|
||||||
|
"ResultDiagnosisAI_Normal",
|
||||||
|
"MotionMode_PowerSave",
|
||||||
|
"OptionCode_56376",
|
||||||
|
"ExtendOptionCode_230157",
|
||||||
|
"RacInfo_None",
|
||||||
|
"UpdateAllow_NotAllowed",
|
||||||
|
"DurationOn_50",
|
||||||
|
"WelcomeCoolingState_Off"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/option/autoclean/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.status": "Stop",
|
||||||
|
"x.com.samsung.da.settingStatus": "Off",
|
||||||
|
"x.com.samsung.da.progress": "0",
|
||||||
|
"x.com.samsung.da.supportedStatus": [
|
||||||
|
"Start",
|
||||||
|
"Stop"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.supportedSettingStatus": [
|
||||||
|
"On",
|
||||||
|
"Off"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/option/muteonce/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"muteonce": "Off"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/otninformation/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.target": "",
|
||||||
|
"x.com.samsung.da.newVersionAvailable": "false",
|
||||||
|
"x.com.samsung.da.newVersionNo": "00000000",
|
||||||
|
"x.com.samsung.da.currentVersionInfo": "00000000",
|
||||||
|
"otnStatus": "None",
|
||||||
|
"flashingProgress": "",
|
||||||
|
"otnTarget": "main",
|
||||||
|
"otnCompleteDate": "noHistory",
|
||||||
|
"otnList": [
|
||||||
|
{
|
||||||
|
"type": "WIFI",
|
||||||
|
"modelId": "TP2X_RAC_20K",
|
||||||
|
"versions": [
|
||||||
|
"11260324"
|
||||||
|
],
|
||||||
|
"visVersion": "260324"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Micom",
|
||||||
|
"modelId": "045210229641FFFFFFFF",
|
||||||
|
"versions": [
|
||||||
|
"23012700",
|
||||||
|
"FFFFFFFF"
|
||||||
|
],
|
||||||
|
"visVersion": "230127"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "Micom",
|
||||||
|
"modelId": "04521022954110229941",
|
||||||
|
"versions": [
|
||||||
|
"21092700",
|
||||||
|
"10000300"
|
||||||
|
],
|
||||||
|
"visVersion": "210927"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/personality/presence/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.items": [
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "",
|
||||||
|
"x.com.samsung.da.deviceId": "**REDACTED**",
|
||||||
|
"x.com.samsung.da.value": ""
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/power/0",
|
||||||
|
"rep": {
|
||||||
|
"value": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/power/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.power": "Off"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/realtimenotiforclient/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.timeforshortnoti": "0",
|
||||||
|
"x.com.samsung.da.longnotisubscription": "false",
|
||||||
|
"x.com.samsung.da.periodicnotisubscription": "true"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/sensors/vs/0",
|
||||||
|
"rep": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/temperature/control/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.increment": "1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/temperatures/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.items": [
|
||||||
|
{
|
||||||
|
"x.com.samsung.da.id": "0",
|
||||||
|
"x.com.samsung.da.description": "Temperature",
|
||||||
|
"x.com.samsung.da.desired": "22.0",
|
||||||
|
"x.com.samsung.da.current": "26.0",
|
||||||
|
"x.com.samsung.da.maximum": "30",
|
||||||
|
"x.com.samsung.da.minimum": "16",
|
||||||
|
"x.com.samsung.da.increment": "1.0",
|
||||||
|
"x.com.samsung.da.unit": "Celsius"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/timezone/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"timezoneid": "Asia/Amman",
|
||||||
|
"offset": "+03:00",
|
||||||
|
"DST": "OFF"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/wind/direction/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.modes": "Left_And_Right",
|
||||||
|
"x.com.samsung.da.supportedModes": [
|
||||||
|
"Fix",
|
||||||
|
"All",
|
||||||
|
"Up_And_Low",
|
||||||
|
"Left_And_Right"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"href": "/wind/strength/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"x.com.samsung.da.modes": "2",
|
||||||
|
"x.com.samsung.da.supportedModes": [
|
||||||
|
"0",
|
||||||
|
"1",
|
||||||
|
"2",
|
||||||
|
"3",
|
||||||
|
"4"
|
||||||
|
],
|
||||||
|
"x.com.samsung.da.modesName": [
|
||||||
|
"Auto",
|
||||||
|
"Low",
|
||||||
|
"Mid",
|
||||||
|
"High",
|
||||||
|
"Turbo"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"state_keys": [
|
||||||
|
"air_filter_status",
|
||||||
|
"air_filter_usage",
|
||||||
|
"air_purify",
|
||||||
|
"alarm_code",
|
||||||
|
"auto_clean",
|
||||||
|
"climate",
|
||||||
|
"display_light",
|
||||||
|
"energy_kwh",
|
||||||
|
"energy_saved_kwh",
|
||||||
|
"firmware_update",
|
||||||
|
"mute_once",
|
||||||
|
"selfcheck_error",
|
||||||
|
"selfcheck_result",
|
||||||
|
"selfcheck_status"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"state_keys": [
|
||||||
|
"air_filter_status",
|
||||||
|
"air_filter_usage",
|
||||||
|
"air_purify",
|
||||||
|
"alarm_code",
|
||||||
|
"auto_clean",
|
||||||
|
"climate",
|
||||||
|
"current_limit_enabled",
|
||||||
|
"current_limit_level",
|
||||||
|
"display_light",
|
||||||
|
"energy_kwh",
|
||||||
|
"energy_saved_kwh",
|
||||||
|
"firmware_update",
|
||||||
|
"mute_once",
|
||||||
|
"selfcheck_error",
|
||||||
|
"selfcheck_result",
|
||||||
|
"selfcheck_status"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"state_keys": [
|
||||||
|
"air_filter_status",
|
||||||
|
"air_filter_usage",
|
||||||
|
"alarm_code",
|
||||||
|
"auto_clean",
|
||||||
|
"climate",
|
||||||
|
"energy_kwh",
|
||||||
|
"firmware_update",
|
||||||
|
"mute_once",
|
||||||
|
"power_watts"
|
||||||
|
]
|
||||||
|
}
|
||||||
+4
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"state_keys": [
|
"state_keys": [
|
||||||
|
"ai_energy_level",
|
||||||
"alarm_code",
|
"alarm_code",
|
||||||
"auto_door_opener",
|
"auto_door_opener",
|
||||||
"autofill",
|
"autofill",
|
||||||
@@ -39,11 +40,13 @@
|
|||||||
"rapid_freezing",
|
"rapid_freezing",
|
||||||
"rapid_fridge",
|
"rapid_fridge",
|
||||||
"sabbath_mode",
|
"sabbath_mode",
|
||||||
|
"selfcheck_error",
|
||||||
"selfcheck_result",
|
"selfcheck_result",
|
||||||
"selfcheck_status",
|
"selfcheck_status",
|
||||||
"welcome_lighting"
|
"welcome_lighting"
|
||||||
],
|
],
|
||||||
"discovery_unique_ids": [
|
"discovery_unique_ids": [
|
||||||
|
"samsung_refrigerator_ai_energy_level",
|
||||||
"samsung_refrigerator_alarm_code",
|
"samsung_refrigerator_alarm_code",
|
||||||
"samsung_refrigerator_auto_door_opener",
|
"samsung_refrigerator_auto_door_opener",
|
||||||
"samsung_refrigerator_autofill",
|
"samsung_refrigerator_autofill",
|
||||||
@@ -83,6 +86,7 @@
|
|||||||
"samsung_refrigerator_rapid_freezing",
|
"samsung_refrigerator_rapid_freezing",
|
||||||
"samsung_refrigerator_rapid_fridge",
|
"samsung_refrigerator_rapid_fridge",
|
||||||
"samsung_refrigerator_sabbath_mode",
|
"samsung_refrigerator_sabbath_mode",
|
||||||
|
"samsung_refrigerator_selfcheck_error",
|
||||||
"samsung_refrigerator_selfcheck_result",
|
"samsung_refrigerator_selfcheck_result",
|
||||||
"samsung_refrigerator_selfcheck_start",
|
"samsung_refrigerator_selfcheck_start",
|
||||||
"samsung_refrigerator_selfcheck_status",
|
"samsung_refrigerator_selfcheck_status",
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"state_keys": [
|
"state_keys": [
|
||||||
|
"ai_energy_level",
|
||||||
"alarm_code",
|
"alarm_code",
|
||||||
"autofill",
|
"autofill",
|
||||||
"cooler_setpoint",
|
"cooler_setpoint",
|
||||||
@@ -28,6 +29,7 @@
|
|||||||
"rapid_freezing",
|
"rapid_freezing",
|
||||||
"rapid_fridge",
|
"rapid_fridge",
|
||||||
"sabbath_mode",
|
"sabbath_mode",
|
||||||
|
"selfcheck_error",
|
||||||
"selfcheck_result",
|
"selfcheck_result",
|
||||||
"selfcheck_status"
|
"selfcheck_status"
|
||||||
]
|
]
|
||||||
|
|||||||
Vendored
+4
@@ -1,6 +1,8 @@
|
|||||||
{
|
{
|
||||||
"state_keys": [
|
"state_keys": [
|
||||||
|
"ai_energy_level",
|
||||||
"alarm_code",
|
"alarm_code",
|
||||||
|
"bubble_soak",
|
||||||
"buzzer_sound",
|
"buzzer_sound",
|
||||||
"child_lock",
|
"child_lock",
|
||||||
"cycle",
|
"cycle",
|
||||||
@@ -14,9 +16,11 @@
|
|||||||
"energy_saved_kwh",
|
"energy_saved_kwh",
|
||||||
"finish_time",
|
"finish_time",
|
||||||
"firmware_update",
|
"firmware_update",
|
||||||
|
"intensive",
|
||||||
"job_beginning_status",
|
"job_beginning_status",
|
||||||
"machine_state",
|
"machine_state",
|
||||||
"power_switch",
|
"power_switch",
|
||||||
|
"pre_wash",
|
||||||
"progress",
|
"progress",
|
||||||
"progress_percentage",
|
"progress_percentage",
|
||||||
"remote_control",
|
"remote_control",
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"state_keys": [
|
"state_keys": [
|
||||||
"alarm_code",
|
"alarm_code",
|
||||||
|
"bubble_soak",
|
||||||
"child_lock",
|
"child_lock",
|
||||||
"cycle",
|
"cycle",
|
||||||
"cycle_active",
|
"cycle_active",
|
||||||
@@ -12,9 +13,11 @@
|
|||||||
"energy_kwh",
|
"energy_kwh",
|
||||||
"finish_time",
|
"finish_time",
|
||||||
"firmware_update",
|
"firmware_update",
|
||||||
|
"intensive",
|
||||||
"job_beginning_status",
|
"job_beginning_status",
|
||||||
"machine_state",
|
"machine_state",
|
||||||
"power_switch",
|
"power_switch",
|
||||||
|
"pre_wash",
|
||||||
"progress",
|
"progress",
|
||||||
"progress_percentage",
|
"progress_percentage",
|
||||||
"remote_control",
|
"remote_control",
|
||||||
|
|||||||
+2
-1
@@ -279,7 +279,8 @@
|
|||||||
"rep": {
|
"rep": {
|
||||||
"aiLevel": "1",
|
"aiLevel": "1",
|
||||||
"supportedAiLevel": [
|
"supportedAiLevel": [
|
||||||
"1"
|
"1",
|
||||||
|
"2"
|
||||||
],
|
],
|
||||||
"href": "/energy/ailevel/vs/0"
|
"href": "/energy/ailevel/vs/0"
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+15
@@ -44,6 +44,21 @@
|
|||||||
"href": "/energy/consumption/0",
|
"href": "/energy/consumption/0",
|
||||||
"rep": {}
|
"rep": {}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"href": "/energy/ailevel/vs/0",
|
||||||
|
"rep": {
|
||||||
|
"aiLevel": "0",
|
||||||
|
"supportedAiLevel": [
|
||||||
|
"1"
|
||||||
|
],
|
||||||
|
"energySavingInfo": [
|
||||||
|
{
|
||||||
|
"aiLevel": "1",
|
||||||
|
"maxEnergySavingRate": "70"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"href": "/course/vs/0",
|
"href": "/course/vs/0",
|
||||||
"rep": {
|
"rep": {
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from typing import Any
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
|
import cbor2
|
||||||
import pytest
|
import pytest
|
||||||
from pytest_homeassistant_custom_component.common import MockConfigEntry
|
from pytest_homeassistant_custom_component.common import MockConfigEntry
|
||||||
|
|
||||||
@@ -150,12 +152,26 @@ class FakeObserveSession:
|
|||||||
self.subscribed: list[str] = []
|
self.subscribed: list[str] = []
|
||||||
self.fail_hrefs: set[str] = set()
|
self.fail_hrefs: set[str] = set()
|
||||||
self.closed = False
|
self.closed = False
|
||||||
|
# When set to a rep dict, subscribe() immediately delivers that rep
|
||||||
|
# as an OBSERVE notification for the href — what a real device does
|
||||||
|
# when it answers a subscription with the current representation.
|
||||||
|
# `try_enter_observe_mode` clears its notified set before it
|
||||||
|
# subscribes, so this is the only way to deliver a notify that
|
||||||
|
# reliably counts: it lands synchronously via on_notification,
|
||||||
|
# after that clear and before the post-sleep fraction check — a
|
||||||
|
# notify raced in from another thread can be wiped by the clear
|
||||||
|
# (or arrive after the check) depending on scheduling. Set to
|
||||||
|
# None to model a device that answers subscriptions but never
|
||||||
|
# notifies.
|
||||||
|
self.notify_on_subscribe: dict[str, Any] | None = None
|
||||||
|
|
||||||
def subscribe(self, path_segs):
|
def subscribe(self, path_segs):
|
||||||
href = '/' + '/'.join(path_segs)
|
href = '/' + '/'.join(path_segs)
|
||||||
if href in self.fail_hrefs:
|
if href in self.fail_hrefs:
|
||||||
raise ConnectionError("subscribe failed")
|
raise ConnectionError("subscribe failed")
|
||||||
self.subscribed.append(href)
|
self.subscribed.append(href)
|
||||||
|
if self.notify_on_subscribe is not None and self.on_notification is not None:
|
||||||
|
self.on_notification(href, cbor2.dumps(self.notify_on_subscribe))
|
||||||
return b'\x01'
|
return b'\x01'
|
||||||
|
|
||||||
def refresh_observes(self, paths):
|
def refresh_observes(self, paths):
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
"""Tests for the LocalThingsCoordinator."""
|
"""Tests for the LocalThingsCoordinator."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import threading
|
|
||||||
import time
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from unittest.mock import AsyncMock, patch
|
from unittest.mock import AsyncMock, patch
|
||||||
|
|
||||||
@@ -260,21 +258,18 @@ async def test_enters_observe_mode_when_hot_warm_hrefs_notify(
|
|||||||
coordinator: LocalThingsCoordinator = hass.data[DOMAIN][mock_entry.entry_id]
|
coordinator: LocalThingsCoordinator = hass.data[DOMAIN][mock_entry.entry_id]
|
||||||
hrefs = coordinator._hot_hrefs + coordinator._warm_hrefs
|
hrefs = coordinator._hot_hrefs + coordinator._warm_hrefs
|
||||||
|
|
||||||
# try_enter_observe_mode clears prior notifications as soon as it
|
# try_enter_observe_mode clears prior notifications before it
|
||||||
# starts, so notifies must land *during* its grace-period sleep (same
|
# subscribes, then checks the notified fraction after the grace-period
|
||||||
# pattern test_observe.py uses), not before the call.
|
# sleep — a notify counts as long as it arrives in that window, not
|
||||||
def _notify_during_grace_period():
|
# specifically during the sleep itself. The fake session delivers one
|
||||||
time.sleep(0.005)
|
# synchronously from subscribe() for every href it subscribes to (see
|
||||||
for href in hrefs:
|
# FakeObserveSession.notify_on_subscribe in conftest.py), which lands
|
||||||
fake.on_notification(href, cbor2.dumps({'notified': True}))
|
# it in that window by construction rather than by timing.
|
||||||
|
fake.notify_on_subscribe = {'notified': True}
|
||||||
notifier = threading.Thread(target=_notify_during_grace_period, daemon=True)
|
|
||||||
notifier.start()
|
|
||||||
entered = await hass.async_add_executor_job(
|
entered = await hass.async_add_executor_job(
|
||||||
coordinator._observe.try_enter_observe_mode,
|
coordinator._observe.try_enter_observe_mode,
|
||||||
fake, hrefs, 0.02, 0.8,
|
fake, hrefs, 0.02, 0.8,
|
||||||
)
|
)
|
||||||
notifier.join()
|
|
||||||
|
|
||||||
assert entered is True
|
assert entered is True
|
||||||
assert coordinator._observe.mode == MODE_OBSERVE
|
assert coordinator._observe.mode == MODE_OBSERVE
|
||||||
@@ -300,18 +295,11 @@ async def test_reconnect_while_observe_mode_downgrades_to_poll(
|
|||||||
|
|
||||||
# Get the coordinator into observe mode the same way
|
# Get the coordinator into observe mode the same way
|
||||||
# test_enters_observe_mode_when_hot_warm_hrefs_notify does.
|
# test_enters_observe_mode_when_hot_warm_hrefs_notify does.
|
||||||
def _notify_during_grace_period():
|
fake.notify_on_subscribe = {'notified': True}
|
||||||
time.sleep(0.005)
|
|
||||||
for href in hrefs:
|
|
||||||
fake.on_notification(href, cbor2.dumps({'notified': True}))
|
|
||||||
|
|
||||||
notifier = threading.Thread(target=_notify_during_grace_period, daemon=True)
|
|
||||||
notifier.start()
|
|
||||||
entered = await hass.async_add_executor_job(
|
entered = await hass.async_add_executor_job(
|
||||||
coordinator._observe.try_enter_observe_mode,
|
coordinator._observe.try_enter_observe_mode,
|
||||||
fake, hrefs, 0.02, 0.8,
|
fake, hrefs, 0.02, 0.8,
|
||||||
)
|
)
|
||||||
notifier.join()
|
|
||||||
assert entered is True
|
assert entered is True
|
||||||
assert coordinator.observe_mode == MODE_OBSERVE
|
assert coordinator.observe_mode == MODE_OBSERVE
|
||||||
|
|
||||||
@@ -324,12 +312,12 @@ async def test_reconnect_while_observe_mode_downgrades_to_poll(
|
|||||||
|
|
||||||
# Simulate the existing "poll failed, reconnecting" branch: _poll_once
|
# Simulate the existing "poll failed, reconnecting" branch: _poll_once
|
||||||
# fails once (triggering the reconnect/backoff path), then succeeds.
|
# fails once (triggering the reconnect/backoff path), then succeeds.
|
||||||
# No fresh notifies are supplied for the immediate resubscribe attempt
|
# The device stops notifying on subscribe, so the immediate resubscribe
|
||||||
# this now triggers, so its grace period (shortened for tests by the
|
# attempt this now triggers gets nothing back and mode stays 'poll' —
|
||||||
# `_fast_coordinator_timers` autouse fixture — see conftest.py) times
|
# this test only asserts the tear-down half of the fix;
|
||||||
# out and mode stays 'poll' — this test only asserts the tear-down half of
|
# test_reconnect_from_observe_mode_resubscribes_immediately covers the
|
||||||
# the fix; test_reconnect_from_observe_mode_resubscribes_immediately
|
# successful-immediate-resubscribe half.
|
||||||
# covers the successful-immediate-resubscribe half.
|
fake.notify_on_subscribe = None
|
||||||
with (
|
with (
|
||||||
patch(
|
patch(
|
||||||
'custom_components.localthings.coordinator.LocalThingsCoordinator._poll_once',
|
'custom_components.localthings.coordinator.LocalThingsCoordinator._poll_once',
|
||||||
@@ -362,18 +350,11 @@ async def test_poll_timeout_skips_reconnect_when_push_is_healthy(
|
|||||||
coordinator: LocalThingsCoordinator = hass.data[DOMAIN][mock_entry.entry_id]
|
coordinator: LocalThingsCoordinator = hass.data[DOMAIN][mock_entry.entry_id]
|
||||||
hrefs = coordinator._hot_hrefs + coordinator._warm_hrefs
|
hrefs = coordinator._hot_hrefs + coordinator._warm_hrefs
|
||||||
|
|
||||||
def _notify_during_grace_period():
|
fake.notify_on_subscribe = {'notified': True}
|
||||||
time.sleep(0.005)
|
|
||||||
for href in hrefs:
|
|
||||||
fake.on_notification(href, cbor2.dumps({'notified': True}))
|
|
||||||
|
|
||||||
notifier = threading.Thread(target=_notify_during_grace_period, daemon=True)
|
|
||||||
notifier.start()
|
|
||||||
entered = await hass.async_add_executor_job(
|
entered = await hass.async_add_executor_job(
|
||||||
coordinator._observe.try_enter_observe_mode,
|
coordinator._observe.try_enter_observe_mode,
|
||||||
fake, hrefs, 0.02, 0.8,
|
fake, hrefs, 0.02, 0.8,
|
||||||
)
|
)
|
||||||
notifier.join()
|
|
||||||
assert entered is True
|
assert entered is True
|
||||||
assert coordinator.observe_mode == MODE_OBSERVE
|
assert coordinator.observe_mode == MODE_OBSERVE
|
||||||
|
|
||||||
@@ -408,18 +389,11 @@ async def test_poll_timeout_reconnects_after_consecutive_limit_even_with_push(
|
|||||||
coordinator: LocalThingsCoordinator = hass.data[DOMAIN][mock_entry.entry_id]
|
coordinator: LocalThingsCoordinator = hass.data[DOMAIN][mock_entry.entry_id]
|
||||||
hrefs = coordinator._hot_hrefs + coordinator._warm_hrefs
|
hrefs = coordinator._hot_hrefs + coordinator._warm_hrefs
|
||||||
|
|
||||||
def _notify_during_grace_period():
|
fake.notify_on_subscribe = {'notified': True}
|
||||||
time.sleep(0.005)
|
|
||||||
for href in hrefs:
|
|
||||||
fake.on_notification(href, cbor2.dumps({'notified': True}))
|
|
||||||
|
|
||||||
notifier = threading.Thread(target=_notify_during_grace_period, daemon=True)
|
|
||||||
notifier.start()
|
|
||||||
entered = await hass.async_add_executor_job(
|
entered = await hass.async_add_executor_job(
|
||||||
coordinator._observe.try_enter_observe_mode,
|
coordinator._observe.try_enter_observe_mode,
|
||||||
fake, hrefs, 0.02, 0.8,
|
fake, hrefs, 0.02, 0.8,
|
||||||
)
|
)
|
||||||
notifier.join()
|
|
||||||
assert entered is True
|
assert entered is True
|
||||||
assert coordinator.observe_mode == MODE_OBSERVE
|
assert coordinator.observe_mode == MODE_OBSERVE
|
||||||
|
|
||||||
@@ -441,7 +415,10 @@ async def test_poll_timeout_reconnects_after_consecutive_limit_even_with_push(
|
|||||||
assert coordinator.observe_mode == MODE_OBSERVE
|
assert coordinator.observe_mode == MODE_OBSERVE
|
||||||
|
|
||||||
# The final consecutive timeout crosses the limit and triggers the
|
# The final consecutive timeout crosses the limit and triggers the
|
||||||
# existing reconnect path, which then succeeds and downgrades.
|
# existing reconnect path, which then succeeds and downgrades. The
|
||||||
|
# device stops notifying on subscribe, so the resubscribe attempt that
|
||||||
|
# follows the reconnect finds nothing and mode stays 'poll'.
|
||||||
|
fake.notify_on_subscribe = None
|
||||||
with (
|
with (
|
||||||
patch(
|
patch(
|
||||||
'custom_components.localthings.coordinator.LocalThingsCoordinator._poll_once',
|
'custom_components.localthings.coordinator.LocalThingsCoordinator._poll_once',
|
||||||
@@ -473,18 +450,11 @@ async def test_poll_timeout_counter_resets_when_push_is_healthy_again(
|
|||||||
coordinator: LocalThingsCoordinator = hass.data[DOMAIN][mock_entry.entry_id]
|
coordinator: LocalThingsCoordinator = hass.data[DOMAIN][mock_entry.entry_id]
|
||||||
hrefs = coordinator._hot_hrefs + coordinator._warm_hrefs
|
hrefs = coordinator._hot_hrefs + coordinator._warm_hrefs
|
||||||
|
|
||||||
def _notify_during_grace_period():
|
fake.notify_on_subscribe = {'notified': True}
|
||||||
time.sleep(0.005)
|
|
||||||
for href in hrefs:
|
|
||||||
fake.on_notification(href, cbor2.dumps({'notified': True}))
|
|
||||||
|
|
||||||
notifier = threading.Thread(target=_notify_during_grace_period, daemon=True)
|
|
||||||
notifier.start()
|
|
||||||
entered = await hass.async_add_executor_job(
|
entered = await hass.async_add_executor_job(
|
||||||
coordinator._observe.try_enter_observe_mode,
|
coordinator._observe.try_enter_observe_mode,
|
||||||
fake, hrefs, 0.02, 0.8,
|
fake, hrefs, 0.02, 0.8,
|
||||||
)
|
)
|
||||||
notifier.join()
|
|
||||||
assert entered is True
|
assert entered is True
|
||||||
assert coordinator.observe_mode == MODE_OBSERVE
|
assert coordinator.observe_mode == MODE_OBSERVE
|
||||||
|
|
||||||
@@ -526,21 +496,11 @@ async def test_reconnect_from_observe_mode_resubscribes_immediately(
|
|||||||
coordinator: LocalThingsCoordinator = hass.data[DOMAIN][mock_entry.entry_id]
|
coordinator: LocalThingsCoordinator = hass.data[DOMAIN][mock_entry.entry_id]
|
||||||
hrefs = coordinator._hot_hrefs + coordinator._warm_hrefs
|
hrefs = coordinator._hot_hrefs + coordinator._warm_hrefs
|
||||||
|
|
||||||
def _notify(delay: float = 0.005) -> threading.Thread:
|
fake.notify_on_subscribe = {'notified': True}
|
||||||
def _run():
|
|
||||||
time.sleep(delay)
|
|
||||||
for href in hrefs:
|
|
||||||
fake.on_notification(href, cbor2.dumps({'notified': True}))
|
|
||||||
t = threading.Thread(target=_run, daemon=True)
|
|
||||||
t.start()
|
|
||||||
return t
|
|
||||||
|
|
||||||
notifier = _notify()
|
|
||||||
entered = await hass.async_add_executor_job(
|
entered = await hass.async_add_executor_job(
|
||||||
coordinator._observe.try_enter_observe_mode,
|
coordinator._observe.try_enter_observe_mode,
|
||||||
fake, hrefs, 0.02, 0.8,
|
fake, hrefs, 0.02, 0.8,
|
||||||
)
|
)
|
||||||
notifier.join()
|
|
||||||
assert entered is True
|
assert entered is True
|
||||||
assert coordinator.observe_mode == MODE_OBSERVE
|
assert coordinator.observe_mode == MODE_OBSERVE
|
||||||
|
|
||||||
@@ -563,10 +523,8 @@ async def test_reconnect_from_observe_mode_resubscribes_immediately(
|
|||||||
new=AsyncMock(),
|
new=AsyncMock(),
|
||||||
),
|
),
|
||||||
):
|
):
|
||||||
notifier = _notify()
|
|
||||||
await coordinator.async_request_refresh()
|
await coordinator.async_request_refresh()
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
notifier.join()
|
|
||||||
|
|
||||||
assert coordinator.observe_mode == MODE_OBSERVE
|
assert coordinator.observe_mode == MODE_OBSERVE
|
||||||
|
|
||||||
@@ -587,21 +545,11 @@ async def test_sweep_mismatch_never_downgrades_a_live_observe_session(
|
|||||||
hrefs = coordinator._hot_hrefs + coordinator._warm_hrefs
|
hrefs = coordinator._hot_hrefs + coordinator._warm_hrefs
|
||||||
assert len(hrefs) >= 2
|
assert len(hrefs) >= 2
|
||||||
|
|
||||||
def _notify(delay: float = 0.005) -> threading.Thread:
|
fake.notify_on_subscribe = {'notified': True}
|
||||||
def _run():
|
|
||||||
time.sleep(delay)
|
|
||||||
for href in hrefs:
|
|
||||||
fake.on_notification(href, cbor2.dumps({'notified': True}))
|
|
||||||
t = threading.Thread(target=_run, daemon=True)
|
|
||||||
t.start()
|
|
||||||
return t
|
|
||||||
|
|
||||||
notifier = _notify()
|
|
||||||
entered = await hass.async_add_executor_job(
|
entered = await hass.async_add_executor_job(
|
||||||
coordinator._observe.try_enter_observe_mode,
|
coordinator._observe.try_enter_observe_mode,
|
||||||
fake, hrefs, 0.02, 0.8,
|
fake, hrefs, 0.02, 0.8,
|
||||||
)
|
)
|
||||||
notifier.join()
|
|
||||||
assert entered is True
|
assert entered is True
|
||||||
assert coordinator.observe_mode == MODE_OBSERVE
|
assert coordinator.observe_mode == MODE_OBSERVE
|
||||||
|
|
||||||
@@ -637,21 +585,11 @@ async def test_sweep_mismatch_forces_subpolls_on_a_live_observe_session(
|
|||||||
hrefs = coordinator._hot_hrefs + coordinator._warm_hrefs
|
hrefs = coordinator._hot_hrefs + coordinator._warm_hrefs
|
||||||
assert len(hrefs) >= 2
|
assert len(hrefs) >= 2
|
||||||
|
|
||||||
def _notify(delay: float = 0.005) -> threading.Thread:
|
fake.notify_on_subscribe = {'notified': True}
|
||||||
def _run():
|
|
||||||
time.sleep(delay)
|
|
||||||
for href in hrefs:
|
|
||||||
fake.on_notification(href, cbor2.dumps({'notified': True}))
|
|
||||||
t = threading.Thread(target=_run, daemon=True)
|
|
||||||
t.start()
|
|
||||||
return t
|
|
||||||
|
|
||||||
notifier = _notify()
|
|
||||||
entered = await hass.async_add_executor_job(
|
entered = await hass.async_add_executor_job(
|
||||||
coordinator._observe.try_enter_observe_mode,
|
coordinator._observe.try_enter_observe_mode,
|
||||||
fake, hrefs, 0.02, 0.8,
|
fake, hrefs, 0.02, 0.8,
|
||||||
)
|
)
|
||||||
notifier.join()
|
|
||||||
assert entered is True
|
assert entered is True
|
||||||
assert coordinator.observe_mode == MODE_OBSERVE
|
assert coordinator.observe_mode == MODE_OBSERVE
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ climate entity itself lives in climate.py (imports homeassistant) and is not
|
|||||||
importable here -- consistent with how the other HA platform files are untested.
|
importable here -- consistent with how the other HA platform files are untested.
|
||||||
"""
|
"""
|
||||||
from custom_components.localthings.registry.adapter import flatten
|
from custom_components.localthings.registry.adapter import flatten
|
||||||
from custom_components.localthings.registry.by_type import for_device_by_model
|
from custom_components.localthings.registry.by_type import for_device, for_device_by_model
|
||||||
from custom_components.localthings.registry.capabilities import airconditioner
|
from custom_components.localthings.registry.capabilities import airconditioner
|
||||||
from custom_components.localthings.registry.discovery import discover
|
from custom_components.localthings.registry.discovery import discover
|
||||||
from custom_components.localthings.registry.entities import ClimateDesc
|
from custom_components.localthings.registry.entities import ClimateDesc
|
||||||
@@ -23,6 +23,22 @@ def _ac():
|
|||||||
return reg, resources
|
return reg, resources
|
||||||
|
|
||||||
|
|
||||||
|
def _resolve(name):
|
||||||
|
"""Mirror the coordinator's detection order: oneUiVersion first, modelNum
|
||||||
|
fallback second (needed for issue #37's board, which reports neither
|
||||||
|
oneUiVersion nor a '_PRAC_' modelNum token)."""
|
||||||
|
resources = _load_device(name)
|
||||||
|
otn = resources.get('/otninformation/vs/0', {})
|
||||||
|
one_ui = otn.get('swVersionInfo', {}).get('oneUiVersion', '')
|
||||||
|
info = resources['/information/vs/0']
|
||||||
|
reg = for_device(one_ui) if one_ui else None
|
||||||
|
if reg is None:
|
||||||
|
reg = for_device_by_model(
|
||||||
|
info['x.com.samsung.da.modelNum'], info['x.com.samsung.da.description'],
|
||||||
|
)
|
||||||
|
return reg, resources
|
||||||
|
|
||||||
|
|
||||||
def _bound():
|
def _bound():
|
||||||
reg, resources = _ac()
|
reg, resources = _ac()
|
||||||
return discover(resources, reg.capabilities, reg.pattern_capabilities), resources
|
return discover(resources, reg.capabilities, reg.pattern_capabilities), resources
|
||||||
@@ -106,3 +122,114 @@ def test_climate_consumed_hrefs_declared_as_coverage():
|
|||||||
caps = reg.capabilities.get(href)
|
caps = reg.capabilities.get(href)
|
||||||
assert caps, href
|
assert caps, href
|
||||||
assert all(c.entities == () for c in caps), href
|
assert all(c.entities == () for c in caps), href
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# TP1X_DA-AC-RAC-01011 (oneUiVersion "7.0 Air conditioner", Tizen Lite) -- a
|
||||||
|
# newer model class than the ARTIK051_PRAC dump above. It has no OCF-standard
|
||||||
|
# /temperature/current+desired pair (temperature lives on the vendor
|
||||||
|
# /temperatures/vs/0 items[] resource), exposes a /light/vs/0 display light, and
|
||||||
|
# carries extra vendor housekeeping hrefs. Issue #17 for this class (PR #36).
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
def _ac_tp1x():
|
||||||
|
resources = _load_device('airconditioner_tp1x_da_ac_rac_01011')
|
||||||
|
one_ui = resources['/otninformation/vs/0']['swVersionInfo']['oneUiVersion']
|
||||||
|
return for_device(one_ui), resources
|
||||||
|
|
||||||
|
|
||||||
|
def test_tp1x_resolves_to_airconditioner_registry():
|
||||||
|
reg, _ = _ac_tp1x()
|
||||||
|
assert reg is not None and reg.name == 'airconditioner'
|
||||||
|
|
||||||
|
|
||||||
|
def test_tp1x_no_unbound_hrefs():
|
||||||
|
"""Every resource in the TP1X dump binds or is covered -- including
|
||||||
|
/temperatures/vs/0, /light/vs/0 and the housekeeping hrefs absent from
|
||||||
|
the ARTIK051 dump. Clears the coverage-gap repair."""
|
||||||
|
reg, resources = _ac_tp1x()
|
||||||
|
unbound = []
|
||||||
|
discover(resources, reg.capabilities, reg.pattern_capabilities, log=unbound.append)
|
||||||
|
assert unbound == []
|
||||||
|
|
||||||
|
|
||||||
|
def test_tp1x_display_light_switch_present():
|
||||||
|
"""/light/vs/0 (mode On/Off) surfaces as the display-light switch."""
|
||||||
|
reg, resources = _ac_tp1x()
|
||||||
|
state = flatten(
|
||||||
|
discover(resources, reg.capabilities, reg.pattern_capabilities), resources)
|
||||||
|
assert state.get('display_light') is True # device reports mode == 'On'
|
||||||
|
|
||||||
|
|
||||||
|
def test_tp1x_vendor_temperature_and_light_covered():
|
||||||
|
"""The vendor temperature resource (read by the climate entity) and the
|
||||||
|
display-light resource both resolve in the registry -- no gap."""
|
||||||
|
reg, _ = _ac_tp1x()
|
||||||
|
assert reg.capabilities.get('/temperatures/vs/0'), '/temperatures/vs/0'
|
||||||
|
assert reg.capabilities.get('/light/vs/0'), '/light/vs/0'
|
||||||
|
|
||||||
|
|
||||||
|
def test_tp1x_climate_entity_is_bound():
|
||||||
|
"""The composite climate entity still binds the primary /mode/vs/0."""
|
||||||
|
reg, resources = _ac_tp1x()
|
||||||
|
bound = discover(resources, reg.capabilities, reg.pattern_capabilities)
|
||||||
|
climate = [b for b in bound if isinstance(b.desc, ClimateDesc)]
|
||||||
|
assert len(climate) == 1 and climate[0].href == '/mode/vs/0'
|
||||||
|
|
||||||
|
|
||||||
|
def test_tp2x_rac_20k_model_resolves_via_model_fallback():
|
||||||
|
"""TP2X_RAC_20K (issue #37) reports no oneUiVersion and no '_PRAC_' token
|
||||||
|
-- resolved via the '_RAC_' modelNum fallback added for this device."""
|
||||||
|
reg, _ = _resolve('airconditioner_tp2x_rac_20k')
|
||||||
|
assert reg is not None and reg.name == 'airconditioner'
|
||||||
|
|
||||||
|
|
||||||
|
def test_tp2x_rac_20k_no_unbound_hrefs():
|
||||||
|
reg, resources = _resolve('airconditioner_tp2x_rac_20k')
|
||||||
|
unbound = []
|
||||||
|
discover(resources, reg.capabilities, reg.pattern_capabilities, log=unbound.append)
|
||||||
|
assert unbound == []
|
||||||
|
|
||||||
|
|
||||||
|
def test_tp1x_rac_model_resolves_via_one_ui_version():
|
||||||
|
"""TP1X_DA-AC-RAC-01001_0000 (issue #38) self-reports oneUiVersion
|
||||||
|
'7.0 Air conditioner' -- resolved via for_device(), not the modelNum
|
||||||
|
fallback."""
|
||||||
|
reg, _ = _resolve('airconditioner_tp1x_rac')
|
||||||
|
assert reg is not None and reg.name == 'airconditioner'
|
||||||
|
|
||||||
|
|
||||||
|
def test_tp1x_rac_no_unbound_hrefs():
|
||||||
|
reg, resources = _resolve('airconditioner_tp1x_rac')
|
||||||
|
unbound = []
|
||||||
|
discover(resources, reg.capabilities, reg.pattern_capabilities, log=unbound.append)
|
||||||
|
assert unbound == []
|
||||||
|
|
||||||
|
|
||||||
|
def test_tp1x_rac_expected_state_keys_present():
|
||||||
|
reg, resources = _resolve('airconditioner_tp1x_rac')
|
||||||
|
bound = discover(resources, reg.capabilities, reg.pattern_capabilities)
|
||||||
|
state = flatten(bound, resources)
|
||||||
|
for key in ('climate', 'display_light', 'mute_once', 'selfcheck_status',
|
||||||
|
'selfcheck_result', 'current_limit_enabled', 'current_limit_level'):
|
||||||
|
assert key in state, key
|
||||||
|
|
||||||
|
|
||||||
|
def test_mute_once_write_target():
|
||||||
|
write = airconditioner.MUTE_ONCE.entities[0].write_fn
|
||||||
|
assert write('On', {}) == (['option', 'muteonce', 'vs', '0'], {'muteonce': 'On'})
|
||||||
|
assert write('Off', {}) == (['option', 'muteonce', 'vs', '0'], {'muteonce': 'Off'})
|
||||||
|
|
||||||
|
|
||||||
|
def test_display_light_write_target():
|
||||||
|
write = airconditioner.DISPLAY_LIGHT.entities[0].write_fn
|
||||||
|
assert write('On', {}) == (['light', 'vs', '0'], {'mode': 'On'})
|
||||||
|
assert write('Off', {}) == (['light', 'vs', '0'], {'mode': 'Off'})
|
||||||
|
|
||||||
|
|
||||||
|
def test_current_limit_is_read_only():
|
||||||
|
"""Meaning/write contract for the current-limit levels isn't confirmed
|
||||||
|
from the dump alone -- exposed as read-only diagnostic sensors rather
|
||||||
|
than a guessed writable control."""
|
||||||
|
for desc in airconditioner.CURRENT_LIMIT.entities:
|
||||||
|
assert getattr(desc, 'write_fn', None) is None
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
"""Tests for the /temperatures/vs/0 fallback helper in climate.py (PR #36).
|
||||||
|
|
||||||
|
`_temps_vs_item` is a pure module-level function (plain dict in, plain dict
|
||||||
|
out) with no coordinator/entity dependency, so -- like select.py's `_display`
|
||||||
|
in test_select_display.py -- it's testable directly even though the
|
||||||
|
LocalThingsClimate entity itself needs a coordinator/hass fixture to
|
||||||
|
exercise. This covers the actual fallback-selection logic that the
|
||||||
|
registry-level "no unbound hrefs" tests in test_airconditioner_capabilities.py
|
||||||
|
don't reach: TP1X-class firmware has no OCF-standard
|
||||||
|
/temperature/current+desired pair, so current_temperature/target_temperature
|
||||||
|
would silently be None without this fallback.
|
||||||
|
"""
|
||||||
|
from custom_components.localthings.climate import _temps_vs_item
|
||||||
|
|
||||||
|
|
||||||
|
def test_temps_vs_item_returns_first_item():
|
||||||
|
rep = {
|
||||||
|
'x.com.samsung.da.items': [
|
||||||
|
{'x.com.samsung.da.current': '17.0', 'x.com.samsung.da.desired': '25.0'},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
assert _temps_vs_item(rep) == {
|
||||||
|
'x.com.samsung.da.current': '17.0', 'x.com.samsung.da.desired': '25.0',
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def test_temps_vs_item_empty_when_items_missing():
|
||||||
|
"""OCF-pair devices don't populate /temperatures/vs/0's items at all --
|
||||||
|
callers must fall through to the OCF hrefs cleanly, not raise."""
|
||||||
|
assert _temps_vs_item({}) == {}
|
||||||
|
|
||||||
|
|
||||||
|
def test_temps_vs_item_empty_when_items_is_empty_list():
|
||||||
|
assert _temps_vs_item({'x.com.samsung.da.items': []}) == {}
|
||||||
|
|
||||||
|
|
||||||
|
def test_temps_vs_item_empty_when_items_entry_is_not_a_dict():
|
||||||
|
assert _temps_vs_item({'x.com.samsung.da.items': ['not-a-dict']}) == {}
|
||||||
@@ -130,3 +130,202 @@ class TestEnergyMeter:
|
|||||||
phantom power sensor (the exists_fn replaces the field-presence gate)."""
|
phantom power sensor (the exists_fn replaces the field-presence gate)."""
|
||||||
pw = next(e for e in common.ENERGY_METER.entities if e.key == 'power_watts')
|
pw = next(e for e in common.ENERGY_METER.entities if e.key == 'power_watts')
|
||||||
assert pw.exists_fn({'x.com.samsung.da.cumulativePower': '5'}, {}) is False
|
assert pw.exists_fn({'x.com.samsung.da.cumulativePower': '5'}, {}) is False
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# AI energy-saving level. '0' is off; supportedAiLevel lists the additional
|
||||||
|
# level(s) on offer. A single-entry list (issue #21 fridge, issue #40 washer)
|
||||||
|
# is really a binary toggle, so it's exposed as a switch instead of a
|
||||||
|
# one-choice select; multiple entries get a select with '0' synthesized back
|
||||||
|
# in as the explicit off option (supportedAiLevel never lists '0' itself, but
|
||||||
|
# it's a real, observed value of aiLevel).
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
def _ai_energy_level_desc(cls_name):
|
||||||
|
return next(e for e in common.AI_ENERGY_LEVEL.entities
|
||||||
|
if e.__class__.__name__ == cls_name)
|
||||||
|
|
||||||
|
|
||||||
|
class TestAiEnergyLevelSwitch:
|
||||||
|
def _desc(self):
|
||||||
|
return _ai_energy_level_desc('SwitchDesc')
|
||||||
|
|
||||||
|
def test_href(self):
|
||||||
|
assert common.AI_ENERGY_LEVEL.href == '/energy/ailevel/vs/0'
|
||||||
|
|
||||||
|
def test_shown_only_with_single_supported_level(self):
|
||||||
|
desc = self._desc()
|
||||||
|
assert desc.exists_fn({'aiLevel': '1', 'supportedAiLevel': ['1']}, {}) is True
|
||||||
|
assert desc.exists_fn({'aiLevel': '1', 'supportedAiLevel': ['1', '2']}, {}) is False
|
||||||
|
|
||||||
|
def test_hidden_when_supported_level_is_non_list_scalar(self):
|
||||||
|
"""A stray scalar (e.g. a string) must not be len()-checked as if it
|
||||||
|
were a list -- a 2-char string would otherwise wrongly pass `== 1`
|
||||||
|
style checks."""
|
||||||
|
desc = self._desc()
|
||||||
|
assert desc.exists_fn({'aiLevel': '1', 'supportedAiLevel': '1'}, {}) is False
|
||||||
|
|
||||||
|
def test_hidden_when_supported_level_missing(self):
|
||||||
|
desc = self._desc()
|
||||||
|
assert desc.exists_fn({'aiLevel': '1'}, {}) is False
|
||||||
|
|
||||||
|
def test_hidden_when_supported_level_empty_list(self):
|
||||||
|
desc = self._desc()
|
||||||
|
assert desc.exists_fn({'aiLevel': '0', 'supportedAiLevel': []}, {}) is False
|
||||||
|
|
||||||
|
def test_hidden_on_empty_stub_rep(self):
|
||||||
|
desc = self._desc()
|
||||||
|
assert desc.exists_fn({}, {}) is False
|
||||||
|
|
||||||
|
def test_value_fn(self):
|
||||||
|
desc = self._desc()
|
||||||
|
assert desc.value_fn('0') is False
|
||||||
|
assert desc.value_fn('1') is True
|
||||||
|
|
||||||
|
def test_write_on_uses_the_single_supported_level(self):
|
||||||
|
"""The on-value is whatever the device calls its one level, not a
|
||||||
|
hardcoded '1'."""
|
||||||
|
desc = self._desc()
|
||||||
|
path, body = desc.write_fn('On', {'supportedAiLevel': ['2']})
|
||||||
|
assert path == ['energy', 'ailevel', 'vs', '0']
|
||||||
|
assert body == {'aiLevel': '2'}
|
||||||
|
|
||||||
|
def test_write_off(self):
|
||||||
|
desc = self._desc()
|
||||||
|
path, body = desc.write_fn('Off', {'supportedAiLevel': ['1']})
|
||||||
|
assert body == {'aiLevel': '0'}
|
||||||
|
|
||||||
|
|
||||||
|
class TestAiEnergyLevelSelect:
|
||||||
|
def _desc(self):
|
||||||
|
return _ai_energy_level_desc('SelectDesc')
|
||||||
|
|
||||||
|
def test_shown_only_with_multiple_supported_levels(self):
|
||||||
|
desc = self._desc()
|
||||||
|
assert desc.exists_fn({'aiLevel': '1', 'supportedAiLevel': ['1', '2']}, {}) is True
|
||||||
|
assert desc.exists_fn({'aiLevel': '1', 'supportedAiLevel': ['1']}, {}) is False
|
||||||
|
|
||||||
|
def test_hidden_when_supported_level_is_non_list_scalar(self):
|
||||||
|
desc = self._desc()
|
||||||
|
assert desc.exists_fn({'aiLevel': '1', 'supportedAiLevel': '12'}, {}) is False
|
||||||
|
|
||||||
|
def test_hidden_when_supported_level_missing(self):
|
||||||
|
desc = self._desc()
|
||||||
|
assert desc.exists_fn({'aiLevel': '1'}, {}) is False
|
||||||
|
|
||||||
|
def test_hidden_when_supported_level_empty_list(self):
|
||||||
|
desc = self._desc()
|
||||||
|
assert desc.exists_fn({'aiLevel': '0', 'supportedAiLevel': []}, {}) is False
|
||||||
|
|
||||||
|
def test_no_translation_key(self):
|
||||||
|
"""aiLevel's values are plain digits that render fine untranslated
|
||||||
|
(select.py's _display()) -- no strings.json entry to maintain
|
||||||
|
against an unknown number of future levels."""
|
||||||
|
desc = self._desc()
|
||||||
|
assert desc.translation_key is None
|
||||||
|
|
||||||
|
def test_options_synthesize_off(self):
|
||||||
|
"""'0' is never in supportedAiLevel but is a real, observed aiLevel
|
||||||
|
value -- synthesized back in as the explicit off option."""
|
||||||
|
desc = self._desc()
|
||||||
|
resources = {'/energy/ailevel/vs/0': {'supportedAiLevel': ['1', '2']}}
|
||||||
|
assert desc.options(resources) == ['0', '1', '2']
|
||||||
|
|
||||||
|
def test_options_empty_when_resource_missing(self):
|
||||||
|
desc = self._desc()
|
||||||
|
assert desc.options({}) == ['0']
|
||||||
|
|
||||||
|
def test_write(self):
|
||||||
|
desc = self._desc()
|
||||||
|
path, body = desc.write_fn('2', {})
|
||||||
|
assert path == ['energy', 'ailevel', 'vs', '0']
|
||||||
|
assert body == {'aiLevel': '2'}
|
||||||
|
|
||||||
|
|
||||||
|
class TestAiEnergyLevelStubDoesNotDecideThePlatform:
|
||||||
|
"""Issue found in review: entity *creation* runs once, against whatever
|
||||||
|
snapshot is current when platforms are set up (see
|
||||||
|
__init__.py's async_config_entry_first_refresh-before-forward-entry-setups
|
||||||
|
ordering), while flatten() re-evaluates exists_fn every poll against live
|
||||||
|
data. Both descriptors share key='ai_energy_level' (see adapter._key), so
|
||||||
|
if a stub carve-out let one of them win at setup time while the other
|
||||||
|
wins once real data lands, flatten() would feed the already-instantiated
|
||||||
|
entity a value shaped for the other platform (e.g. a bool into a Select
|
||||||
|
expecting a string option). Neither side gets a `not rep` carve-out, so
|
||||||
|
an unfetched stub can never win entity creation for either platform --
|
||||||
|
the entity simply doesn't appear until a reload happens with real data,
|
||||||
|
same as any other exists_fn-gated entity in this codebase that's unlucky
|
||||||
|
on first-poll timing, instead of appearing as the wrong widget type."""
|
||||||
|
|
||||||
|
def test_neither_widget_exists_on_empty_stub_rep(self):
|
||||||
|
switch = _ai_energy_level_desc('SwitchDesc')
|
||||||
|
select = _ai_energy_level_desc('SelectDesc')
|
||||||
|
assert switch.exists_fn({}, {}) is False
|
||||||
|
assert select.exists_fn({}, {}) is False
|
||||||
|
|
||||||
|
|
||||||
|
class TestSelfCheckError:
|
||||||
|
"""Self-check diagnostic error list -- surfaced on hardware that reports
|
||||||
|
x.com.samsung.da.error, joined into a single display string."""
|
||||||
|
|
||||||
|
def _desc(self):
|
||||||
|
return next(e for e in common.SELF_CHECK.entities if e.key == 'selfcheck_error')
|
||||||
|
|
||||||
|
def test_exists_when_field_present(self):
|
||||||
|
desc = self._desc()
|
||||||
|
assert desc.exists_fn({'x.com.samsung.da.error': ['DA_ERROR_NONE']}, {}) is True
|
||||||
|
|
||||||
|
def test_does_not_exist_when_field_absent(self):
|
||||||
|
desc = self._desc()
|
||||||
|
assert desc.exists_fn({'x.com.samsung.da.status': 'Ready'}, {}) is False
|
||||||
|
|
||||||
|
def test_exists_for_empty_stub_rep(self):
|
||||||
|
"""An empty {} rep is /device/0's not-yet-fetched-stub carve-out --
|
||||||
|
must be included-for-now, same as ENERGY_METER's fields."""
|
||||||
|
desc = self._desc()
|
||||||
|
assert desc.exists_fn({}, {}) is True
|
||||||
|
|
||||||
|
def test_value_joins_list(self):
|
||||||
|
desc = self._desc()
|
||||||
|
assert desc.value_fn(['E1', 'E2']) == 'E1, E2'
|
||||||
|
|
||||||
|
def test_value_passes_through_scalar(self):
|
||||||
|
desc = self._desc()
|
||||||
|
assert desc.value_fn('DA_ERROR_NONE') == 'DA_ERROR_NONE'
|
||||||
|
|
||||||
|
def test_value_none_for_empty_list(self):
|
||||||
|
"""An empty error list means no value to show -- None (unknown),
|
||||||
|
not an empty string."""
|
||||||
|
desc = self._desc()
|
||||||
|
assert desc.value_fn([]) is None
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Cross-family bundles (UNIVERSAL / POWER) -- unpacked into every by_type
|
||||||
|
# registry's _build([...]) call in place of the hand-duplicated capability
|
||||||
|
# lists that used to live there.
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
class TestUniversalAndPowerBundles:
|
||||||
|
def test_universal_contains_the_no_conflict_capabilities(self):
|
||||||
|
assert set(common.UNIVERSAL) == {
|
||||||
|
common.ALARMS, common.ENERGY_METER, common.FIRMWARE_UPDATE,
|
||||||
|
common.SELF_CHECK, common.AI_ENERGY_LEVEL,
|
||||||
|
common.KIDS_LOCK_GENERIC, common.KIDS_LOCK_VS_FALLBACK,
|
||||||
|
common.REMOTE_CONTROL_GENERIC, common.REMOTE_CONTROL_VS_FALLBACK,
|
||||||
|
}
|
||||||
|
|
||||||
|
def test_power_kept_separate_for_airconditioners_sake(self):
|
||||||
|
"""See common.POWER's own comment for why airconditioner opts out."""
|
||||||
|
assert set(common.POWER) == {common.POWER_GENERIC, common.POWER_VS_FALLBACK}
|
||||||
|
|
||||||
|
def test_no_overlap_between_the_two_bundles(self):
|
||||||
|
assert not (set(common.UNIVERSAL) & set(common.POWER))
|
||||||
|
|
||||||
|
def test_airconditioner_registry_does_not_include_power(self):
|
||||||
|
from custom_components.localthings.registry.by_type import airconditioner
|
||||||
|
bound_caps = {c for caps in airconditioner.REGISTRY.capabilities.values() for c in caps}
|
||||||
|
assert common.POWER_GENERIC not in bound_caps
|
||||||
|
assert common.POWER_VS_FALLBACK not in bound_caps
|
||||||
@@ -171,6 +171,7 @@ class TestTp1xNativeDuplicateResources:
|
|||||||
assert 'ice_maker_enabled' not in state
|
assert 'ice_maker_enabled' not in state
|
||||||
assert state['icemaker_one_enabled'] is True
|
assert state['icemaker_one_enabled'] is True
|
||||||
assert state['icemaker_two_enabled'] is True
|
assert state['icemaker_two_enabled'] is True
|
||||||
|
assert state['selfcheck_error'] == 'DA_ERROR_NONE'
|
||||||
|
|
||||||
|
|
||||||
class TestPantryZone:
|
class TestPantryZone:
|
||||||
@@ -228,3 +229,32 @@ class TestArtik051AndTp2xFixturesHaveCompleteCoverage:
|
|||||||
assert unbound == []
|
assert unbound == []
|
||||||
state = flatten(bound, resources)
|
state = flatten(bound, resources)
|
||||||
assert state['flex_zone_mode'] == 'CV_FDR_BEVERAGE'
|
assert state['flex_zone_mode'] == 'CV_FDR_BEVERAGE'
|
||||||
|
|
||||||
|
|
||||||
|
class TestRefrigeratorAiEnergyLevelFixtureCoverage:
|
||||||
|
"""AI energy-saving level (common.AI_ENERGY_LEVEL, see
|
||||||
|
test_common_capabilities.py) is exercised end-to-end here against the
|
||||||
|
refrigerator fixture/registry.
|
||||||
|
|
||||||
|
refrigerator_device.json's supportedAiLevel was extended to two entries
|
||||||
|
(['1', '2']) specifically to exercise the select branch -- the real
|
||||||
|
captured TP1X_REF_21K_US dump only ever reports one entry (switch
|
||||||
|
branch), so the select is synthetic-fixture-only for now."""
|
||||||
|
|
||||||
|
def test_synthetic_fixture_has_complete_coverage(self):
|
||||||
|
from custom_components.localthings.registry.adapter import flatten
|
||||||
|
from custom_components.localthings.registry.by_type import refrigerator
|
||||||
|
from custom_components.localthings.registry.discovery import discover
|
||||||
|
from tests.conftest import _load_device
|
||||||
|
|
||||||
|
resources = _load_device('refrigerator')
|
||||||
|
unbound = []
|
||||||
|
bound = discover(
|
||||||
|
resources,
|
||||||
|
refrigerator.REGISTRY.capabilities,
|
||||||
|
refrigerator.REGISTRY.pattern_capabilities,
|
||||||
|
log=unbound.append,
|
||||||
|
)
|
||||||
|
assert unbound == []
|
||||||
|
state = flatten(bound, resources)
|
||||||
|
assert state['ai_energy_level'] == '1'
|
||||||
@@ -153,6 +153,52 @@ def test_registry_reproduces_golden_state_keys_for_tp2x_ref_20k():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_registry_reproduces_golden_state_keys_for_ac_tp1x_da_ac_rac_01011():
|
||||||
|
"""Newer AC firmware (Tizen Lite, oneUiVersion "7.0 Air conditioner"; model
|
||||||
|
TP1X_DA-AC-RAC-01011) reports temperature via the vendor /temperatures/vs/0
|
||||||
|
items[] resource and adds a /light/vs/0 display light, with extra vendor
|
||||||
|
housekeeping hrefs -- issue #17 for this model class (PR #36)."""
|
||||||
|
from tests.conftest import _load_device
|
||||||
|
resources = _load_device('airconditioner_tp1x_da_ac_rac_01011')
|
||||||
|
golden = json.loads(
|
||||||
|
(GOLDEN / 'airconditioner_tp1x_da_ac_rac_01011.json').read_text()
|
||||||
|
)
|
||||||
|
state_keys = _new_state_keys('airconditioner_tp1x_da_ac_rac_01011', resources)
|
||||||
|
assert set(state_keys) == set(golden['state_keys']), (
|
||||||
|
f"state_keys mismatch:\n"
|
||||||
|
f" extra: {sorted(set(state_keys) - set(golden['state_keys']))}\n"
|
||||||
|
f" missing: {sorted(set(golden['state_keys']) - set(state_keys))}"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_registry_reproduces_golden_state_keys_for_tp2x_rac_20k():
|
||||||
|
"""TP2X_RAC_20K (issue #37) -- reports no oneUiVersion; resolved via the
|
||||||
|
'_RAC_' modelNum token fallback in for_device_by_model."""
|
||||||
|
from tests.conftest import _load_device
|
||||||
|
resources = _load_device('airconditioner_tp2x_rac_20k')
|
||||||
|
golden = json.loads((GOLDEN / 'airconditioner_tp2x_rac_20k.json').read_text())
|
||||||
|
state_keys = _new_state_keys('airconditioner_tp2x_rac_20k', resources)
|
||||||
|
assert set(state_keys) == set(golden['state_keys']), (
|
||||||
|
f"state_keys mismatch:\n"
|
||||||
|
f" extra: {sorted(set(state_keys) - set(golden['state_keys']))}\n"
|
||||||
|
f" missing: {sorted(set(golden['state_keys']) - set(state_keys))}"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_registry_reproduces_golden_state_keys_for_tp1x_rac():
|
||||||
|
"""TP1X_DA-AC-RAC-01001_0000 (issue #38) -- fuller RAC board with display
|
||||||
|
light, self-check, mute-once, and a current-limit setting."""
|
||||||
|
from tests.conftest import _load_device
|
||||||
|
resources = _load_device('airconditioner_tp1x_rac')
|
||||||
|
golden = json.loads((GOLDEN / 'airconditioner_tp1x_rac.json').read_text())
|
||||||
|
state_keys = _new_state_keys('airconditioner_tp1x_rac', resources)
|
||||||
|
assert set(state_keys) == set(golden['state_keys']), (
|
||||||
|
f"state_keys mismatch:\n"
|
||||||
|
f" extra: {sorted(set(state_keys) - set(golden['state_keys']))}\n"
|
||||||
|
f" missing: {sorted(set(golden['state_keys']) - set(state_keys))}"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_resources_from_batch_preferred_over_flat():
|
def test_resources_from_batch_preferred_over_flat():
|
||||||
from tests.conftest import _resources_from_dump
|
from tests.conftest import _resources_from_dump
|
||||||
dump = {
|
dump = {
|
||||||
|
|||||||
@@ -251,6 +251,161 @@ class TestDetergentSoftenerDosing:
|
|||||||
assert self._desc('detergent_low').exists_fn(rep, {}) is True
|
assert self._desc('detergent_low').exists_fn(rep, {}) is True
|
||||||
|
|
||||||
|
|
||||||
|
class TestWashOptionToggles:
|
||||||
|
"""Bubble soak / pre-wash / intensive-wash switches, from the same
|
||||||
|
options[] array as the cycle select (issue #22 follow-up). Confirmed
|
||||||
|
On/Off shape from a dump with Bubble Soak toggled on in the app."""
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _desc(key):
|
||||||
|
return next(e for e in washer.WASHER_COURSE.entities if e.key == key)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _keys():
|
||||||
|
return ('bubble_soak', 'pre_wash', 'intensive')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _prefix(key):
|
||||||
|
return {'bubble_soak': 'BubbleSoak',
|
||||||
|
'pre_wash': 'PreWashSetting',
|
||||||
|
'intensive': 'IntensiveSetting'}[key]
|
||||||
|
|
||||||
|
def test_exists_only_when_field_present(self):
|
||||||
|
for key in self._keys():
|
||||||
|
desc = self._desc(key)
|
||||||
|
assert desc.exists_fn({'x.com.samsung.da.options': []}, {}) is False
|
||||||
|
prefix = self._prefix(key)
|
||||||
|
rep = {'x.com.samsung.da.options': [f'{prefix}_Off']}
|
||||||
|
assert desc.exists_fn(rep, {}) is True
|
||||||
|
|
||||||
|
def test_reads_off(self):
|
||||||
|
for key in self._keys():
|
||||||
|
prefix = self._prefix(key)
|
||||||
|
rep = {'x.com.samsung.da.options': [f'{prefix}_Off']}
|
||||||
|
assert self._desc(key).rep_fn(rep) is False
|
||||||
|
|
||||||
|
def test_reads_on(self):
|
||||||
|
for key in self._keys():
|
||||||
|
prefix = self._prefix(key)
|
||||||
|
rep = {'x.com.samsung.da.options': [f'{prefix}_On']}
|
||||||
|
assert self._desc(key).rep_fn(rep) is True
|
||||||
|
|
||||||
|
def test_write_on_and_off(self):
|
||||||
|
"""write_fn receives the same 'On'/'Off' string switch.py sends
|
||||||
|
(not a bool) -- covers a bug where an earlier `'On' if p else 'Off'`
|
||||||
|
implementation always wrote 'On', since any non-empty string
|
||||||
|
(including 'Off') is truthy."""
|
||||||
|
for key in self._keys():
|
||||||
|
prefix = self._prefix(key)
|
||||||
|
rep = {'x.com.samsung.da.options': [f'{prefix}_Off', 'GMT_02']}
|
||||||
|
path, body = self._desc(key).write_fn('On', rep)
|
||||||
|
assert path == ['course', 'vs', '0']
|
||||||
|
assert f'{prefix}_On' in body['x.com.samsung.da.options']
|
||||||
|
assert 'GMT_02' in body['x.com.samsung.da.options']
|
||||||
|
|
||||||
|
rep = {'x.com.samsung.da.options': [f'{prefix}_On']}
|
||||||
|
path, body = self._desc(key).write_fn('Off', rep)
|
||||||
|
assert f'{prefix}_Off' in body['x.com.samsung.da.options']
|
||||||
|
assert f'{prefix}_On' not in body['x.com.samsung.da.options']
|
||||||
|
|
||||||
|
def test_write_rejects_non_on_off_payload(self):
|
||||||
|
for key in self._keys():
|
||||||
|
prefix = self._prefix(key)
|
||||||
|
rep = {'x.com.samsung.da.options': [f'{prefix}_Off']}
|
||||||
|
assert self._desc(key).write_fn('bogus', rep) is None
|
||||||
|
|
||||||
|
|
||||||
|
# editCourseList and availability bitmaps from the reporter's issue #22
|
||||||
|
# follow-up dump (WD90T654DBN/S1, course '30' selected, Bubble Soak just
|
||||||
|
# turned on in the app): 24 courses, course '30' at position 1 reads 'F0'
|
||||||
|
# (available) on all three bitmaps; course '1C' at position 0 reads '00' on
|
||||||
|
# BubbleSoakSet (matching the app graying that control out for Eco 40-60).
|
||||||
|
_EDIT_COURSE_RESOURCES = {
|
||||||
|
'/wm/editcourse/vs/0': {
|
||||||
|
'x.com.samsung.da.editCourseList':
|
||||||
|
'EditCourseList_1C301E26361B1D1F253324322022232F212D272838393729',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
_BUBBLE_SOAK_SET = 'BubbleSoakSet_00F000F000F000F0F0F0F00000F000F0F00000F000000000'
|
||||||
|
_PRE_WASH_AVAILABLE_SET = 'PreWashAvailableSet_F0F000F0F0F000F0F0F0F00000F0F0F0F00000F000000000'
|
||||||
|
_INTENSIVE_AVAILABLE_SET = 'IntensiveAvailableSet_F0F000F0F0F000F0F0F0F00000F0F0F0F00000F000000000'
|
||||||
|
|
||||||
|
|
||||||
|
class TestWashOptionToggleValidation:
|
||||||
|
"""validate_fn rejects turning a toggle on for a course whose byte in
|
||||||
|
its availability bitmap isn't 'F0', with a user-facing message switch.py
|
||||||
|
raises as ServiceValidationError -- distinct from write_fn's silent
|
||||||
|
no-op for a malformed payload."""
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _desc(key):
|
||||||
|
return next(e for e in washer.WASHER_COURSE.entities if e.key == key)
|
||||||
|
|
||||||
|
def test_allowed_on_a_supported_course(self):
|
||||||
|
rep = {'x.com.samsung.da.options': ['Course_30', _BUBBLE_SOAK_SET]}
|
||||||
|
assert self._desc('bubble_soak').validate_fn(
|
||||||
|
'On', rep, _EDIT_COURSE_RESOURCES) is None
|
||||||
|
|
||||||
|
def test_rejected_on_an_unsupported_course(self):
|
||||||
|
rep = {'x.com.samsung.da.options': ['Course_1C', _BUBBLE_SOAK_SET]}
|
||||||
|
msg = self._desc('bubble_soak').validate_fn('On', rep, _EDIT_COURSE_RESOURCES)
|
||||||
|
assert msg == "Bubble soak isn't available on the selected cycle."
|
||||||
|
|
||||||
|
def test_pre_wash_and_intensive_use_their_own_availableset_field(self):
|
||||||
|
rep = {'x.com.samsung.da.options': ['Course_30', _PRE_WASH_AVAILABLE_SET]}
|
||||||
|
assert self._desc('pre_wash').validate_fn(
|
||||||
|
'On', rep, _EDIT_COURSE_RESOURCES) is None
|
||||||
|
rep = {'x.com.samsung.da.options': ['Course_30', _INTENSIVE_AVAILABLE_SET]}
|
||||||
|
assert self._desc('intensive').validate_fn(
|
||||||
|
'On', rep, _EDIT_COURSE_RESOURCES) is None
|
||||||
|
|
||||||
|
def test_turning_off_is_never_blocked(self):
|
||||||
|
rep = {'x.com.samsung.da.options': ['Course_1C', _BUBBLE_SOAK_SET]}
|
||||||
|
assert self._desc('bubble_soak').validate_fn(
|
||||||
|
'Off', rep, _EDIT_COURSE_RESOURCES) is None
|
||||||
|
|
||||||
|
def test_allows_write_when_course_unresolvable(self):
|
||||||
|
"""No editCourseList, no Course_ token, or a bitmap whose length
|
||||||
|
doesn't match editCourseList -- in every case, fail open rather than
|
||||||
|
block a write we can't actually verify."""
|
||||||
|
desc = self._desc('bubble_soak')
|
||||||
|
rep = {'x.com.samsung.da.options': ['Course_1C', _BUBBLE_SOAK_SET]}
|
||||||
|
assert desc.validate_fn('On', rep, {}) is None
|
||||||
|
|
||||||
|
rep = {'x.com.samsung.da.options': [_BUBBLE_SOAK_SET]}
|
||||||
|
assert desc.validate_fn('On', rep, _EDIT_COURSE_RESOURCES) is None
|
||||||
|
|
||||||
|
rep = {'x.com.samsung.da.options': ['Course_1C', 'BubbleSoakSet_00F0']}
|
||||||
|
assert desc.validate_fn('On', rep, _EDIT_COURSE_RESOURCES) is None
|
||||||
|
|
||||||
|
|
||||||
|
class TestAiEnergyLevel:
|
||||||
|
"""Issue #40 -- /energy/ailevel/vs/0 was unbound on a plain washer.
|
||||||
|
|
||||||
|
The capability itself (common.AI_ENERGY_LEVEL) is tested in
|
||||||
|
test_common_capabilities.py; this just confirms it's wired into the
|
||||||
|
washer registry and that the fixture's single-entry supportedAiLevel
|
||||||
|
(['1'], matching the issue's dump) surfaces as a switch, not a select."""
|
||||||
|
|
||||||
|
def test_fixture_has_complete_coverage(self):
|
||||||
|
from custom_components.localthings.registry.adapter import flatten
|
||||||
|
from custom_components.localthings.registry.by_type import washer as washer_registry
|
||||||
|
from custom_components.localthings.registry.discovery import discover
|
||||||
|
from tests.conftest import _load_device
|
||||||
|
|
||||||
|
resources = _load_device('washer')
|
||||||
|
unbound = []
|
||||||
|
bound = discover(
|
||||||
|
resources,
|
||||||
|
washer_registry.REGISTRY.capabilities,
|
||||||
|
washer_registry.REGISTRY.pattern_capabilities,
|
||||||
|
log=unbound.append,
|
||||||
|
)
|
||||||
|
assert unbound == []
|
||||||
|
state = flatten(bound, resources)
|
||||||
|
assert state['ai_energy_level'] is False # aiLevel '0' -- off
|
||||||
|
|
||||||
|
|
||||||
class TestFlexWashAndComboFixturesHaveCompleteCoverage:
|
class TestFlexWashAndComboFixturesHaveCompleteCoverage:
|
||||||
"""FlexWash (issue #19, previously unrecognized entirely) and
|
"""FlexWash (issue #19, previously unrecognized entirely) and
|
||||||
washer/dryer combo (issue #22, dry_level) dumps must both resolve to
|
washer/dryer combo (issue #22, dry_level) dumps must both resolve to
|
||||||
|
|||||||
Reference in new issue
Block a user