Skip to content

Commit

Permalink
- added forecast info to Weather Underground widget
Browse files Browse the repository at this point in the history
- deprecated homegenie.appcache
(sf.net r473)
  • Loading branch information
genemars committed Jan 30, 2015
1 parent 0eeb3b3 commit 7bb1b8f
Show file tree
Hide file tree
Showing 16 changed files with 180 additions and 1,078 deletions.
3 changes: 0 additions & 3 deletions BaseFiles/Common/Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,6 @@
<None Include="programs\133.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="html\homegenie.appcache">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="html\index.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
Binary file modified BaseFiles/Common/homegenie_factory_config.zip
Binary file not shown.
961 changes: 0 additions & 961 deletions BaseFiles/Common/html/homegenie.appcache

This file was deleted.

1 change: 0 additions & 1 deletion BaseFiles/Common/html/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!DOCTYPE html>
<html manifest="homegenie.appcache">
<head>
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
Expand Down
6 changes: 1 addition & 5 deletions BaseFiles/Common/html/js/api/homegenie.webapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ HG.WebApp.InitializePage = function ()
//
$.mobile.ajaxFormsEnabled = false;
$.ajaxSetup({
cache: false //,
//contentType: 'application/x-www-form-urlencoded; charset=ISO-8859-1',
//beforeSend: function(jqXHR) {
// jqXHR.overrideMimeType('application/x-www-form-urlencoded; charset=ISO-8859-1');
//}
cache: false
});
//
HG.Configure.LoadData();
Expand Down
4 changes: 2 additions & 2 deletions BaseFiles/Common/html/pages/configure/groups/listmodules.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<input id="groupmodules_groupname" type="text" />
</li>
</ul>
<p>
<div style="margin-top:16px">
<ul id="page_configure_groupmodules_list" data-role="listview"></ul>
</p>
</div>
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions BaseFiles/Common/html/pages/configure/maintenance/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ <h1 data-locale-id="configure_system_serviceportheading">Http Service Port</h1>
<div class="ui-content" class="ui-corner-bottom ui-content">
<h3 data-locale-id="configure_system_serviceportchangenote" class="ui-title">Note: after changing port HomeGenie must be restarted to make changes effective!</h3>
<p>
<label for="http_service_port" />
<label for="http_service_port"></label>
<input id="http_service_port" type="number" />
</p>
<div class="ui-grid-a">
Expand All @@ -263,7 +263,7 @@ <h1 data-locale-id="securitysettings_password_setpassword">Set password</h1>
<div class="ui-content" class="ui-corner-bottom ui-content">
<p data-locale-id="securitysettings_password_enterpassword">Enter password for 'admin' user</p>
<p>
<label for="securitysettings_user_password" />
<label for="securitysettings_user_password"></label>
<input id="securitysettings_user_password" type="password" />
</p>
<div class="ui-grid-a">
Expand Down
1 change: 1 addition & 0 deletions BaseFiles/Common/html/pages/control/_control.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ HG.WebApp.Control.RenderModule = function () {
HG.WebApp.GroupModules.ShowModuleOptions(HG.WebApp.GroupModules.CurrentModule.Domain, HG.WebApp.GroupModules.CurrentModule.Address);
});
} catch (e) {
console.log('ERROR in Widget RenderView: ' + e);
//alert(rendermodule.Module.Widget + " Widget RenderView Error:\n" + e);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,68 @@
<div data-ui-field="widget" class="ui-overlay-shadow ui-corner-all ui-body-inherit hg-widget-b" style="min-height:175px">
<div data-ui-field="widget" class="ui-overlay-shadow ui-corner-all ui-body-inherit hg-widget-b" style="min-height:175px;min-width:420px">
<div class="ui-header ui-bar-inherit" style="padding-left:5px;padding-right:5px;font-weight:normal;">
<div style="font-weight:bold">Weather Underground</div>
<div data-ui-field="name">Waiting for data...</div>
<div data-ui-field="last_updated_value">Waiting for data...</div>
<a data-ui-field="settings" data-role="button" data-icon="edit" data-iconshadow="false" data-direction="reverse" data-iconpos="notext" class="ui-btn-right">Configuration</a>
</div>
<div align="left">
<img data-ui-field="icon" style="margin-left:10px;margin-right:10px;height:64px;float: left" src="pages/control/widgets/jkUtils/OpenWeatherMap/images/icons/10d.png" />
<div style="float: left;margin-top:5px">
<div data-ui-field="description" style="font-size:18pt;">Possible showers</div>
<div style="font-size:10pt;height:28px">Updated: <span data-ui-field="last_updated_value">Not updated!</span></div>
</div>
<br clear="all" />
<table width="100%"><tr>
<td width="46">
<img data-ui-field="icon" class="ui-corner-all ui-overlay-shadow" src="http://icons.wxug.com/i/c/e/partlysunny.gif" style="margin-top:3px;margin-left:10px;margin-right:5px" />
</td>
<td>
<div data-ui-field="name" style="font-size:11pt;">Not updated!</div>
<div data-ui-field="description" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;width:200px;font-size:14pt;">Possible showers</div>
</td>
<td align="center" style="font-size:10pt" valign="top">
&#9728;&uarr; <span data-ui-field="sunrise_value">05:55</span>
&#9728;&darr; <span data-ui-field="sunset_value">18:20</span>
<br />
<span class="hg-indicator-temperature" style="padding-left:0;width:20px;vertical-align:top">&nbsp;</span>
<span data-ui-field="temperature_value" style="line-height:28px;text-align:bottom;font-size:22pt">22.5</span>
</td>
</tr></table>
</div>
<div align="center" style="font-size:10pt;padding-right:20px;">
<div style="margin:2px;height:28px;display: inline-block;">
<div align="right" style="padding:4px;height:28px;text-align:bottom;width:50px;float:left">
<img data-ui-field="temperature_image" alt="Temperature" src="pages/control/widgets/homegenie/generic/images/temperature.png" height="32" align="center" style="vertical-align:bottom" />
</div>
<div align="left" style="width:80px;padding:4px;float:left;">
<font data-ui-field="temperature_value" style="line-height:28px;text-align:bottom;font-size:22pt">22.5</font>
</div>
</div>
<div style="margin:2px;height:28px;display: inline-block;">
<div align="right" style="padding:4px;line-height:28px;text-align:bottom;width:50px;float:left">
<b>Sunrise</b>
</div>
<div align="left" style="width:60px;padding:4px;float:left;">
<font data-ui-field="sunrise_value" style="line-height:28px;text-align:bottom;font-size:22pt">05:55</font>
</div>
</div>
<div style="margin:2px;height:28px;display: inline-block;">
<div align="right" style="padding:4px;height:28px;line-height:28px;text-align:bottom;width:50px;float:left">
<b>Sunset</b>
</div>
<div align="left" style="width:60px;padding:4px;float:left;">
<font data-ui-field="sunset_value" style="line-height:28px;text-align:bottom;font-size:22pt">18:25</font>
</div>
</div>

<div style="font-size:10pt;margin-left:10px;">

<table width="100%">
<tr>
<td colspan="2" data-ui-field="forecast_1_date">Sat, 31 January</td>
<td colspan="2" data-ui-field="forecast_2_date">Sun, 1 February</td>
<td colspan="2" data-ui-field="forecast_3_date">Mon, 2 February</td>
</tr>
<tr>
<td align="left" width="46">
<img data-ui-field="forecast_1_icon" class="ui-corner-all ui-overlay-shadow" src="http://icons.wxug.com/i/c/e/flurries.gif" />
</td>
<td align="left" valign="top">
<div style="font-size:8pt;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;width:80px">
&#x25BC; <span data-ui-field="forecast_1_tmin">8.2℃</span><br>
&#x25B2; <span data-ui-field="forecast_1_tmax">12.1℃</span><br>
<span data-ui-field="forecast_1_desc">Partly cloudy</span>
</div>
</td>
<td align="left" width="46">
<img data-ui-field="forecast_2_icon" class="ui-corner-all ui-overlay-shadow" src="http://icons.wxug.com/i/c/e/sunny.gif" />
</td>
<td align="left" valign="top">
<div style="font-size:8pt;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;width:80px">
&#x25BC; <span data-ui-field="forecast_2_tmin">4.0℃</span><br>
&#x25B2; <span data-ui-field="forecast_2_tmax">10.5℃</span><br>
<span data-ui-field="forecast_2_desc">Chance of rain</span>
</div>
</td>
<td align="left" width="46">
<img data-ui-field="forecast_3_icon" class="ui-corner-all ui-overlay-shadow" src="http://icons.wxug.com/i/c/e/tstorms.gif" />
</td>
<td align="left" valign="top">
<div style="font-size:8pt;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:80px">
&#x25BC; <span data-ui-field="forecast_3_tmin">6.7℃</span><br>
&#x25B2; <span data-ui-field="forecast_3_tmax">16.2℃</span><br>
<span data-ui-field="forecast_3_desc">Clear</span>
</div>
</td>
</tr>
</table>

</div>
<br clear="all" />
</div>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[{
Name: "HomeSeer HSM100 Widget",
Author: "Generoso Martello",
Version: "2013-03-31",
Name: 'Weather Underground Widget',
Author: 'Generoso Martello',
Version: '2013-03-31',

GroupName: '',
IconImage: 'http://icons-ak.wxug.com/graphics/wu2/logo_130x80.png',
Expand All @@ -22,8 +22,8 @@
});
}
//
var display_location = HG.WebApp.Utility.GetModulePropertyByName(module, "Conditions.DisplayLocation").Value;
var serviceapi = HG.WebApp.Utility.GetModulePropertyByName(module, "ConfigureOptions.ApiKey").Value;
var display_location = HG.WebApp.Utility.GetModulePropertyByName(module, 'Conditions.DisplayLocation').Value;
var serviceapi = HG.WebApp.Utility.GetModulePropertyByName(module, 'ConfigureOptions.ApiKey').Value;
if (serviceapi == '' || serviceapi == '?') {
widget.find('[data-ui-field=name]').html('Not configured.');
widget.find('[data-ui-field=sunrise_value]').html(sunrise);
Expand All @@ -45,37 +45,60 @@
position: { my: 'top center', at: 'bottom center' }
});
}
else if (display_location == "") {
else if (display_location == '') {
widget.find('[data-ui-field=name]').html('Waiting for data...');
widget.find('[data-ui-field=last_updated_value]').html('Not updated!');
}
else {
widget.find('[data-ui-field=name]').html(display_location);
//
var sunrise = HG.WebApp.Utility.GetModulePropertyByName(module, "Astronomy.Sunrise").Value;
var sunrise = HG.WebApp.Utility.GetModulePropertyByName(module, 'Astronomy.Sunrise').Value;
widget.find('[data-ui-field=sunrise_value]').html(sunrise);
//
var sunset = HG.WebApp.Utility.GetModulePropertyByName(module, "Astronomy.Sunset").Value;
var sunset = HG.WebApp.Utility.GetModulePropertyByName(module, 'Astronomy.Sunset').Value;
widget.find('[data-ui-field=sunset_value]').html(sunset);
//
var iconurl = HG.WebApp.Utility.GetModulePropertyByName(module, "Conditions.IconUrl").Value;
var iconurl = HG.WebApp.Utility.GetModulePropertyByName(module, 'Conditions.IconUrl').Value;
widget.find('[data-ui-field=icon]').attr('src', iconurl);
//
var icontext = HG.WebApp.Utility.GetModulePropertyByName(module, "Conditions.Description").Value;
var icontext = HG.WebApp.Utility.GetModulePropertyByName(module, 'Conditions.Description').Value;
widget.find('[data-ui-field=description]').html(icontext);
//
var last_updated = HG.WebApp.Utility.GetModulePropertyByName(module, "Conditions.LastUpdated").Value;
var last_updated = HG.WebApp.Utility.GetModulePropertyByName(module, 'Conditions.LastUpdated').Value;
widget.find('[data-ui-field=last_updated_value]').html(last_updated);
//

var display_celsius = HG.WebApp.Utility.GetModulePropertyByName(module, "Conditions.DisplayCelsius").Value;
var display_celsius = HG.WebApp.Utility.GetModulePropertyByName(module, 'Conditions.DisplayCelsius').Value;
if (display_celsius == 'TRUE') {
var temperaturec = HG.WebApp.Utility.GetModulePropertyByName(module, "Conditions.TemperatureC").Value;
var temperaturec = HG.WebApp.Utility.GetModulePropertyByName(module, 'Conditions.TemperatureC').Value;
widget.find('[data-ui-field=temperature_value]').html(temperaturec + '&#8451;');
} else {
var temperaturef = HG.WebApp.Utility.GetModulePropertyByName(module, "Conditions.TemperatureF").Value;
var temperaturef = HG.WebApp.Utility.GetModulePropertyByName(module, 'Conditions.TemperatureF').Value;
widget.find('[data-ui-field=temperature_value]').html(temperaturef + '&#8457;');
}
//
// Forecast data
for (var f = 1; f <= 3; f++)
{
var fIconUrl = HG.WebApp.Utility.GetModulePropertyByName(module, 'Conditions.Forecast.' + f + '.IconUrl').Value;
widget.find('[data-ui-field=forecast_' + f + '_icon]').attr('src', fIconUrl);
var fDescription = HG.WebApp.Utility.GetModulePropertyByName(module, 'Conditions.Forecast.' + f + '.Description').Value;
widget.find('[data-ui-field=forecast_' + f + '_desc]').html(fDescription);
if (display_celsius == 'TRUE') {
var temperatureMinC = HG.WebApp.Utility.GetModulePropertyByName(module, 'Conditions.Forecast.' + f + '.TemperatureC.Low').Value;
var temperatureMaxC = HG.WebApp.Utility.GetModulePropertyByName(module, 'Conditions.Forecast.' + f + '.TemperatureC.High').Value;
widget.find('[data-ui-field=forecast_' + f + '_tmin]').html(temperatureMinC + '&#8451;');
widget.find('[data-ui-field=forecast_' + f + '_tmax]').html(temperatureMaxC + '&#8451;');
} else {
var temperatureMinF = HG.WebApp.Utility.GetModulePropertyByName(module, 'Conditions.Forecast.' + f + '.TemperatureF.Low').Value;
var temperatureMaxF = HG.WebApp.Utility.GetModulePropertyByName(module, 'Conditions.Forecast.' + f + '.TemperatureF.High').Value;
widget.find('[data-ui-field=forecast_' + f + '_tmin]').html(temperatureMinF + '&#8457;');
widget.find('[data-ui-field=forecast_' + f + '_tmax]').html(temperatureMaxF + '&#8457;');
}
var displayDate = HG.WebApp.Utility.GetModulePropertyByName(module, 'Conditions.Forecast.' + f + '.Weekday').Value.substr(0, 3) + ', ';
displayDate += HG.WebApp.Utility.GetModulePropertyByName(module, 'Conditions.Forecast.' + f + '.Day').Value + ' ';
displayDate += HG.WebApp.Utility.GetModulePropertyByName(module, 'Conditions.Forecast.' + f + '.Month').Value;
widget.find('[data-ui-field=forecast_' + f + '_date]').html(displayDate);
}
}

}
Expand Down
2 changes: 1 addition & 1 deletion BaseFiles/Common/html/pages/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h5 style="font-family:georgia">HomeGenie</h5>
<fieldset data-role="fieldcontain" style="border:solid 1px gray;margin:10px;padding:10px;font-family:monospace;font-size:9pt;">
<div class="ui-grid-a">
<div data-locale-id="home_about_version" class="ui-block-a" style="width:27%">version</div>
<div class="ui-block-b" style="width:73%">&nbsp;&nbsp;1.00 beta r469</div>
<div class="ui-block-b" style="width:73%">&nbsp;&nbsp;1.00 beta r473</div>
</div>
<div class="ui-grid-a">
<div data-locale-id="home_about_codename" class="ui-block-a" style="width:27%">codename</div>
Expand Down
Loading

0 comments on commit 7bb1b8f

Please sign in to comment.