diff --git a/css/devices.css b/css/devices.css index 78e15f9a2..cd754600a 100644 --- a/css/devices.css +++ b/css/devices.css @@ -111,6 +111,11 @@ background-image: url(../cms/scenes/styles/switch/i_rozetka_on.png); } +.controller.loadtype_power .device-icon.on { + background-color:yellow; + background-image: url(../cms/scenes/styles/switch/i_rozetka_on.png); +} + .controller .device-icon.on { background-color:yellow; background-image: url(../cms/scenes/styles/switch/i_light_on.png); diff --git a/lib/OpenWeather/OpenWeather.php b/lib/OpenWeather/OpenWeather.php deleted file mode 100755 index 84e63c326..000000000 --- a/lib/OpenWeather/OpenWeather.php +++ /dev/null @@ -1,279 +0,0 @@ -', '<#LANG_NNE#>', '<#LANG_NE#>', '<#LANG_ENE#>', '<#LANG_E#>', '<#LANG_ESE#>', '<#LANG_SE#>', '<#LANG_SSE#>', '<#LANG_S#>', '<#LANG_SSW#>', '<#LANG_SW#>', '<#LANG_WSW#>', '<#LANG_W#>', '<#LANG_WNW#>', '<#LANG_NW#>', '<#LANG_NNW#>', '<#LANG_N#>']; - - return $windDirection[round($degree / 22.5)]; - } - - /** - * Check units for weather. If unit unknown or incorrect then units = metric - * @param $vUnits - * @return - */ - private static function GetUnits - ($vUnits) - { - $units = "metric"; - - if (!isset($vUnits)) return $units; - - if ($vUnits === "imperial") - return $vUnits; - - return $units; - } - - /** - * Convert Pressure from one system to another. - * If error or system not found then function return current pressure. - * @param $vPressure - * @param $vFrom - * @param $vTo - * @param $vPrecision - * @return - */ - public static function ConvertPressure($vPressure, $vFrom, $vTo, $vPrecision = 2) - { - if (empty($vFrom) || empty($vTo) || empty($vPressure)) - return $vPressure; - - if (!is_numeric($vPressure)) - return $vPressure; - - $vPressure = (float) $vPressure; - $vFrom = strtolower($vFrom); - $vTo = strtolower($vTo); - - if ($vFrom == "hpa" && $vTo == "mmhg") - return round($vPressure * 0.75006375541921, $vPrecision); - - if ($vFrom == "mmhg" && $vTo == "hpa") - return round($vPressure * 1.33322, $vPrecision); - - return $vPressure; - } - - /** - * Get url to weather's image by icon - * @param $vImageIcon - * @return - */ - private static function GetWeatherImage($vImageIcon) - { - if (!isset($vImageIcon)) return; - - $imageUtl = "http://openweathermap.org/img/w/" . $vImageIcon . ".png"; - - return $imageUtl; - } - - /** - * Get html weather widget with current wheather for page - * @param $vCountry CountryCode - * @param $vCity CityName - * @param $vUnits Units - * @return - */ - public static function GetCurrentWeatherWidget - ($vCountry, - $vCity, - $vUnits) - { - $vUnits = OpenWeather::GetUnits($vUnits); - $weather = OpenWeather::GetJsonWeatherDataByCityName($vCountry,$vCity,$vUnits); - - $widget = "
" . $weather->weather[0]->description . "
"; - - $lm_date = date("D M j G:i:s T Y", $weather->dt); - - $widget .= ""; - $widget .= "
<#LANG_WIND#> | "; - $widget .= "<#LANG_SPEED#> " . $weather->wind->speed . "<#LANG_M_S#> " . OpenWeather::GetWindDirection($weather->wind->deg) . "(" . $weather->wind->deg . "°) | ";
- $widget .= "
<#LANG_PRESSURE#> | " . $pressure . " |
<#LANG_HUMIDITY#> | ". $weather->main->humidity . "% |
" . $weather->weather[0]->description . "
"; - - $lm_date = date("D M j G:i:s T Y", $weather->dt); - - $widget .= ""; - $widget .= "
<#LANG_WIND#> | "; - $widget .= "<#LANG_SPEED#> " . $weather->wind->speed . "<#LANG_M_S#> " . OpenWeather::GetWindDirection($weather->wind->deg) . "(" . $weather->wind->deg . "°) | ";
- $widget .= "
<#LANG_PRESSURE#> | " . $pressure . " |
<#LANG_HUMIDITY#> | ". $weather->main->humidity . "% |