Skip to content

Commit

Permalink
added warning about extra kwargs in get_state
Browse files Browse the repository at this point in the history
  • Loading branch information
jsl12 committed Jan 27, 2025
1 parent 6db71c5 commit 7ccc32a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion appdaemon/adapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1561,7 +1561,8 @@ def get_state(
attribute: str | None = None,
default: Any | None = None,
namespace: str | None = None,
copy: bool = True
copy: bool = True,
**kwargs
) -> Any:
"""Gets the state of any component within Home Assistant.
Expand Down Expand Up @@ -1620,6 +1621,9 @@ def get_state(
>>> state = self.get_state("light.office_1", attribute="all")
"""
if kwargs:
self.logger.warning(f'Extra kwargs passed to get_state, will be ignored: {kwargs}')

namespace = namespace or self.namespace
self._check_entity(namespace, entity_id)
entity_api = self.get_entity_api(namespace, entity_id)
Expand Down

0 comments on commit 7ccc32a

Please sign in to comment.