Alarm inital copy from Timer, Inital Phone skill, readme updates
parent
df6f072158
commit
5329e0af72
@ -0,0 +1,39 @@
|
|||||||
|
import requests
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
from skill import Skill
|
||||||
|
from config import ntfy_url
|
||||||
|
else:
|
||||||
|
from skills.skill import Skill
|
||||||
|
from skills.config import ntfy_url
|
||||||
|
|
||||||
|
|
||||||
|
class Phone(Skill):
|
||||||
|
def __init__(self):
|
||||||
|
self.trigger_phrase = "phone"
|
||||||
|
|
||||||
|
def _send_to_phone(self, name, number):
|
||||||
|
r = requests.post(f"https://ntfy.sh/{ntfy_url}",
|
||||||
|
data=f" ",
|
||||||
|
headers={
|
||||||
|
"Title": f"Phone {name}",
|
||||||
|
"Priority": "default",
|
||||||
|
"Tags": "iphone",
|
||||||
|
"Click": f"tel://{number}"
|
||||||
|
})
|
||||||
|
return r
|
||||||
|
|
||||||
|
def parse_phone_string(self, text):
|
||||||
|
return ["name", "111-222-3333"]
|
||||||
|
#Todo: parse out phone number from icloud contacts (maybe google contacts? depending on where its stored)
|
||||||
|
|
||||||
|
|
||||||
|
def phone_call(self, text):
|
||||||
|
parsed_output = self.parse_phone_string(text)
|
||||||
|
self._send_to_phone(parsed_output[0], parsed_output[1])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
p = Phone()
|
||||||
|
p._send_to_phone("Trav", "4169074987")
|
Loading…
Reference in New Issue