Permalink
Browse files

trying out2

test
  • Loading branch information...
1 parent 21802f3 commit e7b0387f1e4e046fdf2eab3c6d9653675177a412 @marksev1 committed Sep 7, 2016
@@ -25,29 +25,28 @@
from mycroft.util.log import getLogger
from najdisi_sms import SMSSender
-__author__ = 'jdorleans,msev'
+__author__ = 'jdorleans'
LOGGER = getLogger(__name__)
class SendSMSSkill(MycroftSkill):
- #DBUS_CMD = ["dbus-send", "--print-reply",
- #"--dest=com.canonical.TelephonyServiceHandler",
- #"/com/canonical/TelephonyServiceHandler",
- #"com.canonical.TelephonyServiceHandler.SendMessage"]
+ DBUS_CMD = ["dbus-send", "--print-reply",
+ "--dest=com.canonical.TelephonyServiceHandler",
+ "/com/canonical/TelephonyServiceHandler",
+ "com.canonical.TelephonyServiceHandler.SendMessage"]
def __init__(self):
super(SendSMSSkill, self).__init__(name="SendSMSSkill")
- self.contacts = {'son': '04111111', 'dad': '041222222',
+ self.contacts = {'marko': '041111111', 'dad': '041111111',
'mom': '34567890'} # TODO - Use API
def initialize(self):
self.load_vocab_files(join(dirname(__file__), 'vocab', self.lang))
self.load_regex_files(join(dirname(__file__), 'regex', self.lang))
- intent = IntentBuilder("SendSMSIntent").require(
- "SendSMSKeyword").require("Contact").require("Message").build()
+ intent = IntentBuilder("SendSMSIntent").require("SendSMSKeyword").build()
self.register_intent(intent, self.handle_intent)
- sms = SMSSender('user', 'password')
+ sms = SMSSender('msev', 'password')
def handle_intent(self, message):
try:
@@ -62,12 +61,12 @@ def handle_intent(self, message):
except Exception as e:
LOGGER.error("Error: {0}".format(e))
- #def __send_sms(self, number, msg):
- #cmd = list(self.DBUS_CMD)
- #cmd.append("array:string:" + number)
- #cmd.append("string:" + msg)
- #cmd.append("string:ofono/ofono/account0")
- #subprocess.call(cmd)
+ def __send_sms(self, number, msg):
+ cmd = list(self.DBUS_CMD)
+ cmd.append("array:string:" + number)
+ cmd.append("string:" + msg)
+ cmd.append("string:ofono/ofono/account0")
+ subprocess.call(cmd)
def __notify(self, contact, number, msg):
self.emitter.emit(
@@ -1 +1 @@
-(tell|text|message) (?P<Contact>\w*) (?P<Message>.*)
+(text|message) (?P<Contact>\w*) (?P<Message>.*)
@@ -1 +1 @@
-(tell|text|message)
+(text|message)
@@ -0,0 +1,7 @@
+{
+ "utterance": "text marko I'm home",
+ "intent_type": "SendSMSIntent",
+ "intent": {
+ "SendSMSKeyword": "text"
+ }
+}
@@ -0,0 +1,7 @@
+{
+ "utterance": "message marko I'm home",
+ "intent_type": "SendSMSIntent",
+ "intent": {
+ "SendSMSKeyword": "message"
+ }
+}
@@ -1,3 +1,2 @@
-tell
text
message

0 comments on commit e7b0387

Please sign in to comment.