Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
498da49817 | ||
|
|
bbf3f3f833 | ||
|
|
91b129282b | ||
|
|
34fe991858 | ||
|
|
6d185e4e3d | ||
|
|
5f47fc0477 | ||
|
|
cfa82e8853 | ||
|
|
739881de16 | ||
|
|
6080d37f7d |
No files matched your search
@@ -0,0 +1,66 @@
|
|||||||
|
{
|
||||||
|
"entity": {
|
||||||
|
"climate": {
|
||||||
|
"airconditioner": {
|
||||||
|
"state_attributes": {
|
||||||
|
"fan_mode": {
|
||||||
|
"state": {
|
||||||
|
"1": "mdi:fan-speed-1",
|
||||||
|
"2": "mdi:fan-speed-1",
|
||||||
|
"3": "mdi:fan-speed-2",
|
||||||
|
"4": "mdi:fan-speed-3",
|
||||||
|
"5": "mdi:fan-speed-3",
|
||||||
|
"turbo": "mdi:fan-speed-3",
|
||||||
|
"max": "mdi:fan-speed-3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"preset_mode": {
|
||||||
|
"state": {
|
||||||
|
"ai_comfort": "mdi:creation",
|
||||||
|
"quiet": "mdi:volume-off",
|
||||||
|
"smart": "mdi:brain",
|
||||||
|
"speed": "mdi:speedometer",
|
||||||
|
"nano": "mdi:weather-dust",
|
||||||
|
"nanosleep": "mdi:sleep",
|
||||||
|
"longwind": "mdi:weather-windy",
|
||||||
|
"motiondirect": "mdi:account-arrow-left",
|
||||||
|
"motionindirect": "mdi:account-arrow-right",
|
||||||
|
"drycomfort": "mdi:water-percent",
|
||||||
|
"2step": "mdi:stairs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fan": {
|
||||||
|
"air_purifier_fan": {
|
||||||
|
"state_attributes": {
|
||||||
|
"preset_mode": {
|
||||||
|
"state": {
|
||||||
|
"smart": "mdi:brain",
|
||||||
|
"max": "mdi:fan-speed-3",
|
||||||
|
"mid": "mdi:fan-speed-2",
|
||||||
|
"windfree": "mdi:weather-dust",
|
||||||
|
"sleep": "mdi:sleep"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sensor": {
|
||||||
|
"machine_state": {
|
||||||
|
"state": {
|
||||||
|
"idle": "mdi:power-standby",
|
||||||
|
"active": "mdi:play",
|
||||||
|
"pause": "mdi:pause"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"connection_mode": {
|
||||||
|
"state": {
|
||||||
|
"observe": "mdi:broadcast",
|
||||||
|
"poll": "mdi:sync"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,5 +12,5 @@
|
|||||||
"pyOpenSSL>=23.0",
|
"pyOpenSSL>=23.0",
|
||||||
"smartthings-local>=0.1.1"
|
"smartthings-local>=0.1.1"
|
||||||
],
|
],
|
||||||
"version": "0.14.0"
|
"version": "0.15.0"
|
||||||
}
|
}
|
||||||
@@ -128,6 +128,24 @@ def _sensor_item_value(items, type_):
|
|||||||
|
|
||||||
|
|
||||||
def _has_sensor_type(type_):
|
def _has_sensor_type(type_):
|
||||||
|
"""True when the /sensors/vs/0 items[] array lists an item of this type.
|
||||||
|
|
||||||
|
This proves the type is *listed*, not that the reading is real: issue
|
||||||
|
#166 (ARxxTXFCAWKNEU, board ARTIK051_PRAC_20K) lists all five item types
|
||||||
|
with permanent zero values on both its units, and the reporter confirmed
|
||||||
|
none of these sensors are physically present. A top-level
|
||||||
|
x.com.samsung.da.cleanLevel scalar (separate from the CleanLevel item)
|
||||||
|
looked like a corroborating "this reading is real" signal at first --
|
||||||
|
present alongside genuinely populated readings on tp1x_da_ac_rac_01011
|
||||||
|
and the tp1x_da_ac_air air purifier fixture, absent on every all-zero
|
||||||
|
ARTIK051_PRAC_20K dump including both #166 units -- but it doesn't hold
|
||||||
|
up as a general rule: air_purifier_device.json (ARTIK051_TVTL_18K),
|
||||||
|
air_purifier_vtww_device.json, and range_hood_device.json all carry
|
||||||
|
genuinely populated, non-AC-family Dust/FineDust/SuperFineDust readings
|
||||||
|
with no such scalar. So this stays item-type presence only -- the
|
||||||
|
entities are disabled by default instead (see AIR_QUALITY below) rather
|
||||||
|
than existence-gated on a signal that would silently drop real readings
|
||||||
|
on hardware this repo hasn't seen yet."""
|
||||||
def fn(rep, resources):
|
def fn(rep, resources):
|
||||||
return any(isinstance(i, dict) and i.get('x.com.samsung.da.type') == type_
|
return any(isinstance(i, dict) and i.get('x.com.samsung.da.type') == type_
|
||||||
for i in (rep.get('x.com.samsung.da.items') or []))
|
for i in (rep.get('x.com.samsung.da.items') or []))
|
||||||
@@ -441,12 +459,26 @@ CLIMATE = Capability(
|
|||||||
# Single-token option_write. Cloud: custom.airConditionerTropicalNightMode.
|
# Single-token option_write. Cloud: custom.airConditionerTropicalNightMode.
|
||||||
# Gated off the legacy board for the same reason as beep above -- its
|
# Gated off the legacy board for the same reason as beep above -- its
|
||||||
# Sleep_ token is already the good_sleep Number below.
|
# Sleep_ token is already the good_sleep Number below.
|
||||||
|
#
|
||||||
|
# exists_fn only proves the Sleep_ token slot is present, not that
|
||||||
|
# tropical night mode is a real feature of the unit: issue #166
|
||||||
|
# (ARxxTXFCAWKNEU) reports Sleep_0 in every dump -- the exact same
|
||||||
|
# always-there-at-zero shape as the issue #17 dump #164 was verified
|
||||||
|
# against -- yet the reporter confirmed their remote/app has no
|
||||||
|
# tropical night mode control at all. Samsung's OCF options[] blob
|
||||||
|
# carries this scaffolding token regardless of physical capability,
|
||||||
|
# so there's no reliable signal here to gate on (same 'don't guess'
|
||||||
|
# rule as elsewhere in this file, just with no signal to guess from).
|
||||||
|
# Registered but disabled by default, same precedent as
|
||||||
|
# fridge.rack_count / cooktop.paired_hood_* -- units that do have the
|
||||||
|
# feature can enable it themselves.
|
||||||
NumberDesc(key='tropical_night_mode', rep_fn=_tropical_night_value,
|
NumberDesc(key='tropical_night_mode', rep_fn=_tropical_night_value,
|
||||||
exists_fn=lambda rep, resources: (
|
exists_fn=lambda rep, resources: (
|
||||||
not is_legacy_board(resources)
|
not is_legacy_board(resources)
|
||||||
and _option_token(rep, 'Sleep') is not None),
|
and _option_token(rep, 'Sleep') is not None),
|
||||||
write_fn=_tropical_night_write,
|
write_fn=_tropical_night_write,
|
||||||
native_min=0, native_max=16, step=1,
|
native_min=0, native_max=16, step=1,
|
||||||
|
enabled_default=False,
|
||||||
icon='mdi:weather-night', entity_category='config'),
|
icon='mdi:weather-night', entity_category='config'),
|
||||||
# Settings that this board generation keeps as options[] tokens.
|
# Settings that this board generation keeps as options[] tokens.
|
||||||
SwitchDesc(key='spi', rep_fn=_option_token_on('Spi'),
|
SwitchDesc(key='spi', rep_fn=_option_token_on('Spi'),
|
||||||
@@ -702,6 +734,19 @@ HUMIDITY = Capability(
|
|||||||
# are 1- or 2-element arrays with no corroborating scalar, so they stay string
|
# are 1- or 2-element arrays with no corroborating scalar, so they stay string
|
||||||
# diagnostics (see _sensor_item_value for the 2-element ambiguity and why only
|
# diagnostics (see _sensor_item_value for the 2-element ambiguity and why only
|
||||||
# v[0] is taken). No unit is advertised on the resource, so no device_class.
|
# v[0] is taken). No unit is advertised on the resource, so no device_class.
|
||||||
|
#
|
||||||
|
# exists_fn (_has_sensor_type) only proves the item *type* is listed, not
|
||||||
|
# that the unit actually carries that sensor: issue #166 (ARxxTXFCAWKNEU,
|
||||||
|
# board ARTIK051_PRAC_20K) reports all five item types on both its units,
|
||||||
|
# values permanently '0'/['0','0'] -- yet the reporter confirmed none apply
|
||||||
|
# to their model. A tighter existence gate was tried (requiring the
|
||||||
|
# corroborating cleanLevel scalar above) but doesn't hold up as a general
|
||||||
|
# rule -- see _has_sensor_type's docstring -- and risks silently dropping
|
||||||
|
# real readings on hardware that reports them without that scalar. So these
|
||||||
|
# stay bound whenever the type is listed, same as before #166, and disabled
|
||||||
|
# by default instead (same precedent as fridge.rack_count /
|
||||||
|
# cooktop.paired_hood_model / this file's own tropical_night_mode): units
|
||||||
|
# that do have the sensor can enable it themselves.
|
||||||
AIR_QUALITY = Capability(
|
AIR_QUALITY = Capability(
|
||||||
href='/sensors/vs/0',
|
href='/sensors/vs/0',
|
||||||
poll_tier='cold',
|
poll_tier='cold',
|
||||||
@@ -710,11 +755,13 @@ AIR_QUALITY = Capability(
|
|||||||
icon='mdi:broom', entity_category='diagnostic',
|
icon='mdi:broom', entity_category='diagnostic',
|
||||||
state_class='measurement',
|
state_class='measurement',
|
||||||
exists_fn=_has_sensor_type('CleanLevel'),
|
exists_fn=_has_sensor_type('CleanLevel'),
|
||||||
|
enabled_default=False,
|
||||||
value_fn=lambda items: _int(_sensor_item_value(items, 'CleanLevel'))),
|
value_fn=lambda items: _int(_sensor_item_value(items, 'CleanLevel'))),
|
||||||
*tuple(
|
*tuple(
|
||||||
SensorDesc(key=key, field='x.com.samsung.da.items',
|
SensorDesc(key=key, field='x.com.samsung.da.items',
|
||||||
icon=icon, entity_category='diagnostic',
|
icon=icon, entity_category='diagnostic',
|
||||||
exists_fn=_has_sensor_type(type_),
|
exists_fn=_has_sensor_type(type_),
|
||||||
|
enabled_default=False,
|
||||||
value_fn=lambda items, t=type_: _sensor_item_value(items, t))
|
value_fn=lambda items, t=type_: _sensor_item_value(items, t))
|
||||||
for key, icon, type_ in (
|
for key, icon, type_ in (
|
||||||
('odor', 'mdi:weather-windy', 'Odor'),
|
('odor', 'mdi:weather-windy', 'Odor'),
|
||||||
|
|||||||
@@ -564,6 +564,19 @@ def test_tropical_night_write_is_single_token_options_merge():
|
|||||||
['mode', 'vs', '0'], {'x.com.samsung.da.options': ['Sleep_6']})
|
['mode', 'vs', '0'], {'x.com.samsung.da.options': ['Sleep_6']})
|
||||||
|
|
||||||
|
|
||||||
|
def test_tropical_night_disabled_by_default():
|
||||||
|
"""Issue #166: Sleep_0 is present in /mode/vs/0's options on every dump
|
||||||
|
seen, including the original issue #17 dump this capability was verified
|
||||||
|
against (see airconditioner_device.json / _ac()) -- yet the #166 reporter
|
||||||
|
confirmed their unit (also an ARTIK051_PRAC_20K board, per its own
|
||||||
|
/information/vs/0) has no tropical night mode feature at all. The token
|
||||||
|
slot's presence proves nothing about the physical feature, so this can't
|
||||||
|
be existence-gated any tighter than it already is -- registered but
|
||||||
|
disabled by default instead, same precedent as fridge.rack_count /
|
||||||
|
cooktop.paired_hood_model."""
|
||||||
|
assert _tropical_desc().enabled_default is False
|
||||||
|
|
||||||
|
|
||||||
def test_tropical_night_absent_when_no_sleep_token():
|
def test_tropical_night_absent_when_no_sleep_token():
|
||||||
"""TP1X_DA-AC-WAC (window AC) carries no Sleep_ option -- tropical night
|
"""TP1X_DA-AC-WAC (window AC) carries no Sleep_ option -- tropical night
|
||||||
mode must not bind."""
|
mode must not bind."""
|
||||||
@@ -676,6 +689,29 @@ def test_air_quality_sensors_from_sensors_vs_items():
|
|||||||
assert state2['clean_level'] == 1
|
assert state2['clean_level'] == 1
|
||||||
|
|
||||||
|
|
||||||
|
def test_air_quality_disabled_by_default():
|
||||||
|
"""Issue #166 (ARxxTXFCAWKNEU, board ARTIK051_PRAC_20K): /sensors/vs/0
|
||||||
|
lists all five item types with permanent zero values on both its units --
|
||||||
|
the exact same shape as the WindFree/issue #17 dumps this capability was
|
||||||
|
first verified against -- yet the reporter confirmed none of these
|
||||||
|
sensors are physically present on their model.
|
||||||
|
|
||||||
|
A tighter exists_fn (requiring a corroborating top-level
|
||||||
|
x.com.samsung.da.cleanLevel scalar) was tried and reverted: it looked
|
||||||
|
like a real signal against this repo's AC fixtures, but
|
||||||
|
air_purifier_device.json, air_purifier_vtww_device.json, and
|
||||||
|
range_hood_device.json all carry genuinely populated Dust/FineDust/
|
||||||
|
SuperFineDust readings with no such scalar, so requiring it would
|
||||||
|
silently drop real readings on hardware this repo hasn't seen yet on an
|
||||||
|
AC. These stay bound whenever the item type is listed (see
|
||||||
|
_has_sensor_type) and disabled by default instead, same precedent as
|
||||||
|
fridge.rack_count / cooktop.paired_hood_model / tropical_night_mode --
|
||||||
|
units that do have the sensor can enable it themselves."""
|
||||||
|
for key in ('clean_level', 'odor', 'dust', 'fine_dust', 'super_fine_dust'):
|
||||||
|
desc = next(e for e in airconditioner.AIR_QUALITY.entities if e.key == key)
|
||||||
|
assert desc.enabled_default is False, key
|
||||||
|
|
||||||
|
|
||||||
def test_air_quality_absent_when_no_sensor_items():
|
def test_air_quality_absent_when_no_sensor_items():
|
||||||
"""A board whose /sensors/vs/0 carries an empty items[] (the cool-only
|
"""A board whose /sensors/vs/0 carries an empty items[] (the cool-only
|
||||||
RAC variant) binds no air-quality entities -- exists_fn gates each on its
|
RAC variant) binds no air-quality entities -- exists_fn gates each on its
|
||||||
|
|||||||
Reference in new issue
Block a user