[1.0.1] Bugfixing

This commit is contained in:
BlubbFish 2019-06-02 18:25:58 +02:00
parent c1151f6e6c
commit 6dbc675a8b
7 changed files with 49 additions and 24 deletions

View File

@ -29,5 +29,21 @@ namespace BlubbFish.Iot.Snips.Intents {
this.espid = t.Key; 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 "";
}
} }
} }

View File

@ -21,26 +21,32 @@ namespace BlubbFish.Iot.Snips.Intents {
} }
} }
protected void SnipsSay(String text) => ((ADataBackend)this.snips).Send("hermes/tts/say", protected void SnipsSay(String text) {
JsonMapper.ToJson( ((ADataBackend)this.snips).Send("hermes/tts/say",
new Dictionary<String, Object> { JsonMapper.ToJson(
{ "id",this.data["id"].ToString() }, new Dictionary<String, Object> {
{ "lang","de" }, { "id",this.data["id"].ToString() },
{ "sessionId", this.data["sessionId"].ToString() }, { "lang","de" },
{ "siteId","default" }, { "sessionId", this.data["sessionId"].ToString() },
{ "text",text } { "siteId","default" },
} { "text",text }
) }
); )
);
Console.WriteLine("TTS: " + text);
}
protected void SnipsEndSpeak() => ((ADataBackend)this.snips).Send("hermes/tts/sayFinished", protected void SnipsEndSpeak() {
JsonMapper.ToJson( ((ADataBackend)this.snips).Send("hermes/tts/sayFinished",
new Dictionary<String, Object> { JsonMapper.ToJson(
{ "id", this.data["id"].ToString() }, new Dictionary<String, Object> {
{ "sessionId", this.data["sessionId"].ToString() } { "id", this.data["id"].ToString() },
} { "sessionId", this.data["sessionId"].ToString() }
) }
); )
);
Console.WriteLine("say Finished");
}
public abstract void Parse(); public abstract void Parse();

View File

@ -11,7 +11,7 @@ namespace BlubbFish.Iot.Snips.Intents {
public override void Answer() { public override void Answer() {
if(this.espid != null) { 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 { } else {
this.SnipsSay("Ich habe bisher keine Sensordaten erhalten!"); this.SnipsSay("Ich habe bisher keine Sensordaten erhalten!");
} }

View File

@ -11,7 +11,7 @@ namespace BlubbFish.Iot.Snips.Intents {
public override void Answer() { public override void Answer() {
if(this.espid != null) { 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 { } else {
this.SnipsSay("Ich habe bisher keine Sensordaten erhalten!"); this.SnipsSay("Ich habe bisher keine Sensordaten erhalten!");
} }

View File

@ -31,7 +31,7 @@ namespace BlubbFish.Iot.Snips.Intents {
} }
if(html != null) { if(html != null) {
String file = 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) { if(m.Count > 1) {
Int32 d = Int32.Parse(m[0].Groups[2].Value); Int32 d = Int32.Parse(m[0].Groups[2].Value);
file = m[0].Groups[1].Value; file = m[0].Groups[1].Value;

View File

@ -33,9 +33,10 @@ using System.Runtime.InteropServices;
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// übernehmen, indem Sie "*" eingeben: // übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0")] [assembly: AssemblyVersion("1.0.1")]
[assembly: AssemblyFileVersion("1.0.0")] [assembly: AssemblyFileVersion("1.0.1")]
/* /*
* 1.0.0 First Version * 1.0.0 First Version
* 1.0.1 Bugfixing
*/ */

View File

@ -31,8 +31,10 @@ namespace BlubbFish.Iot.Snips {
intent = new Wetter(data, this.sources["snips"]); intent = new Wetter(data, this.sources["snips"]);
} }
if(intent != null) { if(intent != null) {
Console.WriteLine("Intent Start " + data["intent"]["intentName"].ToString());
intent.Parse(); intent.Parse();
intent.Answer(); intent.Answer();
Console.WriteLine("Intent Finished!");
} }
} catch { } } catch { }
} }