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 = "
"; - - if ($weather->cod == "404") - { - $widget .= "" . $weather->message . ""; - } - else - { - $widget .= "

" . $weather->name . ", " . $weather->sys->country . "

"; - $widget .= "

"; - $widget .= " weather[0]->icon) . "\" />"; - $widget .= round($weather->main->temp, 2); - $widget .= $vUnits == "metric" ? " °C" : " °F"; - $widget .= "

"; - $widget .= "

" . $weather->weather[0]->description . "

"; - - $lm_date = date("D M j G:i:s T Y", $weather->dt); - - $widget .= "
<#LANG_GET_AT#> " . $lm_date . "
"; - $widget .= "

 

"; - $widget .= ""; - $widget .= " "; - $widget .= " "; - $widget .= " "; - $widget .= " "; - $widget .= " "; - - $pressure = $vUnits == "metric" ? OpenWeather::ConvertPressure($weather->main->pressure, "hpa", "mmhg") . "<#LANG_MMHG#>": $weather->main->pressure . "<#LANG_HPA#>"; - - $widget .= " "; - $widget .= " "; - $widget .= " "; - $widget .= "
<#LANG_WIND#><#LANG_SPEED#> " . $weather->wind->speed . "<#LANG_M_S#>
" . OpenWeather::GetWindDirection($weather->wind->deg) . "(" . $weather->wind->deg . "°)
<#LANG_PRESSURE#>" . $pressure . "
<#LANG_HUMIDITY#>". $weather->main->humidity . "%
"; - } - - $widget .= "
"; - - return $widget; - } - - /** - * Get html weather widget with current wheather for page - * @param $vCityID CityID - * @param $vUnits Units - * @return - */ - public static function GetCurrentWeatherWidgetByCityID - ($vCityID, - $vUnits) - { - $vUnits = OpenWeather::GetUnits($vUnits); - $weather = OpenWeather::GetJsonWeatherDataByCityID($vCityID,$vUnits); - - $widget = "
"; - - if ($weather->cod == "404") - { - $widget .= "" . $weather->message . ""; - } - else - { - $widget .= "

" . $weather->name . ", " . $weather->sys->country . "

"; - $widget .= "

"; - $widget .= " weather[0]->icon) . "\" />"; - $widget .= $weather->main->temp; - $widget .= $vUnits == "metric" ? " °C" : " °F"; - $widget .= "

"; - $widget .= "

" . $weather->weather[0]->description . "

"; - - $lm_date = date("D M j G:i:s T Y", $weather->dt); - - $widget .= "
<#LANG_GET_AT#> " . $lm_date . "
"; - $widget .= "

 

"; - $widget .= ""; - $widget .= " "; - $widget .= " "; - $widget .= " "; - $widget .= " "; - $widget .= " "; - - $pressure = $vUnits == "metric" ? OpenWeather::ConvertPressure($weather->main->pressure, "hpa", "mmhg") . "<#LANG_MMHG#>": $weather->main->pressure . "<#LANG_HPA#>"; - - $widget .= " "; - $widget .= " "; - $widget .= " "; - $widget .= "
<#LANG_WIND#><#LANG_SPEED#> " . $weather->wind->speed . "<#LANG_M_S#>
" . OpenWeather::GetWindDirection($weather->wind->deg) . "(" . $weather->wind->deg . "°)
<#LANG_PRESSURE#>" . $pressure . "
<#LANG_HUMIDITY#>". $weather->main->humidity . "%
"; - } - - $widget .= "
"; - - return $widget; - } - - /** - * GetWeather data from openweathermap.org by Country and City - * @param $vCountry - * @param $vCity - * @param $vUnits - * @return - */ - public static function GetWeather - ($vCountry, - $vCity, - $vUnits) - { - $vUnits = OpenWeather::GetUnits($vUnits); - $weather = OpenWeather::GetJsonWeatherDataByCityName($vCountry,$vCity,$vUnits); - - return $weather; - } - - /** - * Return weather by City ID - * @param $vCityID CityID - * @param $vUnits Unit(metric/imperial) - * @return - */ - public static function GetWeatherByCityID - ($vCityID, - $vUnits) - { - $weather = OpenWeather::GetJsonWeatherDataByCityID($vCityID,$vUnits); - return $weather; - } -}