Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uppercase and whitespaces #5

Closed
ichmachnixichgucknur opened this issue Aug 23, 2020 · 2 comments
Closed

uppercase and whitespaces #5

ichmachnixichgucknur opened this issue Aug 23, 2020 · 2 comments

Comments

@ichmachnixichgucknur
Copy link

ichmachnixichgucknur commented Aug 23, 2020

Hi,
first of all - thank you for providing this component!!
As I was trying to activate this component, I found an issue that should be easily resolvable :)

If the Name of the scooter contains whitespaces or includes capital letters, you get the error below. So if you would implement x.lower and maybe replace whitespaces, this should be it.

Log:
2020-08-23 21:06:30 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up niu platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 192, in _async_setup_platform
await asyncio.gather(*pending)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 301, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 443, in _async_add_entity
raise HomeAssistantError(f"Invalid entity id: {entity.entity_id}")
homeassistant.exceptions.HomeAssistantError: Invalid entity id: sensor.niu_scooter_NAME_battery_charge

Thanks!

@dathosim
Copy link
Contributor

i created a pull request (i'm not a python expert so i replace only space and ')
#8

@marcelwestrahome
Copy link
Owner

solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants