From 75a2447d9de53e77ff3480a41ac2d28d92f23878 Mon Sep 17 00:00:00 2001 From: GitHub Date: Sun, 5 Nov 2023 19:05:59 +0000 Subject: [PATCH] [devices-module] Properties - parent-child clearing (#156) --- src/API/ConnectionManager.php | 2 -- src/Clients/Cloud.php | 4 ---- src/Clients/Discovery.php | 1 - src/Commands/Initialize.php | 3 --- src/Connector/Connector.php | 1 - src/Entities/TuyaConnector.php | 8 -------- src/Entities/TuyaDevice.php | 11 ----------- src/Queue/Consumers/DeviceProperty.php | 6 ------ 8 files changed, 36 deletions(-) diff --git a/src/API/ConnectionManager.php b/src/API/ConnectionManager.php index 3d0a090..4fa66bf 100644 --- a/src/API/ConnectionManager.php +++ b/src/API/ConnectionManager.php @@ -108,7 +108,6 @@ public function getLocalConnection(Entities\TuyaDevice $device): LocalApi } /** - * @throws DevicesExceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState */ @@ -130,7 +129,6 @@ public function getCloudApiConnection(Entities\TuyaConnector $connector): OpenAp } /** - * @throws DevicesExceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState */ diff --git a/src/Clients/Cloud.php b/src/Clients/Cloud.php index 875882c..b22a3c1 100644 --- a/src/Clients/Cloud.php +++ b/src/Clients/Cloud.php @@ -87,7 +87,6 @@ public function __construct( } /** - * @throws DevicesExceptions\InvalidState * @throws Exceptions\OpenApiCall * @throws Exceptions\OpenApiError * @throws MetadataExceptions\InvalidArgument @@ -237,7 +236,6 @@ function (Entities\API\ReportDeviceState|Entities\API\ReportDeviceOnline $messag } /** - * @throws DevicesExceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState */ @@ -313,7 +311,6 @@ private function processDevice(Entities\TuyaDevice $device): bool } /** - * @throws DevicesExceptions\InvalidState * @throws Exceptions\OpenApiCall * @throws Exceptions\OpenApiError * @throws MetadataExceptions\InvalidArgument @@ -408,7 +405,6 @@ private function readDeviceInformation(Entities\TuyaDevice $device): bool } /** - * @throws DevicesExceptions\InvalidState * @throws Exceptions\OpenApiCall * @throws Exceptions\OpenApiError * @throws MetadataExceptions\InvalidArgument diff --git a/src/Clients/Discovery.php b/src/Clients/Discovery.php index 155d3b9..5fcd7a6 100644 --- a/src/Clients/Discovery.php +++ b/src/Clients/Discovery.php @@ -134,7 +134,6 @@ public function discover(): void } /** - * @throws DevicesExceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState */ diff --git a/src/Commands/Initialize.php b/src/Commands/Initialize.php index c89b185..857d16c 100644 --- a/src/Commands/Initialize.php +++ b/src/Commands/Initialize.php @@ -743,7 +743,6 @@ private function askName(Style\SymfonyStyle $io, Entities\TuyaConnector|null $co } /** - * @throws DevicesExceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState */ @@ -770,7 +769,6 @@ private function askAccessId(Style\SymfonyStyle $io, Entities\TuyaConnector|null } /** - * @throws DevicesExceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState */ @@ -888,7 +886,6 @@ private function askOpenApiEndpoint(Style\SymfonyStyle $io): Types\OpenApiEndpoi } /** - * @throws DevicesExceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState */ diff --git a/src/Connector/Connector.php b/src/Connector/Connector.php index 924c92e..0e34c8d 100644 --- a/src/Connector/Connector.php +++ b/src/Connector/Connector.php @@ -205,7 +205,6 @@ public function discover(): void } /** - * @throws DevicesExceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState */ diff --git a/src/Entities/TuyaConnector.php b/src/Entities/TuyaConnector.php index e78a50d..3a11bb7 100644 --- a/src/Entities/TuyaConnector.php +++ b/src/Entities/TuyaConnector.php @@ -21,7 +21,6 @@ use FastyBird\Library\Metadata\Exceptions as MetadataExceptions; use FastyBird\Library\Metadata\Types as MetadataTypes; use FastyBird\Module\Devices\Entities as DevicesEntities; -use FastyBird\Module\Devices\Exceptions as DevicesExceptions; use function is_string; /** @@ -48,7 +47,6 @@ public function getSource(): MetadataTypes\ConnectorSource } /** - * @throws DevicesExceptions\InvalidState * @throws Exceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState @@ -73,7 +71,6 @@ public function getClientMode(): Types\ClientMode } /** - * @throws DevicesExceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState */ @@ -98,7 +95,6 @@ public function getOpenApiEndpoint(): Types\OpenApiEndpoint } /** - * @throws DevicesExceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState */ @@ -139,7 +135,6 @@ public function getOpenPulsarEndpoint(): Types\OpenPulsarEndpoint } /** - * @throws DevicesExceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState */ @@ -164,7 +159,6 @@ public function getOpenPulsarTopic(): Types\OpenPulsarTopic } /** - * @throws DevicesExceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState */ @@ -188,7 +182,6 @@ public function getAccessId(): string|null } /** - * @throws DevicesExceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState */ @@ -212,7 +205,6 @@ public function getAccessSecret(): string|null } /** - * @throws DevicesExceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState */ diff --git a/src/Entities/TuyaDevice.php b/src/Entities/TuyaDevice.php index e3186cd..ed86484 100644 --- a/src/Entities/TuyaDevice.php +++ b/src/Entities/TuyaDevice.php @@ -21,7 +21,6 @@ use FastyBird\Library\Metadata\Exceptions as MetadataExceptions; use FastyBird\Library\Metadata\Types as MetadataTypes; use FastyBird\Module\Devices\Entities as DevicesEntities; -use FastyBird\Module\Devices\Exceptions as DevicesExceptions; use function assert; use function explode; use function floatval; @@ -57,7 +56,6 @@ public function getSource(): MetadataTypes\ConnectorSource } /** - * @throws DevicesExceptions\InvalidState * @throws Exceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState @@ -97,7 +95,6 @@ public function getGateway(): self|null } /** - * @throws DevicesExceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState */ @@ -121,7 +118,6 @@ public function getNodeId(): string|null } /** - * @throws DevicesExceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState */ @@ -145,7 +141,6 @@ public function getGatewayId(): string|null } /** - * @throws DevicesExceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState */ @@ -169,7 +164,6 @@ public function getIpAddress(): string|null } /** - * @throws DevicesExceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState */ @@ -193,7 +187,6 @@ public function getLocalKey(): string|null } /** - * @throws DevicesExceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState */ @@ -219,7 +212,6 @@ public function isEncrypted(): bool /** * @return array * - * @throws DevicesExceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState */ @@ -243,7 +235,6 @@ public function getExcludedDps(): array } /** - * @throws DevicesExceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState */ @@ -267,7 +258,6 @@ public function getModel(): string|null } /** - * @throws DevicesExceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState */ @@ -291,7 +281,6 @@ public function getMacAddress(): string|null } /** - * @throws DevicesExceptions\InvalidState * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState */ diff --git a/src/Queue/Consumers/DeviceProperty.php b/src/Queue/Consumers/DeviceProperty.php index 93b2386..3ccad56 100644 --- a/src/Queue/Consumers/DeviceProperty.php +++ b/src/Queue/Consumers/DeviceProperty.php @@ -62,8 +62,6 @@ private function setDeviceProperty( string $identifier, string|null $name = null, array|string|null $format = null, - bool $settable = false, - bool $queryable = false, ): void { $findDevicePropertyQuery = new DevicesQueries\FindDeviceProperties(); @@ -147,8 +145,6 @@ function () use ($property): void { 'identifier' => $identifier, 'name' => $name, 'dataType' => $dataType, - 'settable' => $settable, - 'queryable' => $queryable, 'value' => $value, 'format' => $format, ]), @@ -176,8 +172,6 @@ function () use ($property): void { $property, Utils\ArrayHash::from([ 'dataType' => $dataType, - 'settable' => $settable, - 'queryable' => $queryable, 'value' => $value, 'format' => $format, ]),