Skip to content

Commit 9c84a24

Browse files
authored
Merge pull request #148 from poblabs/development
Merge 1.0 development to master
2 parents d0df767 + dc7f02d commit 9c84a24

32 files changed

+4434
-7572
lines changed

Diff for: README.md

+137-63
Large diffs are not rendered by default.

Diff for: bin/user/belchertown.py

+1,000-24
Large diffs are not rendered by default.

Diff for: bin/user/belchertown_highchartsSearchX.py

-1,156
This file was deleted.

Diff for: changelog

+37
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
1.0 June 1, 2019
2+
3+
**BREAKING CHANGES**:
4+
* Chart system is 100% re-written. See below for details.
5+
* In an effort to provide more options for translations, the following Extra's settings have moved to Labels --> Default. Please update your settings!
6+
** home_page_header
7+
** graphs_page_header
8+
** records_page_header
9+
** reports_page_header
10+
** about_page_header
11+
** powered_by
12+
** footer_copyright_text
13+
** footer_disclaimer_text
14+
15+
# Full list of Changes
16+
17+
* Complete overhaul of the chart system and introduction of graphs.conf. Please see the Charts Wiki for all the new configuration options.
18+
** This overhaul removes the Highcharts_Belchertown skin and bin/user file and moves everything under the 1 Belchertown skin.
19+
** Overview of the new chart system include ability to move charts around, remove charts, configure multiple observations per chart, and add a 2nd yAxis to associate an observation to for better readability, mix timespans between the graph groups (have both a year and a day chart on the same page), mirrored charts, wind rose, monthly aggregation and more!
20+
** You can also define which graph group from graphs.conf to show on the Graphs page. Show them All, show only the 1 you want. It's your choice!
21+
* Add support for wind rose with Highcharts.
22+
* Added rainTotal observation, unique to Belchertown, which aggregates the "rain" observation (bucket tips) over a timespan to return total rainfall for that time period.
23+
* Change the Station Observation table on the homepage to an Extras option for greater control of *current* weather station observations. You can add/remove and change the order of the observations. Only valid weewx schema names are accepted.
24+
* Locale now has an option to be auto detected by the system, or the ability to change it to a locale the site owner wants as long as that locale is installed on the server first.
25+
* Added pyephem almanac modal to the "Sun & Moon" section. Thanks to the Seasons skin for the quick work. At this time the detailed Almanac Information does not update in real time. You will need to reload the page to get updated detailed almanac information.
26+
* Add support for translating the skin through the use of Default Labels in skin.conf (which can be used in weewx.conf, too).
27+
* Upgrade to Bootstrap 3.4.1 and change to new bootstrap stackpath CDN
28+
* Added new Dark Theme. This is a combination of Bootstrap's "darkly" (on CDN) and Highcharts Dark Unica theme (hosted locally), and Belchertown overrides to remain consistent.
29+
* Added new skin.conf option called "theme". Options are "light", "dark" and "auto". Light (white) website theme. Dark (dark) website theme. Auto switches between the two at sunset (to dark) and sunrise (to light).
30+
* Added a toggle button to the navigation menu which will change the entire site's theme at the click of the button.
31+
**NOTE** If you are using the AUTO theme mode, and you click this button, it will disable auto mode until you **close the page, tab or browser** to reset back to auto mode.
32+
* Added belchertown_debug to aid in debugging the skin's options. Also available through the URL /?debug=true
33+
* Added permalink to the graphs page. For example to link to your weekly graphs, use http://yoursite/graphs/?graph=week, for month, it's /?graph=month, for year is /?graph=year and for today you can link to the graphs page, or use /?graph=today. To find a specific permalink URL you can go to the All Graphs Page, then click the header for that graph.
34+
* Added option reload_hook_images and hook image reload timers which when enabled will reload any images in the 4 custom content areas on the index page within their specified timers. Useful for webcam images. This option will only work if MQTT Websockets live updates are also enabled.
35+
* Upgrade Font Awesome to 4.7.0
36+
* Clean up of some old CSS
37+
138
0.9.1 March 9, 2019
239
* Fixed a locale bug with the windSpeed and windGust float values by using toString() instead of format(). This is backwards compatible with weewx 3.8.2
340
* Fixed a bug where MQTT AJAX page updates weren't in locale decimal. (e.g. comma instead of period for decimal). Can't use parseFloat() on it's own if the culture is a comma for decimals. Need to use toLocaleString(). This requires converting the string to an int, to a float, back to a string.

Diff for: install.py

+6-19
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def loader():
99
class ExfoliationInstaller(ExtensionInstaller):
1010
def __init__(self):
1111
super(ExfoliationInstaller, self).__init__(
12-
version="0.9.1",
12+
version="1.0",
1313
name='Belchertown',
1414
description='A clean modern skin with real time streaming updates and interactive charts. Modeled after BelchertownWeather.com',
1515
author="Pat OBrien",
@@ -19,27 +19,25 @@ def __init__(self):
1919
'Belchertown': {
2020
'skin':'Belchertown',
2121
'HTML_ROOT':'belchertown'
22-
},
23-
'Highcharts_Belchertown': {
24-
'skin':'Highcharts_Belchertown',
25-
'HTML_ROOT':'belchertown'
2622
}
2723
}
2824
},
29-
files=[('bin/user', ['bin/user/belchertown.py',
30-
'bin/user/belchertown_highchartsSearchX.py'
25+
files=[('bin/user', ['bin/user/belchertown.py'
3126
]
3227
),
3328
('skins/Belchertown', ['skins/Belchertown/favicon.ico',
3429
'skins/Belchertown/footer.html.tmpl',
3530
'skins/Belchertown/header.html.tmpl',
3631
'skins/Belchertown/index.html.tmpl',
3732
'skins/Belchertown/about.inc.example',
33+
'skins/Belchertown/celestial.inc',
34+
'skins/Belchertown/graphs.conf.example',
3835
'skins/Belchertown/page-header.inc',
3936
'skins/Belchertown/manifest.json.tmpl',
4037
'skins/Belchertown/records.inc.example',
4138
'skins/Belchertown/robots.txt',
4239
'skins/Belchertown/skin.conf',
40+
'skins/Belchertown/belchertown-dark.min.css',
4341
'skins/Belchertown/style.css'
4442
]
4543
),
@@ -55,10 +53,7 @@ def __init__(self):
5553
),
5654
('skins/Belchertown/records', ['skins/Belchertown/records/index.html.tmpl']),
5755
('skins/Belchertown/reports', ['skins/Belchertown/reports/index.html.tmpl']),
58-
('skins/Belchertown/js', ['skins/Belchertown/js/highcharts-dayplots.js.tmpl',
59-
'skins/Belchertown/js/highcharts-weekplots.js.tmpl',
60-
'skins/Belchertown/js/highcharts-monthplots.js.tmpl',
61-
'skins/Belchertown/js/highcharts-yearplots.js.tmpl',
56+
('skins/Belchertown/js', ['skins/Belchertown/js/belchertown.js.tmpl',
6257
'skins/Belchertown/js/index.html',
6358
'skins/Belchertown/js/responsive-menu.js'
6459
]
@@ -92,14 +87,6 @@ def __init__(self):
9287
'skins/Belchertown/images/wind.png',
9388
'skins/Belchertown/images/index.html'
9489
]
95-
),
96-
('skins/Highcharts_Belchertown', ['skins/Highcharts_Belchertown/skin.conf']
97-
),
98-
('skins/Highcharts_Belchertown/json', ['skins/Highcharts_Belchertown/json/day.json.tmpl',
99-
'skins/Highcharts_Belchertown/json/week.json.tmpl',
100-
'skins/Highcharts_Belchertown/json/month.json.tmpl',
101-
'skins/Highcharts_Belchertown/json/year.json.tmpl',
102-
]
10390
)
10491
]
10592
)

Diff for: skins/Belchertown/about.inc.example

+22-17
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1-
<p>Welcome to your new about page!</p>
2-
<p>To change this text:
3-
<ul>
4-
<li> Create a new file at <code>skins/Belchertown/about.inc</code>, or rename the <code>skins/Belchertown/about.inc.example</code> file to <code>about.inc</code></li>
5-
<li> Use the example text within <code>skins/Belchertown/about.inc.example</code> to create your about page description!</li>
6-
<li>Full HTML, and weewx variables are accepted.</li>
7-
</ul>
8-
</p>
9-
<p>To show built in weewx variables (like station battery status (if supported), temperature, weewx version, etc.), just add them to this file. For example:</p>
10-
<ul>
11-
<li>Station hardware: $station.hardware</li>
12-
<li>Server uptime: $station.os_uptime</li>
13-
<li>WeeWX uptime: $station.uptime</li>
14-
<li>WeeWX version: $station.version</li>
15-
<li>Belchertown Skin Version: $belchertown_version</li>
16-
</ul>
17-
<p>For an example of what this page could say, please see <a href="https://belchertownweather.com/about" target="_blank">https://belchertownweather.com/about</a>. If you need more help, refer to <a href="https://github.com/poblabs/weewx-belchertown#creating-about-page-and-records-page" target="_blank">this link.</a></p>
1+
<div class="entry-content about-outer" itemprop="text">
2+
<br>
3+
<h2>Welcome to your new about page!</h2>
4+
<p>Thank you for installing the <a href="https://github.com/poblabs/weewx-belchertown" target="_blank">Belchertown weewx skin</a>!</p>
5+
<p>This is your default about page. To change this text:
6+
<ul>
7+
<li>Create a new file at <code>skins/Belchertown/about.inc</code>, or rename the <code>skins/Belchertown/about.inc.example</code> file to <code>about.inc</code></li>
8+
<li>Use the example text within <code>skins/Belchertown/about.inc.example</code> to create your about page description!</li>
9+
<li>Full HTML, and weewx variables are accepted.</li>
10+
</ul>
11+
</p>
12+
<p>To show built in weewx variables (like station battery status (if supported), temperature, weewx version, etc.), just add them to this file. For example:</p>
13+
<ul>
14+
<li>Station hardware: $station.hardware</li>
15+
<li>Server uptime: $station.os_uptime</li>
16+
<li>WeeWX uptime: $station.uptime</li>
17+
<li>WeeWX version: $station.version</li>
18+
<li>Belchertown Skin Version: $belchertown_version</li>
19+
</ul>
20+
<p>For an example of what this page could say, please see <a href="https://belchertownweather.com/about" target="_blank">https://belchertownweather.com/about</a>. If you need more help, refer to <a href="https://github.com/poblabs/weewx-belchertown#creating-about-page-and-records-page" target="_blank">this link.</a></p>
21+
<p>Enjoy your new weewx skin!</p>
22+
</div>

Diff for: skins/Belchertown/about/index.html.tmpl

+12-16
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,19 @@
55
#include "header.html.tmpl"
66

77
<div class="site-inner">
8-
<div class="content-sidebar-wrap">
9-
<main class="content">
10-
<article class="weewx page type-page status-publish entry" itemscope itemtype="https://schema.org/CreativeWork">
11-
<div class="entry-content" itemprop="text">
12-
13-
#include "page-header.inc"
8+
<main class="content">
9+
<article class="weewx about" itemscope itemtype="https://schema.org/CreativeWork">
10+
11+
#include "page-header.inc"
1412

15-
#if os.path.exists("about.inc")
16-
#include "about.inc"
17-
#else
18-
#include "about.inc.example"
19-
#end if
20-
21-
</div>
22-
</article>
23-
</main>
24-
</div>
13+
#if os.path.exists("about.inc")
14+
#include "about.inc"
15+
#else
16+
#include "about.inc.example"
17+
#end if
18+
19+
</article>
20+
</main>
2521
</div>
2622

2723

Diff for: skins/Belchertown/belchertown-dark.min.css

+17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: skins/Belchertown/celestial.inc

+188
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
## celestial module for weewx skins
2+
## Copyright Tom Keffer, Matthew Wall
3+
## See LICENSE.txt for your rights
4+
#errorCatcher Echo
5+
6+
## If extended almanac information is available, do extra calculations.
7+
#if $almanac.hasExtras
8+
9+
#set $sun_altitude = $almanac.sun.alt
10+
#if $sun_altitude < 0
11+
#set $sun_None="<i>(%s)</i>" % $obs.label.sun_always_down
12+
#set $daylight_str = "00:00"
13+
#else
14+
#set $sun_None="<i>(%s)</i>" % $obs.label.sun_always_up
15+
#set $daylight_str = "24:00"
16+
#end if
17+
18+
#set $sunrise_ts = $almanac.sun.rise.raw
19+
#set $sunset_ts = $almanac.sun.set.raw
20+
#if $sunrise_ts and $sunset_ts
21+
22+
#set $now = $current.dateTime.raw
23+
#set $today_daylight = $sunset_ts - $sunrise_ts
24+
25+
#set $seconds = $today_daylight
26+
#set $hours = $seconds //3600
27+
#set $seconds %= 3600
28+
#set $minutes = $seconds//60
29+
#set $seconds %= 60
30+
#set $daylight_str = "%d %s, %d %s, %d %s" % ($hours, $obs.label.hour[0] if ( $hours == 1 ) else $obs.label.hour[1], $minutes, $obs.label.minute[0] if ( $minutes == 1 ) else $obs.label.minute[1], $seconds, $obs.label.second[0] if ( $seconds == 1 ) else $obs.label.second[1])
31+
32+
#set $yesterday = $now - 24*3600
33+
#set $yesterday_daylight = $almanac($almanac_time=$yesterday).sun.set.raw - $almanac($almanac_time=$yesterday).sun.rise.raw
34+
#set $difference = $today_daylight - $yesterday_daylight
35+
#if $difference
36+
#set $delta = abs($difference)
37+
#set $minutes_text = $obs.label.minute[0] if ( (int($delta) // 60) == 1 ) else $obs.label.minute[1]
38+
#set $seconds_text = $obs.label.second[0] if ( ($delta % 60) == 1 ) else $obs.label.second[1]
39+
#set $amt_str = "%s%d %s" % (str(int($delta) // 60) + ' ' + $minutes_text + ', ' if ($delta // 60) > 0 else '', $delta % 60 if ($delta // 60) > 0 else $delta, $seconds_text)
40+
#if $difference > 0
41+
#set $delta_str = "%s %s" % ( $amt_str, $obs.label.more_than_yesterday )
42+
#else
43+
#set $delta_str = "%s %s" % ( $amt_str, $obs.label.less_than_yesterday )
44+
#end if
45+
#set $daylight_str = "%s<br/>%s" % ($daylight_str, $delta_str)
46+
#end if
47+
48+
#end if
49+
#end if
50+
51+
<div id="celestial_widget" class="widget">
52+
<div class="widget_contents">
53+
#if $almanac.hasExtras
54+
<div id="celestial_details">
55+
<div class="celestial_body">
56+
<table class="celestial">
57+
<tr><th>&#9728; $obs.label.sun</th><th></th></tr>
58+
<tr>
59+
<td class="label">$obs.label.start_civil_twilight</td>
60+
<td class="data">$almanac(horizon=-6).sun(use_center=1).rise</td>
61+
</tr>
62+
<tr>
63+
<td class="label">$obs.label.rise</td>
64+
<td class="data">$almanac.sun.rise.format(None_string=$sun_None)</td>
65+
</tr>
66+
<tr>
67+
<td class="label">$obs.label.transit</td>
68+
<td class="data">$almanac.sun.transit</td>
69+
</tr>
70+
<tr>
71+
<td class="label">$obs.label.set</td>
72+
<td class="data">$almanac.sun.set.format(None_string=$sun_None)</td>
73+
</tr>
74+
<tr>
75+
<td class="label">$obs.label.end_civil_twilight</td>
76+
<td class="data">$almanac(horizon=-6).sun(use_center=1).set</td>
77+
</tr>
78+
<tr>
79+
<td class="label">$obs.label.azimuth</td>
80+
<td class="data">$("%.1f&deg;" % $almanac.sun.az)</td>
81+
</tr>
82+
<tr>
83+
<td class="label">$obs.label.altitude</td>
84+
<td class="data">$("%.1f&deg;" % $sun_altitude)</td>
85+
</tr>
86+
<tr>
87+
<td class="label">$obs.label.right_ascension</td>
88+
<td class="data">$("%.1f&deg;" % $almanac.sun.ra)</td>
89+
</tr>
90+
<tr>
91+
<td class="label">$obs.label.declination</td>
92+
<td class="data">$("%.1f&deg;" % $almanac.sun.dec)</td>
93+
</tr>
94+
#if $almanac.next_equinox.raw < $almanac.next_solstice.raw
95+
## The equinox is before the solstice. Display them in order.
96+
<tr>
97+
<td class="label">$obs.label.equinox</td>
98+
<td class="data">$almanac.next_equinox</td>
99+
</tr>
100+
<tr>
101+
<td class="label">$obs.label.solstice</td>
102+
<td class="data">$almanac.next_solstice</td>
103+
</tr>
104+
#else
105+
## The solstice is before the equinox. Display them in order.
106+
<tr>
107+
<td class="label">$obs.label.solstice</td>
108+
<td class="data">$almanac.next_solstice</td>
109+
</tr>
110+
<tr>
111+
<td class="label">$obs.label.equinox</td>
112+
<td class="data">$almanac.next_equinox</td>
113+
</tr>
114+
#end if
115+
116+
<tr>
117+
<td class="label">$obs.label.total_daylight</td>
118+
<td class="data">$daylight_str</td>
119+
</tr>
120+
</table>
121+
</div>
122+
<div class="celestial_body">
123+
<table class="celestial">
124+
<tr><th>&#9789; $obs.label.moon</th><th></th></tr>
125+
<tr><td class="label">&nbsp;</td><td class="data">&nbsp;</td></tr>
126+
<tr>
127+
<td class="label">$obs.label.rise</td>
128+
<td class="data">$almanac.moon.rise</td>
129+
</tr>
130+
<tr>
131+
<td class="label">$obs.label.transit</td>
132+
<td class="data">$almanac.moon.transit</td>
133+
</tr>
134+
<tr>
135+
<td class="label">$obs.label.set</td>
136+
<td class="data">$almanac.moon.set</td>
137+
</tr>
138+
<tr><td class="label">&nbsp;</td><td class="data">&nbsp;</td></tr>
139+
<tr>
140+
<td class="label">$obs.label.azimuth</td>
141+
<td class="data">$("%.1f&deg;" % $almanac.moon.az)</td>
142+
</tr>
143+
<tr>
144+
<td class="label">$obs.label.altitude</td>
145+
<td class="data">$("%.1f&deg;" % $almanac.moon.alt)</td>
146+
</tr>
147+
<tr>
148+
<td class="label">$obs.label.right_ascension</td>
149+
<td class="data">$("%.1f&deg;" % $almanac.moon.ra)</td>
150+
</tr>
151+
<tr>
152+
<td class="label">$obs.label.declination</td>
153+
<td class="data">$("%.1f&deg;" % $almanac.moon.dec)</td>
154+
</tr>
155+
#if $almanac.next_full_moon.raw < $almanac.next_new_moon.raw
156+
<tr>
157+
<td class="label">$obs.label.full_moon</td>
158+
<td class="data">$almanac.next_full_moon</td>
159+
</tr>
160+
<tr>
161+
<td class="label">$obs.label.new moon</td>
162+
<td class="data">$almanac.next_new_moon</td>
163+
</tr>
164+
#else
165+
<tr>
166+
<td class="label">$obs.label.new_moon</td>
167+
<td class="data">$almanac.next_new_moon</td>
168+
</tr>
169+
<tr>
170+
<td class="label">$obs.label.full_moon</td>
171+
<td class="data">$almanac.next_full_moon</td>
172+
</tr>
173+
#end if
174+
<tr>
175+
<td class="label">$obs.label.phase</td>
176+
<td class="data">$almanac.moon_phase<br/>
177+
$almanac.moon_fullness% $obs.label.full</td>
178+
</tr>
179+
</table>
180+
</div>
181+
</div>
182+
#else
183+
<p>$obs.label.install_pyephem</p>
184+
#end if
185+
</div>
186+
</div>
187+
<div class="clear"></div>
188+

0 commit comments

Comments
 (0)