refactor: key capabilities on href instead of rt
OCF rt is a schema category shared by many unrelated resources. The stable unique resource address is the href. Update Capability, discovery, common capabilities, tests, and plan accordingly.
This commit is contained in:
1 parent
bdae3cc82d
commit
0499c702d7
6 files changed
+62
-66
No files matched your search
@@ -3,7 +3,7 @@ from samsung_appliance.registry.entities import BinarySensorDesc
|
||||
|
||||
|
||||
def test_capability_defaults():
|
||||
c = Capability(rt='x.com.samsung.da.kidsLock',
|
||||
c = Capability(href='/kidslock/vs/0',
|
||||
entities=(BinarySensorDesc(key='child_lock', field='x.com.samsung.da.kidsLock'),))
|
||||
assert c.poll_tier == 'warm'
|
||||
assert c.observe is True
|
||||
@@ -12,9 +12,9 @@ def test_capability_defaults():
|
||||
|
||||
|
||||
def test_capability_is_frozen():
|
||||
c = Capability(rt='x', entities=())
|
||||
c = Capability(href='/kidslock/vs/0', entities=())
|
||||
try:
|
||||
c.rt = 'y'
|
||||
c.href = '/other/vs/0'
|
||||
except Exception:
|
||||
return
|
||||
raise AssertionError("expected frozen dataclass")
|
||||
Reference in new issue
Block a user