Skip to content

Commit 84d45df

Browse files
authored
Merge pull request #52 from OpenVoiceOS/release-0.2.18a1
Release 0.2.18a1
2 parents 48e8338 + 8bae207 commit 84d45df

File tree

4 files changed

+21
-72
lines changed

4 files changed

+21
-72
lines changed

CHANGELOG.md

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,16 @@
11
# Changelog
22

3-
## [0.2.17a1](https://github.com/OpenVoiceOS/ovos-skill-dictation/tree/0.2.17a1) (2025-06-07)
3+
## [0.2.18a1](https://github.com/OpenVoiceOS/ovos-skill-dictation/tree/0.2.18a1) (2025-06-07)
44

5-
[Full Changelog](https://github.com/OpenVoiceOS/ovos-skill-dictation/compare/0.2.16a2...0.2.17a1)
5+
[Full Changelog](https://github.com/OpenVoiceOS/ovos-skill-dictation/compare/V0.2.17...0.2.18a1)
66

77
**Merged pull requests:**
88

9-
- fix: automations [\#49](https://github.com/OpenVoiceOS/ovos-skill-dictation/pull/49) ([JarbasAl](https://github.com/JarbasAl))
9+
- fix: workshop 6.0.0 compat [\#51](https://github.com/OpenVoiceOS/ovos-skill-dictation/pull/51) ([JarbasAl](https://github.com/JarbasAl))
1010

11-
## [0.2.16a2](https://github.com/OpenVoiceOS/ovos-skill-dictation/tree/0.2.16a2) (2025-06-07)
11+
## [V0.2.17](https://github.com/OpenVoiceOS/ovos-skill-dictation/tree/V0.2.17) (2025-06-07)
1212

13-
[Full Changelog](https://github.com/OpenVoiceOS/ovos-skill-dictation/compare/0.2.16a1...0.2.16a2)
14-
15-
**Merged pull requests:**
16-
17-
- Fix/session [\#47](https://github.com/OpenVoiceOS/ovos-skill-dictation/pull/47) ([JarbasAl](https://github.com/JarbasAl))
18-
19-
## [0.2.16a1](https://github.com/OpenVoiceOS/ovos-skill-dictation/tree/0.2.16a1) (2025-06-05)
20-
21-
[Full Changelog](https://github.com/OpenVoiceOS/ovos-skill-dictation/compare/V0.2.15...0.2.16a1)
22-
23-
**Merged pull requests:**
24-
25-
- gl/translate [\#45](https://github.com/OpenVoiceOS/ovos-skill-dictation/pull/45) ([gitlocalize-app[bot]](https://github.com/apps/gitlocalize-app))
26-
27-
## [V0.2.15](https://github.com/OpenVoiceOS/ovos-skill-dictation/tree/V0.2.15) (2025-05-06)
28-
29-
[Full Changelog](https://github.com/OpenVoiceOS/ovos-skill-dictation/compare/0.2.15...V0.2.15)
13+
[Full Changelog](https://github.com/OpenVoiceOS/ovos-skill-dictation/compare/0.2.17...V0.2.17)
3014

3115

3216

__init__.py

Lines changed: 13 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ def stop_dictation(self, message=None):
7474
name = self.dictation_sessions[sess.session_id]["file_name"] or time.time()
7575
with open(f"{path}/{name}.txt", "w") as f:
7676
f.write("\n".join(self.dictation_sessions[sess.session_id]["dictation_stack"]))
77-
self.gui.show_text(f"saved to {path}/{name}.txt")
77+
78+
if sess.session_id == "default":
79+
self.gui.show_text(f"saved to {path}/{name}.txt")
7880

7981
self.dictation_sessions[sess.session_id]["dictating"] = False
8082

@@ -94,6 +96,10 @@ def handle_stop_dictation_intent(self, message):
9496
self.speak_dialog("not_dictating")
9597
self.stop_dictation(message)
9698

99+
def can_stop(self, message: Message) -> bool:
100+
session = SessionManager.get(message)
101+
return session.session_id in self.dictation_sessions and self.dictation_sessions[session.session_id]["dictating"]
102+
97103
def stop_session(self, session: Session):
98104
if session.session_id in self.dictation_sessions and \
99105
self.dictation_sessions[session.session_id]["dictating"]:
@@ -102,14 +108,6 @@ def stop_session(self, session: Session):
102108
return True
103109
return False
104110

105-
def stop(self):
106-
sess = SessionManager.get()
107-
if sess.session_id in self.dictation_sessions and \
108-
self.dictation_sessions[sess.session_id]["dictating"]:
109-
self.stop_session(sess)
110-
return True
111-
return False
112-
113111
def can_answer(self, message: Message) -> bool:
114112
"""
115113
Determines if the skill can handle the given utterances in the specified language in the converse method.
@@ -119,47 +117,14 @@ def can_answer(self, message: Message) -> bool:
119117
Returns:
120118
True if the skill can handle the query during converse; otherwise, False.
121119
"""
122-
sess = SessionManager.get(message)
123-
if sess.session_id in self.dictation_sessions and \
124-
self.dictation_sessions[sess.session_id]["dictating"]:
125-
return True
126-
return False
120+
return self.can_stop(message) # same logic
127121

128122
def converse(self, message):
129123
utterance = message.data["utterances"][0]
130124
sess = SessionManager.get(message)
131-
if sess.session_id in self.dictation_sessions and \
132-
self.dictation_sessions[sess.session_id]["dictating"]:
133-
if self.voc_match(utterance, "StopKeyword"):
134-
self.handle_stop_dictation_intent(message)
135-
else:
125+
if self.voc_match(utterance, "StopKeyword"):
126+
self.handle_stop_dictation_intent(message)
127+
else:
128+
if sess.session_id == "default":
136129
self.gui.show_text(utterance)
137-
self.dictation_sessions[sess.session_id]["dictation_stack"].append(utterance)
138-
return True
139-
return False
140-
141-
142-
if __name__ == "__main__":
143-
from ovos_utils.fakebus import FakeBus
144-
145-
146-
# print speak for debugging
147-
def spk(utt, *args, **kwargs):
148-
print(utt)
149-
150-
151-
s = DictationSkill(skill_id="fake.test", bus=FakeBus())
152-
s.speak = spk
153-
154-
s.handle_stop_dictation_intent(Message(""))
155-
# I am not dictating at this moment
156-
s.handle_start_dictation_intent(Message(""))
157-
# ok, i am ready for dictation
158-
s.converse(Message("", {"utterances": ["test"]}))
159-
s.converse(Message("", {"utterances": ["test"]}))
160-
s.converse(Message("", {"utterances": ["test"]}))
161-
s.converse(Message("", {"utterances": ["stop"]}))
162-
# dictation stopped
163-
s.converse(Message("", {"utterances": ["test"]}))
164-
165-
assert s.dictation_stack == ['test', 'test', 'test']
130+
self.dictation_sessions[sess.session_id]["dictation_stack"].append(utterance)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ovos-workshop>=5.0.0,<6.0.0
1+
ovos-workshop>=6.0.0,<7.0.0

version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# START_VERSION_BLOCK
22
VERSION_MAJOR = 0
33
VERSION_MINOR = 2
4-
VERSION_BUILD = 17
5-
VERSION_ALPHA = 0
4+
VERSION_BUILD = 18
5+
VERSION_ALPHA = 1
66
# END_VERSION_BLOCK

0 commit comments

Comments
 (0)