-
Notifications
You must be signed in to change notification settings - Fork 62
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
Basic cover support #80
Conversation
Will send you a PR with Czech translations, tonight. |
Also we should think about a way to check if cover was really closed/opened as safety can be involed (Garage doors). That fuction should be universal, so we can use ot with other entties like locks. |
hmmm... I am not sure about that, because none of my covers has a valid way to check if it really is open/closed... |
Each entity that is somehow activated return its state. For example switch. You can turn it on/off but also You can retrieve it's state: skill-homeassistant/__init__.py Line 458 in 2f8b7a4
Now we just execute turn on/off action and say it's done if no error occur. My option: For covers and locks I would rater execute service, inform user we executed command and spawn some type of timeout which after done would read state of entity and confirm that command was un/successfully done. This way it would be only up to HA component, how they handle security manner. |
@Tony763 @krisgesling With the last commit, you can check the state of a |
It would be fine to report open/opening/close/closing in selected language. I think I have seen a function for this somewhere. I will try to find it. |
Didn't find, I think, ti should be done as voc_match, but in reverse. We would create 4 voc files with name of status and put translates states into them. Then when state is returned, we try to check if returned state match name of voc file and if yes, take random word from it (in case multiple words in voc). What do you think? |
I think the preferred way would be to have an self.translate(action) Alternatively you could have a comma separated listed of actions in an action_vocab = self.translate_namedvalues('actions')
close = action_vocab['close'] But yeah, the first option I think is better. |
thanks @krisgesling ! what if there is no matching file? does it return the |
…omeassistant into feature/covers
You could limit it by entity domain. |
@Tony763 makes sense! |
@Tony763 @krisgesling I decided to use different dialogues for each state, because the sentence syntax differs between the states (at least in german), so the response is much nicer. |
Yes, that's usual. Dialogues in Czech are often different as direct 1:1 translation makes no sense. |
@stratus-ss done! |
LGTM, pending testing |
@Tony763 can you help? what do I have to do to fix the |
Hi @pfefferle, sure, I have to go to work, now so I will check it tonight. |
@pfefferle create empty branch |
also change line 556 in @pfefferle Faster than me :D I edited fixed line as there was whitespace before |
;) I fixed all lint errors in the |
@Tony763 on my "local" fork, it also works on branches. I think it breaks if you send PRs from remote branches. Maybe a security thingy. |
@krisgesling do you have any insight into the check that is failing? |
Hi @stratus-ss, please check PR #87. I covered there whats going on and fixed it. |
I have a cover defined
I don't seem to get any output from the skill because the cover is dumb and does not report its' state Here is an entity test
here is the cover test output
The cover does indeed open and close, but there is no output from the skill I am using a binary_sensor on the cover to determine its' open/close status since the cover itself does not report state |
@stratus-ss thanks for testing! You miss an output, like "{Entity} is going to open"? The missing "real" state is a problem of the cover and/or Home Assistant (config). I mentioned it here: #80 (comment)
|
Yes, some sort of feedback is what I expect. If I wasn't watching my garage door, I wouldn't know if Mycroft heard me, had a problem, was waiting on a slow internet connection, had a bad TTS problem or otherwise. Consistent interaction is important. As existing commands give some sort of feedback, so should this PR
Yes, I understand, I was confirming this. I was adding context in case someone reads this in the future |
Should I keep the output vague? Something like: "trying to open {Entity}?" |
There is the ideal and then the practical. The ideal is to attempt to check the status of the cover. If, like in my case, the status comes back with nothing, is empty or throws an error then the response would be general. Having said that, if you just want to push this through, the practical or MVP for this PR is just a vague response |
I would start with the simple and vague solution, to keep the PR simple. The problem is, that it always return a state and you never can get sure if it is really the state. At least I have not found a valid metric! So the only metric that I can think of is time. If the cover instantaneous changes the state it seems to be a "stateless" cover. Maybe this is something to report on the home assistant repo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Mycroft now provides feedback when dealing with cover commands
Description
Basic implementation of
cover_open
,cover_close
andcover_stop
Type of PR
If your PR fits more than one category, there is a high chance you should submit more than one PR. Please consider this carefully before opening the PR.
Either delete those that do not apply, or add an x between the square brackets like so:
- [x]
Testing
Say "Can you close {Entity} please?" or "Can you open {Entity} please?"