From 8e1de0c63c1c423a771f6d15fca0c4c76cde61a4 Mon Sep 17 00:00:00 2001 From: bumaas Date: Tue, 20 Oct 2026 21:28:19 +0200 Subject: [PATCH] Raise SymconStubs to 31f2e04 and adapt the tests The stricter stubs reject what the kernel rejects as well: - The SSE Client now registers Active, URL and Headers itself (symcon/SymconStubs#80), registering them again via reflection fails. - ConnectParent() already connects configurator and devices, so the tests take the existing connection instead of calling IPS_ConnectInstance() again. Green with symcon/SymconStubs#80; against 31f2e04 alone the SSE data flow, the string association list and SetBuffer() with an integer still fail. --- tests/HomeConnectCloudTest.php | 4 ---- tests/HomeConnectConfiguratorTest.php | 6 +++++- tests/HomeConnectDryerTest.php | 6 ++---- tests/HomeConnectWasherDryerTest.php | 5 ++--- tests/stubs | 2 +- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/tests/HomeConnectCloudTest.php b/tests/HomeConnectCloudTest.php index ab68334..b8f174f 100644 --- a/tests/HomeConnectCloudTest.php +++ b/tests/HomeConnectCloudTest.php @@ -561,10 +561,6 @@ private function cloud() private function prepareParentIo(int $cloudID): int { $parent = IPS_GetInstance($cloudID)['ConnectionID']; - $module = IPS\InstanceManager::getInstanceInterface($parent); - $this->invoke($module, 'RegisterPropertyBoolean', 'Active', false); - $this->invoke($module, 'RegisterPropertyString', 'URL', ''); - $this->invoke($module, 'RegisterPropertyString', 'Headers', ''); return $parent; } diff --git a/tests/HomeConnectConfiguratorTest.php b/tests/HomeConnectConfiguratorTest.php index 75e0ac0..31de999 100644 --- a/tests/HomeConnectConfiguratorTest.php +++ b/tests/HomeConnectConfiguratorTest.php @@ -99,7 +99,11 @@ public function testDiscoveryMatchesOnlyOwnInstances() private function createDevice(int $cloudID, string $haID): int { $device = IPS_CreateInstance(self::DEVICE_GUID); - IPS\InstanceManager::connectInstance($device, $cloudID); + //ConnectParent() already connected the device to the first cloud + if (IPS_GetInstance($device)['ConnectionID'] !== $cloudID) { + IPS_DisconnectInstance($device); + IPS_ConnectInstance($device, $cloudID); + } //Parent not active: the device does not try to reach the (stubbed) cloud. IPS\InstanceManager::setStatus($cloudID, IS_INACTIVE); IPS_SetProperty($device, 'HaID', $haID); diff --git a/tests/HomeConnectDryerTest.php b/tests/HomeConnectDryerTest.php index b4fcded..a16c136 100644 --- a/tests/HomeConnectDryerTest.php +++ b/tests/HomeConnectDryerTest.php @@ -57,8 +57,8 @@ protected function setUp(): void //Register our library we need for testing IPS\ModuleLoader::loadLibrary(__DIR__ . '/../library.json'); $this->ConfiguratorID = IPS_CreateInstance('{CA0E667D-8F28-8DF1-2750-5CF587ECA85A}'); - $this->CloudID = IPS_CreateInstance('{CE76810D-B685-9BE0-CC04-38B204DEAD5E}'); - IPS_ConnectInstance($this->ConfiguratorID, $this->CloudID); + //ConnectParent() of the configurator already created and connected the cloud + $this->CloudID = IPS_GetInstance($this->ConfiguratorID)['ConnectionID']; IPS\InstanceManager::setStatus($this->ConfiguratorID, 102); IPS\InstanceManager::setStatus($this->CloudID, 102); @@ -70,10 +70,8 @@ public function testBaseFunctionality() $cloudInterface = IPS\InstanceManager::getInstanceInterface($this->CloudID); $cloudInterface->selectedProgram = 'Cotton'; $dryer = IPS_CreateInstance('{F29DF312-A62E-9989-1F1A-0D1E1D171AD3}'); - IPS_ConnectInstance($dryer, $this->ConfiguratorID); $this->assertTrue(true); $dryer = IPS_CreateInstance('{F29DF312-A62E-9989-1F1A-0D1E1D171AD3}'); - IPS_ConnectInstance($dryer, $this->ConfiguratorID); IPS_SetProperty($dryer, 'HaID', 'BOSCH-WTX87E90-68A40E44C6B9'); IPS_SetProperty($dryer, 'DeviceType', 'Dryer'); IPS_ApplyChanges($dryer); diff --git a/tests/HomeConnectWasherDryerTest.php b/tests/HomeConnectWasherDryerTest.php index 8f5b3f1..87a9817 100644 --- a/tests/HomeConnectWasherDryerTest.php +++ b/tests/HomeConnectWasherDryerTest.php @@ -36,8 +36,8 @@ protected function setUp(): void //Register our library we need for testing IPS\ModuleLoader::loadLibrary(__DIR__ . '/../library.json'); $this->ConfiguratorID = IPS_CreateInstance('{CA0E667D-8F28-8DF1-2750-5CF587ECA85A}'); - $this->CloudID = IPS_CreateInstance('{CE76810D-B685-9BE0-CC04-38B204DEAD5E}'); - IPS_ConnectInstance($this->ConfiguratorID, $this->CloudID); + //ConnectParent() of the configurator already created and connected the cloud + $this->CloudID = IPS_GetInstance($this->ConfiguratorID)['ConnectionID']; IPS\InstanceManager::setStatus($this->ConfiguratorID, 102); IPS\InstanceManager::setStatus($this->CloudID, 102); @@ -116,7 +116,6 @@ public function testReadableNameKeepsDigitGroupsTogether() private function createWasherDryer() { $washerDryer = IPS_CreateInstance('{F29DF312-A62E-9989-1F1A-0D1E1D171AD3}'); - IPS_ConnectInstance($washerDryer, $this->ConfiguratorID); IPS_SetProperty($washerDryer, 'HaID', self::HA_ID); IPS_SetProperty($washerDryer, 'DeviceType', 'WasherDryer'); IPS_ApplyChanges($washerDryer); diff --git a/tests/stubs b/tests/stubs index f5a5562..31f2e04 160000 --- a/tests/stubs +++ b/tests/stubs @@ -1 +1 @@ -Subproject commit f5a55625da66d7ac152a6400ad978bae664cc2be +Subproject commit 31f2e0478eb3763236fcf44ea4144271fdeddfd5