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

[EN] Add sentence option "an" #2847

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

Conversation

dlearningcode
Copy link

Add "an" as an option to sentences, for calling numbers that begin with vowels, such as eight, eleven, or eighty. Currently, Assist fails if I ask it to "set an eleven minute timer".

Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dlearningcode

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant
Copy link

home-assistant bot commented Jan 7, 2025

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant bot marked this pull request as draft January 7, 2025 15:19
@dlearningcode dlearningcode marked this pull request as ready for review January 7, 2025 15:39
@dlearningcode
Copy link
Author

CLA signed, pull request review process page read. Sorry, learning where everything is as written instructions perforce are always out of date.

@dlearningcode
Copy link
Author

Please forgive any annoyance here. This is my very first time ever forking a repository and creating a pull request, so I've been bumbling about among various resources to try to get this done. Right now the thread is reporting that 1 workflow is awaiting approval; a build whose status needs to be reported. What does that mean and how do I do it? This isn't mentioned in any of the links I've clicked through on this page, and ChatGPT says to ask a maintainer.

@andreasbrett andreasbrett changed the title Add sentence option "an" [En] Add sentence option "an" Jan 7, 2025
@andreasbrett andreasbrett changed the title [En] Add sentence option "an" [EN] Add sentence option "an" Jan 7, 2025
@andreasbrett
Copy link
Contributor

Looks good but you should also add tests for these new/modified sentences. The reviewers for EN should soon review and approve this. You're almost there.

@dlearningcode
Copy link
Author

dlearningcode commented Jan 7, 2025

Looks good but you should also add tests for these new/modified sentences. The reviewers for EN should soon review and approve this. You're almost there.

Hey Andreas, thanks for the input. I would happily add tests, but: 1) All I did was add an option, without changing the structure, so I didn't think it would require any additional consideration; 2) I don't know how to do tests. I had learned a little about them when I first got my front end developer certificate, but I've never actually written or applied them in any environment. I wouldn't even know where to begin.

@ViViDboarder
Copy link
Contributor

Take a look at this and make a copy of that block using 8 instead

Here's how to run the tests: https://github.com/home-assistant/intents/tree/main?tab=readme-ov-file#run-tests

@dlearningcode
Copy link
Author

Take a look at this and make a copy of that block using 8 instead

Here's how to run the tests: https://github.com/home-assistant/intents/tree/main?tab=readme-ov-file#run-tests

This is fantastic information in quick review, ViViDboarder! I'm not exactly sure what to do with it; I have no familiarity with Python. I'm trying to research (I mostly learn through YouTube), but if you don't mind and have a moment, am I supposed to add new sentences to the StartTimer page and then test them in VS Code? Scanning through the StartTimer page, I can see that there were no examples with numbers starting with vowels.

I will continue to learn, but will this hold up the approval process?

@ViViDboarder
Copy link
Contributor

You don't actually need to write any Python. It's all just sentences in these yaml files. A Python script is going to run the tests, but you only need to execute it.

If you're using vscode, you should be able to use the devcontainer (I think vscode asks you about this automatically? I don't use vscode or devcontainers myself).

Once you edit the yaml file you can enter a shell in the dev container and run the tests by running pytest tests --language en -k homeassistant_HassStartTimer.

@mrdarrengriffin
Copy link
Contributor

Nice suggestion. Looks great

@mrdarrengriffin
Copy link
Contributor

@dlearningcode The only suggestion I would make is to add some acompanying tests for the new addition

@dlearningcode
Copy link
Author

Thanks for approving, @mrdarrengriffin. @ViViDboarder and andreasbrett made the same suggestion about tests, and I want to comply, but this is the first I've heard of this and I'm trying to wrap my head around how to do it.

I'm now starting to go through the devcontainer documentation, and will hope to get that done, whatever that entails, today or tomorrow.

@ViViDboarder
Copy link
Contributor

Awesome. Thanks for your patience. If you need help, you can check out the Home Assistant Discord in the developer support forum.

@tetele
Copy link
Contributor

tetele commented Jan 10, 2025

Easiest way to use devcontainers would be to start a Github codespace for your fork of the intents repo

codespace

@dlearningcode
Copy link
Author

dlearningcode commented Jan 10, 2025

Easiest way to use devcontainers would be to start a Github codespace for your fork of the intents repo

Sorry, been down sick, just started researching again a bit last night. @tetele, I very much appreciate the tip, but I will admit it confuses me, as the directions on using codespaces say to run the codespace directly from home-assistant/intents. Are the directions out of date, or is there a reason you suggest building it from a fork?

I was actually trying to learn how to build a devcontainer in my local VS Code, so that I can work this from my different computers at home -- I've actually already forked the intents directory -- but all the directions seem written for someone with more experience than me, so I've been digging up YouTube videos on getting started, but I still don't know where I'm supposed to type the script/setup command in the Forking Workflow.

After all that, there's still writing the test! I'm reading the developer docs on template sentence syntax, test syntax, and contributing sentences, and will bumble my way through, as usual.

Now, if you direct me to the discord, I'm happy to do that, but if you're willing to address any/all of my questions, I'd be grateful.

@tetele
Copy link
Contributor

tetele commented Jan 10, 2025

Are the directions out of date, or is there a reason you suggest building it from a fork?

I am suggesting building it from a repo where you have write access, i.e. your own fork

I still don't know where I'm supposed to type the script/setup

In your codespace or in VSCode, open up a terminal and write the command while you're in your workspace folder

Now, if you direct me to the discord, I'm happy to do that

#developers on Discord. You may get redirected from there

@dlearningcode
Copy link
Author

Thanks, @tetele, I have started a request at Discord. If I create a codespace from my fork, will I be able to follow the directions on codespaces built from home-assistant/intents to then create the pull request, or does anything change if I'm doing it on my fork?

@tetele
Copy link
Contributor

tetele commented Jan 10, 2025

The instructions are pretty much solid. Maybe some small things are a bit outdated, but all in all you should be good to go.

@dlearningcode
Copy link
Author

Hey Team, I'm looking for guidance committing my codespace sentence tests update.

I opened a codespace on this feature-sentence-an branch, and added test sentences and tested the file. I'm now in the source control tab.

According to the codespace instructions, I should select Commit & Create Pull Request, but that doesn't seem to apply here as this is already a PR. Guidance on proper selection, please?

commit_menu

@dlearningcode
Copy link
Author

Okay, I think I did everything right, I believe I'm up to date with the main branch, and the tests have been added. But the status thing shows "1 workflow awaiting approval" and "Required statuses must pass before merging". I clicked the statuses link but didn't understand any of what was there. Could you please let me know if there's something else I need to do?

@dlearningcode
Copy link
Author

According to the codespace instructions, I should select Commit & Create Pull Request, but that doesn't seem to apply here as this is already a PR. Guidance on proper selection, please?

I decided to do Commit & Push. Let me know if that was wrong.

Copy link
Contributor

@tetele tetele left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thanks!

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

Successfully merging this pull request may close these issues.

5 participants