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

Commit

Permalink
Check if GUI is connected rather than maintain list of platforms
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
krisgesling committed Nov 5, 2021
1 parent ea15759 commit 4ff2ef8
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions mycroft/skills/common_query_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ def is_CQSVisualMatchLevel(match_level):
return isinstance(match_level, type(CQSVisualMatchLevel.EXACT))


VISUAL_DEVICES = ['mycroft_mark_2']

"""these are for the confidence calculation"""
# how much each topic word is worth
# when found in the answer
Expand All @@ -53,10 +51,6 @@ def is_CQSVisualMatchLevel(match_level):
WORD_COUNT_DIVISOR = 100


def handles_visuals(platform):
return platform in VISUAL_DEVICES


class CommonQuerySkill(MycroftSkill, ABC):
"""Question answering skills should be based on this class.
Expand Down Expand Up @@ -149,9 +143,8 @@ def __calc_confidence(self, match, phrase, level, answer):
num_sentences = float(float(len(answer.split("."))) / float(10))

# Add bonus if match has visuals and the device supports them.
platform = self.config_core.get("enclosure", {}).get("platform")
bonus = 0.0
if is_CQSVisualMatchLevel(level) and handles_visuals(platform):
if is_CQSVisualMatchLevel(level) and self.gui.connected:
bonus = 0.1

# extract topic
Expand Down

0 comments on commit 4ff2ef8

Please sign in to comment.