Skip to content

Commit 3cad5f5

Browse files
author
Robert Schindler
committed
[schedy] Fixed possible TypeError with the generic2 actor type
Fixes #47
1 parent a0e867d commit 3cad5f5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

docs/apps/schedy/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99
## Unreleased
1010

1111
### Fixed
12+
* Fixed possible `TypeError` when using the `generic2` actor type. (#47)
1213

1314
### Security
1415

hass_apps/schedy/actor/generic2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def _find_value_cfg(self, value: T.Tuple) -> T.Any:
8686
def _populate_service_data(self, data: T.Dict, fmt: T.Dict[str, T.Any]) -> None:
8787
"""Fills in placeholders in the service data definition."""
8888
# pylint: disable=too-many-nested-blocks
89-
memo = {data} # type: T.Set[T.Union[T.Dict, T.List]]
89+
memo = [data] # type: T.List[T.Union[T.Dict, T.List]]
9090
while memo:
9191
obj = memo.pop()
9292
if isinstance(obj, dict):
@@ -123,7 +123,7 @@ def _populate_service_data(self, data: T.Dict, fmt: T.Dict[str, T.Any]) -> None:
123123
level="ERROR",
124124
)
125125
elif isinstance(value, (dict, list)):
126-
memo.add(value)
126+
memo.append(value)
127127

128128
def do_send(self) -> None:
129129
"""Executes the configured services for self._wanted_value."""

0 commit comments

Comments
 (0)