-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: Add Integration through UI without breaking old config #7
Conversation
@arifwn could you kindly take a look at this? |
Thank you @sayam93 , I'll review your pull request soon. |
Hi @sayam93, I found two issues in the pull requests when I tested it on homeassistant version 2024.12.3 : The first one happen when adding device via configflow which results in The second one happens when the device has been configured. Attempting to configure the device again via ui will result in http 500. The error go away by updating Other than the two issues above, the update works on homeassistant version 2024.12.3. Existing config is still used if it exists, and the new device added from the ui can be used via |
@arifwn code updated now. this should fix both the issues pointed out by you. |
@arifwn Above changes made to the initial PR to fix the issues mentioned by you. |
Thank you @sayam93 , I'll test it again soon. |
@sayam93 the edit form is no longer crashing, but the phone number and country code field are empty: Screencast.From.2024-12-20.21-33-09.mp4 |
Allow users to add this integration using UI without breaking old configuration. Any notify service previously created through manual code in configuration.yaml remains functional. It gives the user choice to setup through UI if they want or continue with the old method. While setup through UI, the user enters the Whatsapp number (without country code) and country code separately. If the user's number is '+919876556789' where country code is '+91', then the user shall to enter 9876556789 as the WhatsApp Phone Number and +91 as the Country Code during setup. A notification service name notify.whatspie_919876556789 will be saved in such case. When calling the notify service (like notify.whatspie_919876556789), the user has to mention the full phone number of the recipient with country code. An updated readme is also available for users.
@arifwn I have updated the PR to fix this by adding two new constants to const.py in addition to the existing 4. I have also imported these constants in the config_flow.py to store unsanitised value from user input while setting up the configuration entry using UI. These values are then showed up while editing the config and when edited, correctly combined to rebuild the number to be stored in the config. See the below screenshots for changes. |
@arifwn Let me know how the updated PR works for you. I am unable to test the latest changes for myself since my trial subscription expired. |
Thank you @sayam93 , I'll do some more testing this weekend. |
@sayam93 featurewise, I found no issue, but the manifest check below produce some error: https://github.com/arifwn/homeassistant-whatspie-integration/actions/runs/12435355722 |
@arifwn The latest commit should fix all these errors. |
Thank you @sayam93! There is some minor manifest issue left, but those are minor issues and I can fix that when I merge this pr soon. |
Allow users to add this integration using UI without breaking old configuration. Any notify service previously created through manual code in configuration.yaml remains functional. It gives the user choice to setup through UI if they want or continue with the old method.
While setup through UI, the user enters the Whatsapp number (without country code) and country code separately.
If the user's number is '+919876556789' where country code is '+91', then the user shall to enter 9876556789 as the WhatsApp Phone Number and +91 as the Country Code during setup. A notification service name notify.whatspie_919876556789 will be saved in such case.
When calling the notify service (like notify.whatspie_919876556789), the user has to mention the full phone number of the recipient with country code.
An updated readme is also available for users.