[1.0.1] Bugfixing
This commit is contained in:
parent
c1151f6e6c
commit
6dbc675a8b
@ -29,5 +29,21 @@ namespace BlubbFish.Iot.Snips.Intents {
|
||||
this.espid = t.Key;
|
||||
}
|
||||
}
|
||||
|
||||
protected String GetSpeakName(String name) {
|
||||
String ort = name.Substring(8);
|
||||
switch(ort) {
|
||||
case "Bad":
|
||||
case "Dach":
|
||||
return "im " + ort;
|
||||
case "Arbeit":
|
||||
return "im " + ort + "szimmer";
|
||||
case "Wohn":
|
||||
return "im " + ort + "zimmer";
|
||||
case "Kueche":
|
||||
return "in der Küche";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,26 +21,32 @@ namespace BlubbFish.Iot.Snips.Intents {
|
||||
}
|
||||
}
|
||||
|
||||
protected void SnipsSay(String text) => ((ADataBackend)this.snips).Send("hermes/tts/say",
|
||||
JsonMapper.ToJson(
|
||||
new Dictionary<String, Object> {
|
||||
{ "id",this.data["id"].ToString() },
|
||||
{ "lang","de" },
|
||||
{ "sessionId", this.data["sessionId"].ToString() },
|
||||
{ "siteId","default" },
|
||||
{ "text",text }
|
||||
}
|
||||
)
|
||||
);
|
||||
protected void SnipsSay(String text) {
|
||||
((ADataBackend)this.snips).Send("hermes/tts/say",
|
||||
JsonMapper.ToJson(
|
||||
new Dictionary<String, Object> {
|
||||
{ "id",this.data["id"].ToString() },
|
||||
{ "lang","de" },
|
||||
{ "sessionId", this.data["sessionId"].ToString() },
|
||||
{ "siteId","default" },
|
||||
{ "text",text }
|
||||
}
|
||||
)
|
||||
);
|
||||
Console.WriteLine("TTS: " + text);
|
||||
}
|
||||
|
||||
protected void SnipsEndSpeak() => ((ADataBackend)this.snips).Send("hermes/tts/sayFinished",
|
||||
JsonMapper.ToJson(
|
||||
new Dictionary<String, Object> {
|
||||
{ "id", this.data["id"].ToString() },
|
||||
{ "sessionId", this.data["sessionId"].ToString() }
|
||||
}
|
||||
)
|
||||
);
|
||||
protected void SnipsEndSpeak() {
|
||||
((ADataBackend)this.snips).Send("hermes/tts/sayFinished",
|
||||
JsonMapper.ToJson(
|
||||
new Dictionary<String, Object> {
|
||||
{ "id", this.data["id"].ToString() },
|
||||
{ "sessionId", this.data["sessionId"].ToString() }
|
||||
}
|
||||
)
|
||||
);
|
||||
Console.WriteLine("say Finished");
|
||||
}
|
||||
|
||||
public abstract void Parse();
|
||||
|
||||
|
@ -11,7 +11,7 @@ namespace BlubbFish.Iot.Snips.Intents {
|
||||
|
||||
public override void Answer() {
|
||||
if(this.espid != null) {
|
||||
this.SnipsSay("Die Luftfeuchtigkeit beträgt " + this.esps[this.espid].Humidity + " Prozent relative Luftfeuchtigkeit im " + this.slots["ort"] + " !");
|
||||
this.SnipsSay("Die Luftfeuchtigkeit beträgt " + Math.Round(this.esps[this.espid].Humidity, 1) + " Prozent relative Luftfeuchtigkeit " + this.GetSpeakName(this.espid) + "!");
|
||||
} else {
|
||||
this.SnipsSay("Ich habe bisher keine Sensordaten erhalten!");
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ namespace BlubbFish.Iot.Snips.Intents {
|
||||
|
||||
public override void Answer() {
|
||||
if(this.espid != null) {
|
||||
this.SnipsSay("Im " + this.slots["ort"] + " ist es " + this.esps[this.espid].Temperature + " Grad "+this.slots["feel"]+"!");
|
||||
this.SnipsSay(this.GetSpeakName(this.espid) + " ist es " + Math.Round(this.esps[this.espid].Temperature,1) + " Grad "+this.slots["feel"]+"!");
|
||||
} else {
|
||||
this.SnipsSay("Ich habe bisher keine Sensordaten erhalten!");
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ namespace BlubbFish.Iot.Snips.Intents {
|
||||
}
|
||||
if(html != null) {
|
||||
String file = null;
|
||||
MatchCollection m = new Regex("\"(.*VHDL13_DWEH_([0-9]{6}).*)\"").Matches(html);
|
||||
MatchCollection m = new Regex("\"(.*VHDL13_DWEH_[0-9]{6}.*([0-9]{10}).*)\"").Matches(html);
|
||||
if(m.Count > 1) {
|
||||
Int32 d = Int32.Parse(m[0].Groups[2].Value);
|
||||
file = m[0].Groups[1].Value;
|
||||
|
@ -33,9 +33,10 @@ using System.Runtime.InteropServices;
|
||||
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
||||
// übernehmen, indem Sie "*" eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0")]
|
||||
[assembly: AssemblyVersion("1.0.1")]
|
||||
[assembly: AssemblyFileVersion("1.0.1")]
|
||||
|
||||
/*
|
||||
* 1.0.0 First Version
|
||||
* 1.0.1 Bugfixing
|
||||
*/
|
||||
|
@ -31,8 +31,10 @@ namespace BlubbFish.Iot.Snips {
|
||||
intent = new Wetter(data, this.sources["snips"]);
|
||||
}
|
||||
if(intent != null) {
|
||||
Console.WriteLine("Intent Start " + data["intent"]["intentName"].ToString());
|
||||
intent.Parse();
|
||||
intent.Answer();
|
||||
Console.WriteLine("Intent Finished!");
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user