Skip to content

Commit 2c77d02

Browse files
authored
Update (#2)
* update to make useable again * clean up
1 parent 190aa64 commit 2c77d02

File tree

4 files changed

+9
-194
lines changed

4 files changed

+9
-194
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ The Mycroft Mark 1 has several unique capabilities which this Skill lets you con
88

99
The Mark 1 has beautiful eyes -- and you get to pick their color! Set them to
1010
a named color ("blue", "magenta", "teal", etc) or any color using RGB values.
11-
Please see the [color](./locale/en-us/colors.value)
12-
list for more options
11+
Please see the [ovos-color-parser](https://github.com/OpenVoiceOS/ovos-color-parser)
12+
for more options
1313

1414

1515
## Examples
1616

1717
* "Set your eye color to green"
1818
* "Set a custom eye color" (you'll be prompted for values)
19-
* "Change to low brightness"
2019
* "Dim to 50%"
2120
* "look up"
2221
* "look down"

__init__.py

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import time
33
from ast import literal_eval as parse_tuple
44
from ovos_color_parser import color_from_description, sRGBAColor
5-
# from difflib import SequenceMatcher
65
from ovos_utils import create_daemon, classproperty
76
from ovos_utils.log import LOG
87
from ovos_utils.process_utils import RuntimeRequirements
@@ -30,37 +29,20 @@ def _hex_to_rgb(_hex):
3029
except Exception:
3130
return None
3231

33-
34-
# def fuzzy_match_color(color_a, color_dict):
35-
# """ fuzzy match for colors
36-
#
37-
# Args:
38-
# color_a (str): color as string
39-
# color_dict (dict): dict with colors
40-
# Returns:
41-
# color: color from color_dict
42-
# """
43-
# highest_ratio = float("-inf")
44-
# _color = None
45-
# for color, value in color_dict.items():
46-
# s = SequenceMatcher(None, color_a, color)
47-
# if s.ratio() > highest_ratio:
48-
# highest_ratio = s.ratio()
49-
# _color = color
50-
# if highest_ratio > 0.8:
51-
# return _color
52-
# else:
53-
# return None
54-
32+
class EnclosureControlSkill(OVOSSkill):
33+
def __init__(self, *args, **kwargs):
34+
super().__init__(*args, **kwargs)
35+
self.handle_default_eyes()
36+
self.thread = None
37+
self.playing = False
38+
self.animations = []
5539

5640
class EnclosureControlSkill(OVOSSkill):
5741
def __init__(self, *args, **kwargs):
5842
super().__init__(*args, **kwargs)
5943
self.thread = None
6044
self.playing = False
6145
self.animations = []
62-
# self.brightness_dict = self.translate_namedvalues('brightness.levels')
63-
# self.color_dict = self.translate_namedvalues('colors')
6446
self.add_event('mycroft.eyes.default', self.handle_default_eyes)
6547
self.add_event('mycroft.ready', self.handle_default_eyes)
6648

@@ -358,7 +340,6 @@ def handle_eye_color(self, message):
358340
self.get_response('color.need'))
359341
if color_str:
360342
match = color_from_description(color_str)
361-
# match = fuzzy_match_color(normalize(color_str), self.color_dict)
362343
if match is not None:
363344
default = False
364345
if self.ask_yesno('set.default.eye.color') == 'yes':
@@ -405,7 +386,6 @@ def _parse_to_rgb(self, color):
405386
return _hex_to_rgb(color)
406387

407388
def handle_default_eyes(self):
408-
LOG.info(self.settings.get('default_eye_color', "NONE"))
409389
if self.settings.get('default_eye_color'):
410390
self.set_eye_color(rgb=self.settings['default_eye_color'], speak=False)
411391

@@ -435,11 +415,6 @@ def parse_brightness(self, brightness):
435415
"""
436416

437417
try:
438-
# Handle "full", etc.
439-
name = normalize(brightness)
440-
# if name in self.brightness_dict:
441-
# return self.brightness_dict[name]
442-
443418
if '%' in brightness:
444419
brightness = brightness.replace("%", "").strip()
445420
return int(brightness)

locale/en-us/brightness.levels.value

Lines changed: 0 additions & 10 deletions
This file was deleted.

locale/en-us/colors.value

Lines changed: 0 additions & 149 deletions
This file was deleted.

0 commit comments

Comments
 (0)