Skip to content
This repository was archived by the owner on Sep 8, 2024. It is now read-only.

Commit 4ff2ef8

Browse files
committed
Check if GUI is connected rather than maintain list of platforms
There are already many Mycroft platforms that have GUIs and this will only grow. We want to know if the device has a GUI connected rather than if it is in a pre-defined list of platforms.
1 parent ea15759 commit 4ff2ef8

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

mycroft/skills/common_query_skill.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ def is_CQSVisualMatchLevel(match_level):
3636
return isinstance(match_level, type(CQSVisualMatchLevel.EXACT))
3737

3838

39-
VISUAL_DEVICES = ['mycroft_mark_2']
40-
4139
"""these are for the confidence calculation"""
4240
# how much each topic word is worth
4341
# when found in the answer
@@ -53,10 +51,6 @@ def is_CQSVisualMatchLevel(match_level):
5351
WORD_COUNT_DIVISOR = 100
5452

5553

56-
def handles_visuals(platform):
57-
return platform in VISUAL_DEVICES
58-
59-
6054
class CommonQuerySkill(MycroftSkill, ABC):
6155
"""Question answering skills should be based on this class.
6256
@@ -149,9 +143,8 @@ def __calc_confidence(self, match, phrase, level, answer):
149143
num_sentences = float(float(len(answer.split("."))) / float(10))
150144

151145
# Add bonus if match has visuals and the device supports them.
152-
platform = self.config_core.get("enclosure", {}).get("platform")
153146
bonus = 0.0
154-
if is_CQSVisualMatchLevel(level) and handles_visuals(platform):
147+
if is_CQSVisualMatchLevel(level) and self.gui.connected:
155148
bonus = 0.1
156149

157150
# extract topic

0 commit comments

Comments
 (0)