Skip to content

Malformed entity id. Broken get_state API #47

@bramstroker

Description

@bramstroker

Calling get_state will always result in a malformed entity_id error.

state = self.client.get_state(self._entity_id)
File "/usr/local/lib/python3.8/site-packages/homeassistant_api/client.py", line 207, in get_state
raise MalformedInputError(f"The entity_id, {entity_id!r}, is malformed")
homeassistant_api.errors.MalformedInputError: The entity_id, 'light.amirlight', is malformed

I have pinpointed the problem to be in the malformed_id function. https://github.com/GrandMoff100/HomeAssistantAPI/blob/master/homeassistant_api/client.py#L123

The 4th check here entity_id.lower() == entity_id will always evaluate to True, causing the malformed checker to return True.
This should be entity_id.lower() != entity_id imo.

The bug must be introduced in the latest version as it was working fine for me before.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions