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

Sanitize data from Home Assistant #13

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

BrianAker
Copy link

These changes sanitize the data being exported from Home Assistant to the esp32. There is still a need to sanitize the data on the esp32 side as well, but these changes will fix the import data issues.

BrianAker added 7 commits July 6, 2022 13:25
Data validation for MAC address and initial values for BLE gateway.
Update template that is used to pass data to Esphome devices, sanitize all data.
And min and max for new device for input_text
Add sort()
Allow text_sensor for MAC address to have a minimum value of 0 since there is no concept of NULL.
@myhomeiot
Copy link
Owner

Thanks for PR!
I my case it's was possible to add few devices at once, just specify few MACs in a row. Here validation will allow to specify only one device MAC, do you think it's will be better?

@BrianAker
Copy link
Author

For the most part, I just allow my setup to discover devices. In the few cases where I found a need to add addresses, I added them one at a time.
It would certainly be possible to come up with a list format as well, though that is not something I thought of.
I just wanted bad data out of the system, and some validation on what was being passed in.
The nice thing about validation as well is that for someone who is knew to this, they get an idea of what sort of value that the text box takes.
FWIW I think that once the device has been added, I think the value should go back to being blank.

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

Successfully merging this pull request may close these issues.

2 participants