Skip to content

Commit

Permalink
Creating redis db devices states manager (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Oct 20, 2022
1 parent c1f1c4a commit aab2fd9
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/Connectors/Connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Connector.php
*
* @license More in license.md
* @license More in LICENSE.md
* @copyright https://www.fastybird.com
* @author Adam Kadlec <adam.kadlec@fastybird.com>
* @package FastyBird:DevicesModule!
Expand Down
2 changes: 1 addition & 1 deletion src/Connectors/ConnectorFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* ConnectorFactory.php
*
* @license More in license.md
* @license More in LICENSE.md
* @copyright https://www.fastybird.com
* @author Adam Kadlec <adam.kadlec@fastybird.com>
* @package FastyBird:DevicesModule!
Expand Down
2 changes: 1 addition & 1 deletion src/Consumers/Connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Connector.php
*
* @license More in license.md
* @license More in LICENSE.md
* @copyright https://www.fastybird.com
* @author Adam Kadlec <adam.kadlec@fastybird.com>
* @package FastyBird:DevicesModule!
Expand Down
6 changes: 0 additions & 6 deletions src/DI/DevicesExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,6 @@ public function afterCompile(PhpGenerator\ClassType $class): void
{
$builder = $this->getContainerBuilder();

$initialize = $class->getMethods()['initialize'];

$entityFactoryServiceName = $builder->getByType(DoctrineCrud\Crud\IEntityCrudFactory::class, true);

$devicesManagerService = $class->getMethod('createService' . ucfirst($this->name) . '__models__devicesManager');
Expand Down Expand Up @@ -706,10 +704,6 @@ public function afterCompile(PhpGenerator\ClassType $class): void
'return new ' . Models\Connectors\Controls\ControlsManager::class
. '($this->getService(\'' . $entityFactoryServiceName . '\')->create(\'' . Entities\Connectors\Controls\Control::class . '\'));',
);

$dataStorageReaderServiceName = $builder->getByType(DataStorage\Reader::class, true);

$initialize->addBody('$this->getService(\'' . $dataStorageReaderServiceName . '\')->read();');
}

}
2 changes: 1 addition & 1 deletion src/Events/AfterConnectorStart.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* AfterConnectorStart.php
*
* @license More in license.md
* @license More in LICENSE.md
* @copyright https://www.fastybird.com
* @author Adam Kadlec <adam.kadlec@fastybird.com>
* @package FastyBird:DevicesModule!
Expand Down
2 changes: 1 addition & 1 deletion src/Events/AfterConnectorTerminate.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* AfterConnectorTerminate.php
*
* @license More in license.md
* @license More in LICENSE.md
* @copyright https://www.fastybird.com
* @author Adam Kadlec <adam.kadlec@fastybird.com>
* @package FastyBird:DevicesModule!
Expand Down
2 changes: 1 addition & 1 deletion src/Events/BeforeConnectorStart.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* BeforeConnectorStart.php
*
* @license More in license.md
* @license More in LICENSE.md
* @copyright https://www.fastybird.com
* @author Adam Kadlec <adam.kadlec@fastybird.com>
* @package FastyBird:DevicesModule!
Expand Down
2 changes: 1 addition & 1 deletion src/Events/BeforeConnectorTerminate.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* BeforeConnectorTerminate.php
*
* @license More in license.md
* @license More in LICENSE.md
* @copyright https://www.fastybird.com
* @author Adam Kadlec <adam.kadlec@fastybird.com>
* @package FastyBird:DevicesModule!
Expand Down
2 changes: 1 addition & 1 deletion src/Events/DataStorageRead.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* DataStorageRead.php
*
* @license More in license.md
* @license More in LICENSE.md
* @copyright https://www.fastybird.com
* @author Adam Kadlec <adam.kadlec@fastybird.com>
* @package FastyBird:DevicesModule!
Expand Down
2 changes: 1 addition & 1 deletion src/Events/DataStorageWritten.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* DataStorageWritten.php
*
* @license More in license.md
* @license More in LICENSE.md
* @copyright https://www.fastybird.com
* @author Adam Kadlec <adam.kadlec@fastybird.com>
* @package FastyBird:DevicesModule!
Expand Down
2 changes: 1 addition & 1 deletion src/Events/StateEntityCreated.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* StateEntityCreated.php
*
* @license More in license.md
* @license More in LICENSE.md
* @copyright https://www.fastybird.com
* @author Adam Kadlec <adam.kadlec@fastybird.com>
* @package FastyBird:DevicesModule!
Expand Down
2 changes: 1 addition & 1 deletion src/Events/StateEntityDeleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* StateEntityDeleted.php
*
* @license More in license.md
* @license More in LICENSE.md
* @copyright https://www.fastybird.com
* @author Adam Kadlec <adam.kadlec@fastybird.com>
* @package FastyBird:DevicesModule!
Expand Down
2 changes: 1 addition & 1 deletion src/Events/StateEntityUpdated.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* StateEntityUpdated.php
*
* @license More in license.md
* @license More in LICENSE.md
* @copyright https://www.fastybird.com
* @author Adam Kadlec <adam.kadlec@fastybird.com>
* @package FastyBird:DevicesModule!
Expand Down
2 changes: 1 addition & 1 deletion src/Models/States/ChannelPropertyStateManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* ChannelPropertyStateManager.php
*
* @license More in license.md
* @license More in LICENSE.md
* @copyright https://www.fastybird.com
* @author Adam Kadlec <adam.kadlec@fastybird.com>
* @package FastyBird:DevicesModule!
Expand Down
2 changes: 1 addition & 1 deletion src/Models/States/DevicePropertyStateManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* DevicePropertyStateManager.php
*
* @license More in license.md
* @license More in LICENSE.md
* @copyright https://www.fastybird.com
* @author Adam Kadlec <adam.kadlec@fastybird.com>
* @package FastyBird:DevicesModule!
Expand Down
6 changes: 6 additions & 0 deletions tests/cases/unit/DataStorage/WriterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ public function testWriteConfiguration(): void
return true;
}),
);
$filesystem
->method('read')
->with(Devices\Constants::CONFIGURATION_FILE_FILENAME)
->willReturn(
Nette\Utils\FileSystem::read(__DIR__ . '/../../../fixtures/DataStorage/devices-module-data.json'),
);

$this->mockContainerService(Flysystem\Filesystem::class, $filesystem);

Expand Down

0 comments on commit aab2fd9

Please sign in to comment.