Support adding different server locations for Microsoft face component#7532
Conversation
|
@tsvi, thanks for your PR! By analyzing the history of the files in this pull request, we identified @balloob, @robbiet480 and @fabaff to be potential reviewers. |
pvizeli
left a comment
There was a problem hiding this comment.
Looks good. Please add also a unittest for that change
| CONF_SENDER = 'sender' | ||
| CONF_SENSOR_CLASS = 'sensor_class' | ||
| CONF_SENSORS = 'sensors' | ||
| CONF_SERVER_LOC = 'server_location' |
There was a problem hiding this comment.
Please move that into component
There was a problem hiding this comment.
Do you mean directly into microsoft_face.py? I didn't know that was an option. Will implement hopefully tomorrow.
| CONFIG_SCHEMA = vol.Schema({ | ||
| DOMAIN: vol.Schema({ | ||
| vol.Required(CONF_API_KEY): cv.string, | ||
| vol.Optional(CONF_SERVER_LOC, default="westus"): cv.string, |
There was a problem hiding this comment.
We should not short the constant name. So use CONF_SERVER_LOCATION. I'm not usre if CONF_API_ENDPOINT a better choise for the name. You have the choise
There was a problem hiding this comment.
API_ENDPOINT seems to refer the full endpoint URL.
AZURE_REGION or SERVER_REGION might be more appropriate.
There was a problem hiding this comment.
Yeah, I like CONF_AZURE_REGION 👍 you can choise it
|
I suppose I should update the docs as well. How do we sync between both changes? |
|
@tsvi Yes, open a docs PR for next |
|
Thanks for the contribution! 🎉 |
Description:
This fix allows to specify
server_locationin the configuration.yaml for microsoft_face component.This is needed as it depends where your Azure server is located to access the API
Related issue (if applicable): fixes #7529
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#2611
Example entry for
configuration.yaml(if applicable):Checklist:
toxrun successfully. Your PR cannot be merged unless tests pass