diff --git a/jarvis/skills/daily/timer/__init__.py b/jarvis/skills/daily/timer/__init__.py index 84040cb..d5d1e9c 100644 --- a/jarvis/skills/daily/timer/__init__.py +++ b/jarvis/skills/daily/timer/__init__.py @@ -9,17 +9,21 @@ class TimerSkill(Skill, metaclass=SkillRegistering): def __init__(self, data=dict): super().__init__("TimerSkill", data) + def register(self): + super(TimerSkill, self).register() + + @intent_file_handler("start_timer.intent", "StartTimerIntent") def handle_start_timer(self, data): print(data) - if 'amount' in data and 'time_unit' in data: - print(extract_duration(data['amount'] + " " + data['time_unit']), languages_utils.get_language()) + if 'duration' in data: + print(extract_duration(data['duration']), languages_utils.get_language()) if 'name' in data: - print("Start timer for {} {} named {}".format(data['amount'], data['time_unit'], data['name'])) + print("Start timer for {} named {}".format(data['duration'], data['name'])) pass else: - print("Start timer for {} {} without name".format(data['amount'], data['time_unit'])) + print("Start timer for {} without name".format(data['duration'])) # TODO : ask for name pass else: diff --git a/jarvis/skills/daily/timer/vocab/fr-fr/start_timer.intent b/jarvis/skills/daily/timer/vocab/fr-fr/start_timer.intent index 9cb99f1..54c6e38 100644 --- a/jarvis/skills/daily/timer/vocab/fr-fr/start_timer.intent +++ b/jarvis/skills/daily/timer/vocab/fr-fr/start_timer.intent @@ -1,2 +1,2 @@ -(Mets|Lance|Démarre) un (minuteur|timer) (de|pour dans|pour) {amount} {time_unit} -(Mets|Lance|Démarre) un (minuteur|timer) (de|pour dans|pour) {amount} {time_unit} (nommé|appelé|qui s'appelle|et appelle le) {name} \ No newline at end of file +(Mets|Lance|Démarre) un (minuteur|timer) (de|pour dans|pour) {duration} +(Mets|Lance|Démarre) un (minuteur|timer) (de|pour dans|pour) {duration} (nommé|appelé|qui s'appelle|et appelle le) {name} \ No newline at end of file diff --git a/jarvis/skills/daily/timer/vocab/fr-fr/time_unit.entity b/jarvis/skills/daily/timer/vocab/fr-fr/time_unit.entity deleted file mode 100644 index 79f7934..0000000 --- a/jarvis/skills/daily/timer/vocab/fr-fr/time_unit.entity +++ /dev/null @@ -1,10 +0,0 @@ -seconde -secondes -minute -minutes -heure -heures -quart d'heure -quart-heure -demi heure -demi-heure \ No newline at end of file