Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
domotikad
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
domotika
domotikad
Commits
985745de
Commit
985745de
authored
Mar 02, 2016
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sync with github
parent
65853bc0
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
33 additions
and
12 deletions
+33
-12
README.md
README.md
+4
-4
domotika.js
Web/htdocs/gui/js/domotika.js
+2
-1
0d149b90e7394297301c90191ae775f0.cache
...translations/cache/0d149b90e7394297301c90191ae775f0.cache
+1
-1
domotika_internal.dialplan
asterisk/utils/defaults/domotika_internal.dialplan
+3
-0
domotika_out.dialplan
asterisk/utils/defaults/domotika_out.dialplan
+3
-0
fastagi.py
domotika/asterisk/fastagi.py
+9
-2
tts.py
domotika/clouds/google/tts.py
+4
-2
dmdb.py
domotika/db/dmdb.py
+4
-0
domotika.py
domotika/domotika.py
+1
-1
text2audio
scripts/text2audio
+2
-1
No files found.
README.md
View file @
985745de
domotikad
domotikad
=========
=========
Domotika
home automation system controller daemon
Domotika
d developement has moved to https://git.nexlab.net/nexlab/domotikad
Donations are accepted in Bitcoins to 1GpZkuwMEXno7jW19oqoaraVoVS6VBCvX5
To change git origin:
*
git remote rm origin
*
git remote add origin https://git.nexlab.net/nexlab/domotikad.git
[
Screenshots of the webgui
](
http://www.unixmedia.it/en/interfaccia-utente
)
[
![piwik tracking
](
https://webstats.unixmedia.it/piwik.php?idsite=2&rec=1&action_name=GitHubDomotikad
"unixmedia.it"
)
](http://www.unixmedia.it)
Web/htdocs/gui/js/domotika.js
View file @
985745de
...
@@ -194,7 +194,8 @@
...
@@ -194,7 +194,8 @@
audio
.
setAttribute
(
'id'
,
'playTTS_audio'
);
audio
.
setAttribute
(
'id'
,
'playTTS_audio'
);
}
}
// XXX BUG: webkit based browsers seems to not work with https:// in <audio>, so, we fix this to http
// XXX BUG: webkit based browsers seems to not work with https:// in <audio>, so, we fix this to http
audio
.
setAttribute
(
'src'
,
'http://translate.google.com/translate_tts?tl='
+
lang
+
'&q='
+
encodeURIComponent
(
text
));
//audio.setAttribute('src', 'http://translate.google.com/translate_tts?tl='+lang+'&q=' + encodeURIComponent(text));
audio
.
setAttribute
(
'src'
,
'http://code.responsivevoice.org/getvoice.php?tl='
+
lang
+
'&t='
+
encodeURIComponent
(
text
));
audio
.
load
();
audio
.
load
();
audio
.
play
();
audio
.
play
();
return
audio
;
return
audio
;
...
...
Web/htdocs/gui/translations/cache/0d149b90e7394297301c90191ae775f0.cache
View file @
985745de
a:2:{s:9:"timestamp";i:1395332244;s:12:"translations";a:18:{s:4:"home";s:4:"home";s:5:"blind";s:10:"tapparelle";s:8:"cancello";s:8:"cancelli";s:5:"clima";s:5:"clima";s:4:"door";s:5:"porte";s:3:"led";s:3:"led";s:5:"light";s:4:"luci";s:7:"scenari";s:7:"scenari";s:6:"socket";s:5:"prese";s:6:"valvle";s:7:"valvole";s:6:"sensor";s:7:"sensori";s:6:"camera";s:10:"telecamere";s:6:"window";s:8:"finestre";s:4:"user";s:4:"user";s:4:"none";s:15:"Nessuna Sezione";s:5:"phone";s:8:"telefono";s:5:"index";s:4:"Home";s:4:"gate";s:8:"cancelli";}}
a:2:{s:9:"timestamp";i:1441816319;s:12:"translations";a:18:{s:4:"home";s:4:"home";s:5:"blind";s:10:"tapparelle";s:8:"cancello";s:8:"cancelli";s:5:"clima";s:5:"clima";s:4:"door";s:5:"porte";s:3:"led";s:3:"led";s:5:"light";s:4:"luci";s:7:"scenari";s:7:"scenari";s:6:"socket";s:5:"prese";s:6:"valvle";s:7:"valvole";s:6:"sensor";s:7:"sensori";s:6:"camera";s:10:"telecamere";s:6:"window";s:8:"finestre";s:4:"user";s:4:"user";s:4:"none";s:26:"verifica_comandi_controlli";s:5:"phone";s:8:"telefono";s:5:"index";s:4:"Home";s:4:"gate";s:8:"cancelli";}}
\ No newline at end of file
\ No newline at end of file
asterisk/utils/defaults/domotika_internal.dialplan
View file @
985745de
...
@@ -31,3 +31,6 @@ exten => _[a-z].,1,AGI(agi://${AGIHOST}:${AGIPORT}/internal)
...
@@ -31,3 +31,6 @@ exten => _[a-z].,1,AGI(agi://${AGIHOST}:${AGIPORT}/internal)
exten => _[a-z].,n,Goto(domotika_out,${EXTEN},1)
exten => _[a-z].,n,Goto(domotika_out,${EXTEN},1)
exten => _[A-Z].,1,AGI(agi://${AGIHOST}:${AGIPORT}/internal)
exten => _[A-Z].,1,AGI(agi://${AGIHOST}:${AGIPORT}/internal)
exten => _[A-Z].,n,Goto(domotika_out,${EXTEN},1)
exten => _[A-Z].,n,Goto(domotika_out,${EXTEN},1)
exten => _+.,1,AGI(agi://${AGIHOST}:${AGIPORT}/internal)
exten => _+.,n,Goto(domotika_out,${EXTEN},1)
asterisk/utils/defaults/domotika_out.dialplan
View file @
985745de
...
@@ -27,3 +27,6 @@ exten => _[a-z].,1,Dial(SIP/pstn/${EXTEN},,r)
...
@@ -27,3 +27,6 @@ exten => _[a-z].,1,Dial(SIP/pstn/${EXTEN},,r)
exten => _[a-z].,n,Hangup()
exten => _[a-z].,n,Hangup()
exten => _X.,1,Dial(SIP/pstn/${EXTEN},,r)
exten => _X.,1,Dial(SIP/pstn/${EXTEN},,r)
exten => _X.,n,Hangup()
exten => _X.,n,Hangup()
exten => _+39.,1,Dial(SIP/pstn/${EXTEN:3},,r)
exten => _+39.,n,Hangup()
domotika/asterisk/fastagi.py
View file @
985745de
...
@@ -28,7 +28,10 @@ from twisted.protocols import basic
...
@@ -28,7 +28,10 @@ from twisted.protocols import basic
import
socket
,
logging
,
time
import
socket
,
logging
,
time
from
starpy
import
error
,
fastagi
from
starpy
import
error
,
fastagi
import
os
,
logging
,
time
,
sys
import
os
,
logging
,
time
,
sys
from
domotika.clouds.google
import
tts
,
speech
#from domotika.clouds.google import tts, speech
from
domotika.clouds.google
import
tts
as
googletts
from
domotika.clouds.google
import
speech
from
domotika.clouds.responsivevoice
import
tts
import
tempfile
import
tempfile
from
txscheduling.cron
import
CronSchedule
,
parseCronLine
from
txscheduling.cron
import
CronSchedule
,
parseCronLine
from
dmlib.utils
import
genutils
from
dmlib.utils
import
genutils
...
@@ -290,6 +293,10 @@ class DMSayText(BaseCheck):
...
@@ -290,6 +293,10 @@ class DMSayText(BaseCheck):
return
self
.
play
(
saytext
,
replay
,
return
self
.
play
(
saytext
,
replay
,
"."
.
join
(
playfile
.
split
(
"."
)[:
-
1
]),
"."
.
join
(
playfile
.
split
(
"."
)[
-
1
:]))
"."
.
join
(
playfile
.
split
(
"."
)[:
-
1
]),
"."
.
join
(
playfile
.
split
(
"."
)[
-
1
:]))
if
engine
==
'google'
:
if
engine
==
'google'
:
gtts
=
googletts
.
TTS
(
saytext
,
tlang
)
playfile
=
tempfile
.
mktemp
(
prefix
=
"googletts-"
,
suffix
=
".sln"
)
return
gtts
.
convertAudioFile
(
fdst
=
playfile
)
.
addCallback
(
_converted
,
playfile
)
elif
engine
==
"responsivevoice"
:
gtts
=
tts
.
TTS
(
saytext
,
tlang
)
gtts
=
tts
.
TTS
(
saytext
,
tlang
)
playfile
=
tempfile
.
mktemp
(
prefix
=
"googletts-"
,
suffix
=
".sln"
)
playfile
=
tempfile
.
mktemp
(
prefix
=
"googletts-"
,
suffix
=
".sln"
)
return
gtts
.
convertAudioFile
(
fdst
=
playfile
)
.
addCallback
(
_converted
,
playfile
)
return
gtts
.
convertAudioFile
(
fdst
=
playfile
)
.
addCallback
(
_converted
,
playfile
)
...
...
domotika/clouds/google/tts.py
View file @
985745de
...
@@ -29,7 +29,7 @@ from twisted.internet import defer
...
@@ -29,7 +29,7 @@ from twisted.internet import defer
from
twisted.internet
import
utils
as
twutils
from
twisted.internet
import
utils
as
twutils
import
os
import
os
TTSURI
=
"http://translate.google.com/translate_tts"
TTSURI
=
"http
s
://translate.google.com/translate_tts"
def
getSampleRate
(
fname
):
def
getSampleRate
(
fname
):
ext
=
fname
.
split
(
"."
)[
-
1
:]
ext
=
fname
.
split
(
"."
)[
-
1
:]
...
@@ -42,13 +42,14 @@ def getSampleRate(fname):
...
@@ -42,13 +42,14 @@ def getSampleRate(fname):
class
TTS
(
object
):
class
TTS
(
object
):
agent
=
"Mozilla/5.0 (X11; Linux
; rv:8.0) Gecko/20100101
"
agent
=
"Mozilla/5.0 (X11; Linux
x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.6 Safari/537.36
"
def
__init__
(
self
,
text
,
lang
=
"it"
):
def
__init__
(
self
,
text
,
lang
=
"it"
):
self
.
text
=
urllib
.
quote
(
text
.
encode
(
'utf8'
,
'ignore'
))
self
.
text
=
urllib
.
quote
(
text
.
encode
(
'utf8'
,
'ignore'
))
self
.
audiourl
=
TTSURI
+
"?tl="
+
lang
+
"&q="
+
self
.
text
self
.
audiourl
=
TTSURI
+
"?tl="
+
lang
+
"&q="
+
self
.
text
def
getAudio
(
self
):
def
getAudio
(
self
):
print
"get"
,
self
.
audiourl
return
web
.
getPage
(
self
.
audiourl
,
agent
=
self
.
agent
)
return
web
.
getPage
(
self
.
audiourl
,
agent
=
self
.
agent
)
def
saveAudioFile
(
self
,
nfile
=
False
,
raw
=
True
):
def
saveAudioFile
(
self
,
nfile
=
False
,
raw
=
True
):
...
@@ -56,6 +57,7 @@ class TTS(object):
...
@@ -56,6 +57,7 @@ class TTS(object):
nfile
=
tempfile
.
mktemp
(
prefix
=
"googletts-"
,
suffix
=
".mp3"
)
nfile
=
tempfile
.
mktemp
(
prefix
=
"googletts-"
,
suffix
=
".mp3"
)
def
saveFile
(
fcont
):
def
saveFile
(
fcont
):
print
"tornato"
f
=
open
(
nfile
,
"w"
)
f
=
open
(
nfile
,
"w"
)
f
.
write
(
fcont
)
f
.
write
(
fcont
)
f
.
close
()
f
.
close
()
...
...
domotika/db/dmdb.py
View file @
985745de
...
@@ -792,6 +792,10 @@ def initializeAutoDetection():
...
@@ -792,6 +792,10 @@ def initializeAutoDetection():
def
checkSpeechActions
(
speech
):
def
checkSpeechActions
(
speech
):
return
SpeechActions
.
find
(
where
=
[
'speech_string=? AND active>0'
,
speech
])
return
SpeechActions
.
find
(
where
=
[
'speech_string=? AND active>0'
,
speech
])
def
getOtherSpeech
(
speech
):
s
=
speech
.
replace
(
" "
,
"
%
"
)
+
"
%
"
def
insertNotify
(
source
,
user
,
msg
,
expire
=
0
):
def
insertNotify
(
source
,
user
,
msg
,
expire
=
0
):
n
=
Notifications
()
n
=
Notifications
()
n
.
source
=
source
n
.
source
=
source
...
...
domotika/domotika.py
View file @
985745de
...
@@ -1326,7 +1326,7 @@ class domotikaService(service.Service):
...
@@ -1326,7 +1326,7 @@ class domotikaService(service.Service):
if
(
len
(
command
)
>
1
):
if
(
len
(
command
)
>
1
):
opts
=
command
[
1
]
opts
=
command
[
1
]
for
opt
in
opts
.
split
(
','
):
for
opt
in
opts
.
split
(
','
):
optp
=
opt
.
split
(
'='
)
[
0
]
optp
=
opt
.
split
(
'='
)
if
len
(
optp
)
>
1
and
optp
[
0
]
in
topt
.
keys
():
if
len
(
optp
)
>
1
and
optp
[
0
]
in
topt
.
keys
():
optk
=
optp
[
0
]
optk
=
optp
[
0
]
optv
=
optp
[
1
]
optv
=
optp
[
1
]
...
...
scripts/text2audio
View file @
985745de
...
@@ -15,4 +15,5 @@ if [ "$2" != "en" ] && [ "$2" != "it" ] ; then
...
@@ -15,4 +15,5 @@ if [ "$2" != "en" ] && [ "$2" != "it" ] ; then
phelp
phelp
fi
fi
python
`
dirname
$0
`
/../domotika/clouds/google/tts.py
$1
$2
"
${
3
}
"
#python `dirname $0`/../domotika/clouds/google/tts.py $1 $2 "${3}"
python
`
dirname
$0
`
/../domotika/clouds/responsivevoice/tts.py
$1
$2
"
${
3
}
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment