Skip to content

Commit

Permalink
Updating dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
akadlec committed Aug 23, 2022
1 parent e98e91e commit 0ad7dc0
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
"ext-pcntl": "*",
"contributte/flysystem": "^0.3.0",
"cweagans/composer-patches": "^1.7",
"fastybird/exchange" : "^0.57",
"fastybird/exchange" : "^0.59",
"fastybird/json-api" : "^0.11",
"fastybird/metadata" : "^0.74",
"fastybird/metadata" : "^0.76",
"fastybird/simple-auth" : "^0.4",
"ipub/doctrine-dynamic-discriminator-map": "^1.4",
"ipub/doctrine-timestampable": "^1.5",
Expand Down
2 changes: 1 addition & 1 deletion fastybird_devices_module/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
Devices module
"""

__version__ = "0.74.0"
__version__ = "0.75.0"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fastybird/devices-module",
"version": "0.73.0",
"version": "0.75.0",
"description": "Devices module data model plugin",
"keywords": [
"devices",
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
fastnumbers>=3.2
fastybird-exchange>=0.57
fastybird-metadata>=0.74
fastybird-exchange>=0.59
fastybird-metadata>=0.76
inflection>=0.5
kink>=0.6
setuptools>=57.4
Expand Down
16 changes: 8 additions & 8 deletions src/Entities/Devices/Attributes/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function setName(?string $name): void
*/
public function getContent(bool $plain = false): string|MetadataTypes\HardwareManufacturerType|MetadataTypes\FirmwareManufacturerType|MetadataTypes\DeviceModelType|null
{
if ($this->getIdentifier() === MetadataTypes\DeviceAttributeNameType::ATTRIBUTE_HARDWARE_MANUFACTURER) {
if ($this->getIdentifier() === MetadataTypes\DeviceAttributeIdentifierType::IDENTIFIER_HARDWARE_MANUFACTURER) {
if ($this->content !== null && MetadataTypes\HardwareManufacturerType::isValidValue($this->content)) {
return MetadataTypes\HardwareManufacturerType::get($this->content);
}
Expand All @@ -167,7 +167,7 @@ public function getContent(bool $plain = false): string|MetadataTypes\HardwareMa
return MetadataTypes\HardwareManufacturerType::get(MetadataTypes\HardwareManufacturerType::MANUFACTURER_GENERIC);
}

if ($this->getIdentifier() === MetadataTypes\DeviceAttributeNameType::ATTRIBUTE_HARDWARE_MODEL) {
if ($this->getIdentifier() === MetadataTypes\DeviceAttributeIdentifierType::IDENTIFIER_HARDWARE_MODEL) {
if ($this->content !== null && MetadataTypes\DeviceModelType::isValidValue($this->content)) {
return MetadataTypes\DeviceModelType::get($this->content);
}
Expand All @@ -179,7 +179,7 @@ public function getContent(bool $plain = false): string|MetadataTypes\HardwareMa
return MetadataTypes\DeviceModelType::get(MetadataTypes\DeviceModelType::MODEL_CUSTOM);
}

if ($this->getIdentifier() === MetadataTypes\DeviceAttributeNameType::ATTRIBUTE_HARDWARE_MAC_ADDRESS) {
if ($this->getIdentifier() === MetadataTypes\DeviceAttributeIdentifierType::IDENTIFIER_HARDWARE_MAC_ADDRESS) {
if (
$this->content !== null
&& (
Expand All @@ -193,7 +193,7 @@ public function getContent(bool $plain = false): string|MetadataTypes\HardwareMa
return null;
}

if ($this->getIdentifier() === MetadataTypes\DeviceAttributeNameType::ATTRIBUTE_FIRMWARE_MANUFACTURER) {
if ($this->getIdentifier() === MetadataTypes\DeviceAttributeIdentifierType::IDENTIFIER_FIRMWARE_MANUFACTURER) {
if ($this->content !== null && MetadataTypes\FirmwareManufacturerType::isValidValue($this->content)) {
return MetadataTypes\FirmwareManufacturerType::get($this->content);
}
Expand All @@ -214,19 +214,19 @@ public function getContent(bool $plain = false): string|MetadataTypes\HardwareMa
public function setContent(
string|MetadataTypes\HardwareManufacturerType|MetadataTypes\FirmwareManufacturerType|MetadataTypes\DeviceModelType|null $content
): void {
if ($this->getIdentifier() === MetadataTypes\DeviceAttributeNameType::ATTRIBUTE_HARDWARE_MANUFACTURER) {
if ($this->getIdentifier() === MetadataTypes\DeviceAttributeIdentifierType::IDENTIFIER_HARDWARE_MANUFACTURER) {
if ($content instanceof MetadataTypes\HardwareManufacturerType) {
$this->content = strval($content->getValue());
} else {
$this->content = $content !== null ? Utils\Strings::lower((string) $content) : null;
}
} elseif ($this->getIdentifier() === MetadataTypes\DeviceAttributeNameType::ATTRIBUTE_HARDWARE_MODEL) {
} elseif ($this->getIdentifier() === MetadataTypes\DeviceAttributeIdentifierType::IDENTIFIER_HARDWARE_MODEL) {
if ($content instanceof MetadataTypes\DeviceModelType) {
$this->content = strval($content->getValue());
} else {
$this->content = $content !== null ? Utils\Strings::lower((string) $content) : null;
}
} elseif ($this->getIdentifier() === MetadataTypes\DeviceAttributeNameType::ATTRIBUTE_HARDWARE_MAC_ADDRESS) {
} elseif ($this->getIdentifier() === MetadataTypes\DeviceAttributeIdentifierType::IDENTIFIER_HARDWARE_MAC_ADDRESS) {
if (
$content !== null
&& preg_match('/^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/', (string) $content) === 0
Expand All @@ -239,7 +239,7 @@ public function setContent(
':',
'-',
], '', (string) $content)) : null;
} elseif ($this->getIdentifier() === MetadataTypes\DeviceAttributeNameType::ATTRIBUTE_FIRMWARE_MANUFACTURER) {
} elseif ($this->getIdentifier() === MetadataTypes\DeviceAttributeIdentifierType::IDENTIFIER_FIRMWARE_MANUFACTURER) {
if ($content instanceof MetadataTypes\FirmwareManufacturerType) {
$this->content = strval($content->getValue());
} else {
Expand Down
6 changes: 3 additions & 3 deletions src/Models/States/ConnectorConnectionStateManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function setState(
): bool {
$stateProperty = $this->dataStorageRepository->findByIdentifier(
$connector->getId(),
MetadataTypes\ConnectorPropertyNameType::NAME_STATE
MetadataTypes\ConnectorPropertyIdentifierType::IDENTIFIER_STATE
);

if ($stateProperty === null) {
Expand All @@ -112,7 +112,7 @@ public function setState(
$stateProperty = $this->manager->create(Utils\ArrayHash::from([
'connector' => $connector,
'entity' => Entities\Connectors\Properties\DynamicProperty::class,
'identifier' => MetadataTypes\ConnectorPropertyNameType::NAME_STATE,
'identifier' => MetadataTypes\ConnectorPropertyIdentifierType::IDENTIFIER_STATE,
'dataType' => MetadataTypes\DataTypeType::get(MetadataTypes\DataTypeType::DATA_TYPE_ENUM),
'unit' => null,
'format' => [
Expand Down Expand Up @@ -208,7 +208,7 @@ public function getState(
): MetadataTypes\ConnectionStateType {
$stateProperty = $this->dataStorageRepository->findByIdentifier(
$connector->getId(),
MetadataTypes\ConnectorPropertyNameType::NAME_STATE
MetadataTypes\ConnectorPropertyIdentifierType::IDENTIFIER_STATE
);

if (
Expand Down
6 changes: 3 additions & 3 deletions src/Models/States/DeviceConnectionStateManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function setState(
): bool {
$stateProperty = $this->repository->findByIdentifier(
$device->getId(),
MetadataTypes\DevicePropertyNameType::NAME_STATE
MetadataTypes\DevicePropertyIdentifierType::IDENTIFIER_STATE
);

if ($stateProperty === null) {
Expand All @@ -112,7 +112,7 @@ public function setState(
$stateProperty = $this->manager->create(Utils\ArrayHash::from([
'device' => $device,
'entity' => Entities\Devices\Properties\DynamicProperty::class,
'identifier' => MetadataTypes\ConnectorPropertyNameType::NAME_STATE,
'identifier' => MetadataTypes\ConnectorPropertyIdentifierType::IDENTIFIER_STATE,
'dataType' => MetadataTypes\DataTypeType::get(MetadataTypes\DataTypeType::DATA_TYPE_ENUM),
'unit' => null,
'format' => [
Expand Down Expand Up @@ -213,7 +213,7 @@ public function getState(
): MetadataTypes\ConnectionStateType {
$stateProperty = $this->repository->findByIdentifier(
$device->getId(),
MetadataTypes\DevicePropertyNameType::NAME_STATE
MetadataTypes\DevicePropertyIdentifierType::IDENTIFIER_STATE
);

if (
Expand Down

0 comments on commit 0ad7dc0

Please sign in to comment.