From 7ccc32a953f1f180425b5bb1e9f6f4253de30c9c Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Mon, 27 Jan 2025 17:14:16 -0600 Subject: [PATCH] added warning about extra kwargs in get_state --- appdaemon/adapi.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/appdaemon/adapi.py b/appdaemon/adapi.py index d7c1392c5..90ad2b127 100644 --- a/appdaemon/adapi.py +++ b/appdaemon/adapi.py @@ -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. @@ -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)