# -*- coding: utf-8 -*- import Action_Base import datetime @Action_Base.Snips("Device_Wie_geht_es_dir","deviceHowAreYou") class Action_Device_Wie_geht_es_dir(Action_Base.Action_Base): def beforeGetMessage(self,intent_message): if intent_message is not None: self.common.modState("angry", -40) self.common.modState("happyness", 20) self.common.modState("depresive", -55) return True def getMessage(self, intent_message): if intent_message is not None: if intent_message.slots.Beleidigung != None and len(intent_message.slots.Beleidigung)>0: bel = str(intent_message.slots.Beleidigung.first().value) print("Device Stats:") print(" angry: "+str(self.common.deviceStats.angry)) print(" happyness: "+str(self.common.deviceStats.happyness)) print(" depressive: "+str(self.common.deviceStats.depressive)) print(" lonely: "+str(self.common.deviceStats.lonely)) print(" temperature: "+str(self.common.deviceStats.temperature)) print("House Stats:") if self.common.HM is not None: print(" Homematic: "+str(self.common.HM.bConnected==True)) print(" Homematic Url: "+self.common.HM.url) else: print(" Homematic: None") print(" Homematic Url: -") print(" temp_avg: "+str(self.common.houseStats.temp_avg)) print(" temp_coldest: "+str(self.common.houseStats.temp_coldest)) print(" temp_hottest: "+str(self.common.houseStats.temp_hottest)) print(" windowOpen: "+str(self.common.houseStats.windowOpen)) print(" lightOn: "+str(self.common.houseStats.lightOn)) print(" atHome: "+str(self.common.houseStats.atHome)) print(" sleeping: "+str(self.common.houseStats.sleeping)) print("Outdoor Stats:") print(" temperature: "+str(self.common.outdoorStats.temperature)) print(" windy: "+str(self.common.outdoorStats.windy)) print(" pressure: "+str(self.common.outdoorStats.pressure)) print(" humidity: "+str(self.common.outdoorStats.humidity)) print(" windSpeed: "+str(self.common.outdoorStats.windSpeed)) print(" windDegree: "+str(self.common.outdoorStats.windDegree)) print(" clouds: "+str(self.common.outdoorStats.clouds)) print(" raining: "+str(self.common.outdoorStats.raining)) print(" snowing: "+str(self.common.outdoorStats.snowing)) if self.common.deviceStats.lastTalk == None: prin(" lastTalk: None") else: print(" lastTalk: "+self.common.deviceStats.lastTalk.strftime("%d.%m.%Y - %H:%M:%S")) return self.getMoodMessage()