@@ -2,10 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace JarvisPHP\Plugins\RaspPIVolume_plugin; |
4 | 4 | |
5 | -use JarvisPHP\Core\JarvisSession; |
|
6 | 5 | use JarvisPHP\Core\JarvisPHP; |
7 | 6 | use JarvisPHP\Core\JarvisLanguage; |
8 | -use JarvisPHP\Core\JarvisTTS; |
|
9 | 7 | |
10 | 8 | /** |
11 | 9 | * RaspberryPI Volume Control Plugin |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | * @website http://www.stefanobianchini.net |
14 | 14 | * Bash script from http://www.dronkert.net/rpi/vol.html |
15 | 15 | */ |
16 | -class RaspPIVolume_plugin implements \JarvisPHP\Core\JarvisPluginInterface{ |
|
16 | +class RaspPIVolume_plugin implements \JarvisPHP\Core\JarvisPluginInterface { |
|
17 | 17 | /** |
18 | 18 | * Priority of plugin |
19 | 19 | * @var int |
@@ -27,20 +27,20 @@ discard block |
||
27 | 27 | function answer($command) { |
28 | 28 | $answer = ''; |
29 | 29 | |
30 | - if(preg_match(JarvisLanguage::translate('preg_match_mute',get_called_class()), $command)) { |
|
30 | + if (preg_match(JarvisLanguage::translate('preg_match_mute', get_called_class()), $command)) { |
|
31 | 31 | //Mute command |
32 | 32 | exec(_JARVISPHP_ROOT_PATH.'/Plugins/RaspPIVolume_plugin/vol.sh 0'); |
33 | - } else if(preg_match(JarvisLanguage::translate('preg_match_unmute',get_called_class()), $command)) { |
|
33 | + } else if (preg_match(JarvisLanguage::translate('preg_match_unmute', get_called_class()), $command)) { |
|
34 | 34 | //Unmute command |
35 | 35 | exec(_JARVISPHP_ROOT_PATH.'/Plugins/RaspPIVolume_plugin/vol.sh 65'); |
36 | - } else if(preg_match(JarvisLanguage::translate('preg_match_volume_up',get_called_class()), $command)) { |
|
36 | + } else if (preg_match(JarvisLanguage::translate('preg_match_volume_up', get_called_class()), $command)) { |
|
37 | 37 | //Volume up command |
38 | 38 | exec(_JARVISPHP_ROOT_PATH.'/Plugins/RaspPIVolume_plugin/vol.sh +'); |
39 | - } else if(preg_match(JarvisLanguage::translate('preg_match_volume_down',get_called_class()), $command)) { |
|
39 | + } else if (preg_match(JarvisLanguage::translate('preg_match_volume_down', get_called_class()), $command)) { |
|
40 | 40 | //Volume down |
41 | 41 | exec(_JARVISPHP_ROOT_PATH.'/Plugins/RaspPIVolume_plugin/vol.sh -'); |
42 | 42 | } |
43 | - $answer = JarvisLanguage::translate('command_executed',get_called_class()); |
|
43 | + $answer = JarvisLanguage::translate('command_executed', get_called_class()); |
|
44 | 44 | $response = new \JarvisPHP\Core\JarvisResponse($answer, JarvisPHP::getRealClassName(get_called_class()), true); |
45 | 45 | $response->send(); |
46 | 46 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @return boolean |
59 | 59 | */ |
60 | 60 | function isLikely($command) { |
61 | - return preg_match(JarvisLanguage::translate('preg_match_activate_plugin',get_called_class()), $command); |
|
61 | + return preg_match(JarvisLanguage::translate('preg_match_activate_plugin', get_called_class()), $command); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace JarvisPHP\Plugins\Wemo_plugin; |
4 | 4 | |
5 | -use JarvisPHP\Core\JarvisSession; |
|
6 | 5 | use JarvisPHP\Core\JarvisPHP; |
7 | 6 | use JarvisPHP\Core\JarvisLanguage; |
8 | 7 | use JarvisPHP\Core\JarvisTTS; |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @author Stefano Bianchini |
13 | 13 | * @website http://www.stefanobianchini.net |
14 | 14 | */ |
15 | -class Wemo_plugin implements \JarvisPHP\Core\JarvisPluginInterface{ |
|
15 | +class Wemo_plugin implements \JarvisPHP\Core\JarvisPluginInterface { |
|
16 | 16 | /** |
17 | 17 | * Priority of plugin |
18 | 18 | * @var int |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $_IFTTT_MAKER_EVENT = ''; |
32 | 32 | |
33 | 33 | //Load API key from json config |
34 | - if(file_exists('Plugins/Wemo_plugin/api-key.json')) { |
|
34 | + if (file_exists('Plugins/Wemo_plugin/api-key.json')) { |
|
35 | 35 | //Create your own api key and put it in api-key.json |
36 | 36 | $json_config = json_decode(file_get_contents('Plugins/Wemo_plugin/api-key.json')); |
37 | 37 | $_IFTTT_MAKER_KEY = $json_config->ifttt_key; |
@@ -60,12 +60,12 @@ discard block |
||
60 | 60 | curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); |
61 | 61 | $result = curl_exec($ch); |
62 | 62 | |
63 | - if(!$result) { |
|
63 | + if (!$result) { |
|
64 | 64 | JarvisPHP::getLogger()->error('Curl error: '.curl_error($ch)); |
65 | - $answer = JarvisLanguage::translate('command_not_sent',get_called_class()); |
|
65 | + $answer = JarvisLanguage::translate('command_not_sent', get_called_class()); |
|
66 | 66 | } |
67 | 67 | else { |
68 | - $answer = JarvisLanguage::translate('command_sent_to_light_switch',get_called_class()); |
|
68 | + $answer = JarvisLanguage::translate('command_sent_to_light_switch', get_called_class()); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | curl_close($ch); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * @return boolean |
90 | 90 | */ |
91 | 91 | function isLikely($command) { |
92 | - return preg_match(JarvisLanguage::translate('preg_match_activate_plugin',get_called_class()), $command); |
|
92 | + return preg_match(JarvisLanguage::translate('preg_match_activate_plugin', get_called_class()), $command); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | use JarvisPHP\TelegramBot\GenericCurl; |
6 | 6 | |
7 | 7 | //Very important! |
8 | -define('_JARVISPHP_URL','http://localhost:8000'); |
|
8 | +define('_JARVISPHP_URL', 'http://localhost:8000'); |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * A TelegramBot for JarvisPHP |
@@ -23,14 +23,14 @@ discard block |
||
23 | 23 | echo "JarvisPHP Telegram Bot started at ".date('Y-m-d H:i:s')."\n"; |
24 | 24 | echo "-----------------------------------------------------\n"; |
25 | 25 | |
26 | - while(true) { |
|
26 | + while (true) { |
|
27 | 27 | |
28 | 28 | $updates = $bot->apiRequestJson("getUpdates", array('offset'=>$offset)); |
29 | 29 | |
30 | - if($updates) { |
|
31 | - foreach($updates as $update) { |
|
30 | + if ($updates) { |
|
31 | + foreach ($updates as $update) { |
|
32 | 32 | |
33 | - if(isset($update->message->text)) { |
|
33 | + if (isset($update->message->text)) { |
|
34 | 34 | |
35 | 35 | //TODO check if $update->message->chat->id is in enabled list |
36 | 36 | |
@@ -40,28 +40,28 @@ discard block |
||
40 | 40 | |
41 | 41 | $message = $update->message->text; |
42 | 42 | |
43 | - $offset = $update->update_id + 1; |
|
43 | + $offset = $update->update_id+1; |
|
44 | 44 | |
45 | 45 | $response = ''; |
46 | 46 | |
47 | 47 | //Understand if the message is a telegram command (begins with "/") |
48 | - if(preg_match('$^/(.+)$', $message)) { |
|
48 | + if (preg_match('$^/(.+)$', $message)) { |
|
49 | 49 | |
50 | 50 | //Telegram command |
51 | - switch($message) { |
|
52 | - case '/start': $response='I am JarvisPHP, a private bot. \u1F510'; break; |
|
53 | - case '/info': $response='I am JarvisPHP, a private bot. \u1F510'; break; |
|
51 | + switch ($message) { |
|
52 | + case '/start': $response = 'I am JarvisPHP, a private bot. \u1F510'; break; |
|
53 | + case '/info': $response = 'I am JarvisPHP, a private bot. \u1F510'; break; |
|
54 | 54 | case '/register': |
55 | - $response='Ok, i registered your ID in registerIdLog.log'; |
|
56 | - file_put_contents('TelegramBot/registerIdLog.log', '['.date('Y-m-d H:i:s').'] ID:'.$update->message->from->id . '; FIRSTNAME:'. $update->message->from->first_name . '; LASTNAME:'. $update->message->from->last_name. '; USERNAME:'. $update->message->from->username.PHP_EOL , FILE_APPEND | LOCK_EX); |
|
55 | + $response = 'Ok, i registered your ID in registerIdLog.log'; |
|
56 | + file_put_contents('TelegramBot/registerIdLog.log', '['.date('Y-m-d H:i:s').'] ID:'.$update->message->from->id.'; FIRSTNAME:'.$update->message->from->first_name.'; LASTNAME:'.$update->message->from->last_name.'; USERNAME:'.$update->message->from->username.PHP_EOL, FILE_APPEND | LOCK_EX); |
|
57 | 57 | break; |
58 | - case '/say': $response='Use /say "sentence" (without quotes) to make JarvisPHP speak a sentence.'; break; |
|
58 | + case '/say': $response = 'Use /say "sentence" (without quotes) to make JarvisPHP speak a sentence.'; break; |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | //"Say" Telegram command |
62 | - if(preg_match('$^/say (.+)$', $message, $matches)) { |
|
63 | - if($matches) { |
|
64 | - if(in_array($update->message->chat->id, $allowedClientIdList)) { |
|
62 | + if (preg_match('$^/say (.+)$', $message, $matches)) { |
|
63 | + if ($matches) { |
|
64 | + if (in_array($update->message->chat->id, $allowedClientIdList)) { |
|
65 | 65 | //Redirect message to JarvisPhp |
66 | 66 | $JarvisResponse = GenericCurl::exec(_JARVISPHP_URL.'/answer', array('sentence'=>$matches[0])); |
67 | 67 | |
@@ -73,12 +73,12 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | //Encode emoji |
76 | - $response = preg_replace_callback('/\\\\u([0-9a-fA-F]+)/', function ($match) { |
|
76 | + $response = preg_replace_callback('/\\\\u([0-9a-fA-F]+)/', function($match) { |
|
77 | 77 | return iconv('UCS-4LE', 'UTF-8', pack('V', hexdec($match[1]))); |
78 | 78 | }, $response); |
79 | 79 | |
80 | 80 | } else { |
81 | - if(in_array($update->message->chat->id, $allowedClientIdList)) { |
|
81 | + if (in_array($update->message->chat->id, $allowedClientIdList)) { |
|
82 | 82 | //Redirect message to JarvisPhp |
83 | 83 | $JarvisResponse = GenericCurl::exec(_JARVISPHP_URL.'/answer', array('command'=>$message, 'tts' => 'None_tts')); |
84 | 84 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | } |
91 | - if($response) { |
|
91 | + if ($response) { |
|
92 | 92 | $bot->apiRequestJson("sendMessage", array('chat_id' => $update->message->chat->id, "text" => $response)); |
93 | 93 | } |
94 | 94 | } |
@@ -62,7 +62,7 @@ |
||
62 | 62 | |
63 | 63 | $_BOT_TOKEN = ''; |
64 | 64 | //Load API key from json config |
65 | - if(file_exists('TelegramBot/api-key.json')) { |
|
65 | + if (file_exists('TelegramBot/api-key.json')) { |
|
66 | 66 | //Create your own bot token and put it in api-key.json |
67 | 67 | // like {"bot_token": "<your-bot-token>"} |
68 | 68 | $json_config = json_decode(file_get_contents('TelegramBot/api-key.json')); |
@@ -13,8 +13,8 @@ discard block |
||
13 | 13 | |
14 | 14 | $fields_string = ""; |
15 | 15 | //url-ify the data for the POST |
16 | - if(count($fields)>0) { |
|
17 | - foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } |
|
16 | + if (count($fields) > 0) { |
|
17 | + foreach ($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } |
|
18 | 18 | rtrim($fields_string, '&'); |
19 | 19 | } |
20 | 20 | |
@@ -23,11 +23,11 @@ discard block |
||
23 | 23 | $ch = curl_init(); |
24 | 24 | |
25 | 25 | //set the url, number of POST vars, POST data |
26 | - curl_setopt($ch,CURLOPT_URL, $url); |
|
27 | - curl_setopt($ch,CURLOPT_POST, count($fields)); |
|
28 | - curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string); |
|
26 | + curl_setopt($ch, CURLOPT_URL, $url); |
|
27 | + curl_setopt($ch, CURLOPT_POST, count($fields)); |
|
28 | + curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); |
|
29 | 29 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
30 | - curl_setopt ($ch, CURLOPT_COOKIEFILE, "TelegramBot/JarvisPHPSession.cookie"); |
|
30 | + curl_setopt($ch, CURLOPT_COOKIEFILE, "TelegramBot/JarvisPHPSession.cookie"); |
|
31 | 31 | curl_setopt($ch, CURLOPT_COOKIEJAR, "TelegramBot/JarvisPHPSession.cookie"); |
32 | 32 | |
33 | 33 | //execute post |
@@ -40,6 +40,6 @@ discard block |
||
40 | 40 | |
41 | 41 | |
42 | 42 | |
43 | - return ($http_response_code==200) ? json_decode($result) : false; |
|
43 | + return ($http_response_code == 200) ? json_decode($result) : false; |
|
44 | 44 | } |
45 | 45 | } |
46 | 46 | \ No newline at end of file |
@@ -5,10 +5,10 @@ |
||
5 | 5 | * m1, m2, ... m8 male voices |
6 | 6 | * f1, f2, f3, f4 female voices |
7 | 7 | */ |
8 | -define('_ESPEAK_VOICE','m2'); |
|
8 | +define('_ESPEAK_VOICE', 'm2'); |
|
9 | 9 | |
10 | 10 | //Language of text-to-speech |
11 | 11 | define('_ESPEAK_LANGUAGE', _LANGUAGE); |
12 | 12 | |
13 | 13 | //Amplitude (espeak -a <amplitude>) |
14 | -define('_ESPEAK_AMPLITUDE','100'); |
|
15 | 14 | \ No newline at end of file |
15 | +define('_ESPEAK_AMPLITUDE', '100'); |
|
16 | 16 | \ No newline at end of file |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | */ |
5 | 5 | |
6 | 6 | //Set locale |
7 | -define('_LANGUAGE','en'); |
|
7 | +define('_LANGUAGE', 'en'); |
|
8 | 8 | |
9 | 9 | //Command session timeout, in seconds |
10 | 10 | define('_COMMAND_SESSION_TIMEOUT', 30); |
@@ -13,4 +13,4 @@ discard block |
||
13 | 13 | define('_JARVIS_TTS', 'None_tts'); |
14 | 14 | |
15 | 15 | //Define system's name |
16 | -define('_SYSTEM_NAME','JarvisPhp'); |
|
17 | 16 | \ No newline at end of file |
17 | +define('_SYSTEM_NAME', 'JarvisPhp'); |
|
18 | 18 | \ No newline at end of file |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @author Stefano Bianchini |
13 | 13 | * @website http://www.stefanobianchini.net |
14 | 14 | */ |
15 | -class Info_plugin implements \JarvisPHP\Core\JarvisPluginInterface{ |
|
15 | +class Info_plugin implements \JarvisPHP\Core\JarvisPluginInterface { |
|
16 | 16 | /** |
17 | 17 | * Priority of plugin |
18 | 18 | * @var int |
@@ -25,15 +25,15 @@ discard block |
||
25 | 25 | */ |
26 | 26 | function answer($command) { |
27 | 27 | $answer = ''; |
28 | - if(preg_match(JarvisLanguage::translate('preg_match_tell_more',get_called_class()), $command)) { |
|
28 | + if (preg_match(JarvisLanguage::translate('preg_match_tell_more', get_called_class()), $command)) { |
|
29 | 29 | //Testing session |
30 | 30 | JarvisPHP::getLogger()->debug('User says: '.$command); |
31 | - $answer = 'Ok, i am on '. php_uname(); |
|
31 | + $answer = 'Ok, i am on '.php_uname(); |
|
32 | 32 | JarvisSession::terminate(); |
33 | 33 | } |
34 | 34 | else { |
35 | 35 | JarvisPHP::getLogger()->debug('Answering to command: "'.$command.'"'); |
36 | - $answer = sprintf(JarvisLanguage::translate('my_name_is',get_called_class()),_SYSTEM_NAME, $_SERVER['SERVER_NAME'],$_SERVER['SERVER_ADDR']); |
|
36 | + $answer = sprintf(JarvisLanguage::translate('my_name_is', get_called_class()), _SYSTEM_NAME, $_SERVER['SERVER_NAME'], $_SERVER['SERVER_ADDR']); |
|
37 | 37 | |
38 | 38 | } |
39 | 39 | JarvisTTS::speak($answer); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * @return boolean |
55 | 55 | */ |
56 | 56 | function isLikely($command) { |
57 | - return preg_match(JarvisLanguage::translate('preg_match_activate_plugin',get_called_class()), $command); |
|
57 | + return preg_match(JarvisLanguage::translate('preg_match_activate_plugin', get_called_class()), $command); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * @author Stefano Bianchini |
16 | 16 | * @website http://www.stefanobianchini.net |
17 | 17 | */ |
18 | -class Weather_plugin implements \JarvisPHP\Core\JarvisPluginInterface{ |
|
18 | +class Weather_plugin implements \JarvisPHP\Core\JarvisPluginInterface { |
|
19 | 19 | /** |
20 | 20 | * Priority of plugin |
21 | 21 | * @var int |
@@ -38,40 +38,40 @@ discard block |
||
38 | 38 | $_OPENWEATHERMAP_API_KEY = ''; |
39 | 39 | |
40 | 40 | //Load API key from json config |
41 | - if(file_exists('Plugins/Weather_plugin/api-key.json')) { |
|
41 | + if (file_exists('Plugins/Weather_plugin/api-key.json')) { |
|
42 | 42 | //Create your own api key and put it in api-key.json |
43 | 43 | $json_config = json_decode(file_get_contents('Plugins/Weather_plugin/api-key.json')); |
44 | 44 | $_OPENWEATHERMAP_API_KEY = $json_config->openweathermap_key; |
45 | 45 | } |
46 | 46 | |
47 | 47 | try { |
48 | - $forecast = $owm->getWeatherForecast('Rimini', 'metric', _LANGUAGE, $_OPENWEATHERMAP_API_KEY,2); |
|
49 | - } catch(OWMException $e) { |
|
50 | - JarvisPHP::getLogger()->error('OpenWeatherMap exception: ' . $e->getMessage() . ' (Code ' . $e->getCode() . ').'); |
|
51 | - $answer = JarvisLanguage::translate('weather_error',get_called_class()); |
|
52 | - } catch(\Exception $e) { |
|
53 | - JarvisPHP::getLogger()->error('General exception: ' . $e->getMessage() . ' (Code ' . $e->getCode() . ').'); |
|
54 | - $answer = JarvisLanguage::translate('weather_error',get_called_class()); |
|
48 | + $forecast = $owm->getWeatherForecast('Rimini', 'metric', _LANGUAGE, $_OPENWEATHERMAP_API_KEY, 2); |
|
49 | + } catch (OWMException $e) { |
|
50 | + JarvisPHP::getLogger()->error('OpenWeatherMap exception: '.$e->getMessage().' (Code '.$e->getCode().').'); |
|
51 | + $answer = JarvisLanguage::translate('weather_error', get_called_class()); |
|
52 | + } catch (\Exception $e) { |
|
53 | + JarvisPHP::getLogger()->error('General exception: '.$e->getMessage().' (Code '.$e->getCode().').'); |
|
54 | + $answer = JarvisLanguage::translate('weather_error', get_called_class()); |
|
55 | 55 | } |
56 | 56 | |
57 | - if(preg_match(JarvisLanguage::translate('preg_match_today',get_called_class()), $command)) { |
|
58 | - $answer = JarvisLanguage::translate('forecast_for_today',get_called_class()); |
|
57 | + if (preg_match(JarvisLanguage::translate('preg_match_today', get_called_class()), $command)) { |
|
58 | + $answer = JarvisLanguage::translate('forecast_for_today', get_called_class()); |
|
59 | 59 | foreach ($forecast as $weather) { |
60 | - if($weather->time->day->format('d.m.Y')==date('d.m.Y')) { |
|
61 | - $answer.=JarvisLanguage::translate('from',get_called_class()) . " " .$weather->time->from->format('H:i') . " ". JarvisLanguage::translate('to',get_called_class()) . " " . $weather->time->to->format('H:i').": "; |
|
62 | - $answer.=$weather->weather->description." ".sprintf(JarvisLanguage::translate('temperature',get_called_class()),trim(str_replace('°C','',$weather->temperature))); |
|
60 | + if ($weather->time->day->format('d.m.Y') == date('d.m.Y')) { |
|
61 | + $answer .= JarvisLanguage::translate('from', get_called_class())." ".$weather->time->from->format('H:i')." ".JarvisLanguage::translate('to', get_called_class())." ".$weather->time->to->format('H:i').": "; |
|
62 | + $answer .= $weather->weather->description." ".sprintf(JarvisLanguage::translate('temperature', get_called_class()), trim(str_replace('°C', '', $weather->temperature))); |
|
63 | 63 | } |
64 | 64 | } |
65 | - } else if(preg_match(JarvisLanguage::translate('preg_match_tomorrow',get_called_class()), $command)) { |
|
66 | - $answer = JarvisLanguage::translate('forecast_for_tomorrow',get_called_class()); |
|
65 | + } else if (preg_match(JarvisLanguage::translate('preg_match_tomorrow', get_called_class()), $command)) { |
|
66 | + $answer = JarvisLanguage::translate('forecast_for_tomorrow', get_called_class()); |
|
67 | 67 | foreach ($forecast as $weather) { |
68 | - if($weather->time->day->format('d.m.Y')==$tomorrow->format('d.m.Y')) { |
|
69 | - $answer.=JarvisLanguage::translate('from',get_called_class()) . " " .$weather->time->from->format('H:i') . " ". JarvisLanguage::translate('to',get_called_class()) . " " . $weather->time->to->format('H:i').": "; |
|
70 | - $answer.=$weather->weather->description." ".sprintf(JarvisLanguage::translate('temperature',get_called_class()),trim(str_replace('°C','',$weather->temperature))); |
|
68 | + if ($weather->time->day->format('d.m.Y') == $tomorrow->format('d.m.Y')) { |
|
69 | + $answer .= JarvisLanguage::translate('from', get_called_class())." ".$weather->time->from->format('H:i')." ".JarvisLanguage::translate('to', get_called_class())." ".$weather->time->to->format('H:i').": "; |
|
70 | + $answer .= $weather->weather->description." ".sprintf(JarvisLanguage::translate('temperature', get_called_class()), trim(str_replace('°C', '', $weather->temperature))); |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 | } else { |
74 | - $answer = JarvisLanguage::translate('not_understand_weather_day',get_called_class()); |
|
74 | + $answer = JarvisLanguage::translate('not_understand_weather_day', get_called_class()); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @return boolean |
96 | 96 | */ |
97 | 97 | function isLikely($command) { |
98 | - return preg_match(JarvisLanguage::translate('preg_match_activate_plugin',get_called_class()), $command); |
|
98 | + return preg_match(JarvisLanguage::translate('preg_match_activate_plugin', get_called_class()), $command); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace JarvisPHP\Plugins\Wemo_plugin; |
4 | 4 | |
5 | -use JarvisPHP\Core\JarvisSession; |
|
6 | 5 | use JarvisPHP\Core\JarvisPHP; |
7 | 6 | use JarvisPHP\Core\JarvisLanguage; |
8 | 7 | use JarvisPHP\Core\JarvisTTS; |