Skip to content

Commit

Permalink
Extending state managers interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
akadlec committed Jan 14, 2022
1 parent 20f2b99 commit 2e0e208
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion devices_module/__init__.py
Expand Up @@ -18,4 +18,4 @@
Devices module
"""

__version__ = "0.11.0"
__version__ = "0.12.0"
14 changes: 12 additions & 2 deletions devices_module/managers/state.py
Expand Up @@ -51,6 +51,7 @@ def create(
@abstractmethod
def update(
self,
device_property: DevicePropertyEntity,
state: IDevicePropertyState,
data: Dict[str, Union[str, int, float, bool, None]],
) -> IDevicePropertyState:
Expand All @@ -59,7 +60,11 @@ def update(
# -----------------------------------------------------------------------------

@abstractmethod
def delete(self, state: IDevicePropertyState) -> bool:
def delete(
self,
device_property: DevicePropertyEntity,
state: IDevicePropertyState,
) -> bool:
"""Delete existing device property state"""


Expand All @@ -86,6 +91,7 @@ def create(
@abstractmethod
def update(
self,
channel_property: ChannelPropertyEntity,
state: IChannelPropertyState,
data: Dict[str, Union[str, int, float, bool, None]],
) -> IChannelPropertyState:
Expand All @@ -94,5 +100,9 @@ def update(
# -----------------------------------------------------------------------------

@abstractmethod
def delete(self, state: IChannelPropertyState) -> bool:
def delete(
self,
channel_property: ChannelPropertyEntity,
state: IChannelPropertyState,
) -> bool:
"""Delete existing channel property state"""
2 changes: 2 additions & 0 deletions src/Models/States/IChannelPropertiesManager.php
Expand Up @@ -48,6 +48,7 @@ public function create(
* @return States\IChannelProperty
*/
public function update(
Entities\Channels\Properties\IProperty $property,
States\IChannelProperty $state,
Utils\ArrayHash $values
): States\IChannelProperty;
Expand All @@ -58,6 +59,7 @@ public function update(
* @return bool
*/
public function delete(
Entities\Channels\Properties\IProperty $property,
States\IChannelProperty $state
): bool;

Expand Down
2 changes: 2 additions & 0 deletions src/Models/States/IDevicePropertiesManager.php
Expand Up @@ -48,6 +48,7 @@ public function create(
* @return States\IDeviceProperty
*/
public function update(
Entities\Devices\Properties\IProperty $property,
States\IDeviceProperty $state,
Utils\ArrayHash $values
): States\IDeviceProperty;
Expand All @@ -58,6 +59,7 @@ public function update(
* @return bool
*/
public function delete(
Entities\Devices\Properties\IProperty $property,
States\IDeviceProperty $state
): bool;

Expand Down

0 comments on commit 2e0e208

Please sign in to comment.