Issue #847 Relax test for unmatchable configs to allow configs with all optional dps but have product ids specified.
@@ -0,0 +1,16 @@
+name: IR remote
+products:
+ - id: mjffeakbzlnfxpzt
+ name: UanTii S06/S18
+primary_entity:
+ entity: remote
+ dps:
+ - id: 201
+ name: send
+ type: string
+ optional: true
+ - id: 202
+ name: receive
+ persist: false
@@ -534,6 +534,16 @@ class TestDeviceConfig(IsolatedAsyncioTestCase):
optional = set()
required = set()
parsed = TuyaDeviceConfig(cfg)
+ products = parsed._config.get("products")
+ # Configs with a product list can be matched by product id
+ if products:
+ p_match = False
+ for p in products:
+ if p.get("id"):
+ p_match = True
+ if p_match:
+ continue
+
for entity in parsed.all_entities():
for dp in entity.dps():
if dp.optional: