forked from poblabs/weewx-belchertown
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathinstall.py
More file actions
executable file
·314 lines (275 loc) · 12.4 KB
/
install.py
File metadata and controls
executable file
·314 lines (275 loc) · 12.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
# Installer for Belchertown WeeWX skin
# Pat O'Brien, 2018
import configobj
from setup import ExtensionInstaller
from io import StringIO
# -------- extension info -----------
VERSION = "1.7beta2-new-belchertown"
NAME = "Belchertown"
DESCRIPTION = "A clean modern skin with real time streaming updates and interactive charts. Modeled after BelchertownWeather.com"
AUTHOR = "Pat OBrien, maintained by uajqq"
AUTHOR_EMAIL = "https://github.com/uajqq/weewx-belchertown-new"
# -------- main loader -----------
def loader():
return BelchertownInstaller()
class BelchertownInstaller(ExtensionInstaller):
def __init__(self):
super(BelchertownInstaller, self).__init__(
version=VERSION,
name=NAME,
description=DESCRIPTION,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
config=config_dict,
files=files_dict,
)
# ----------------------------------
# config stanza
# ----------------------------------
extension_config = """
[StdReport]
[[Belchertown]]
skin = "Belchertown"
HTML_ROOT = "belchertown"
enable = "true"
[[[Extras]]]
# For help refer to the docs at https://github.com/uajqq/weewx-belchertown-new
# and consult skin.conf for the configurable elements and their hierarchy
#---General Site Defaults---
# belchertown_debug = 0
# belchertown_locale = "auto"
# theme = "light"
# theme_toggle_enabled = 1
# site_title = "My Weather Website"
# logo_image = ""
# logo_image_dark = ""
# radar_html = ""
# radar_html_dark = ""
# radar_width = 650
# radar_height = 360
# radar_marker = 0
#---Forecast unit of measures---
# radar_rain = "default" # default, mm, in
# radar_temp = "default" # default, C, F
# radar_wind = "default" # default, kt, m/s, km/h, mph, bft
# aeris_map = 0
# almanac_extras = 1
#---Station Observations---
# station_observations = "barometer", "dewpoint", "outHumidity", "rainWithRainRate"
#---Manifest Settings for Mobile Phones---
# manifest_name = "My Weather Website"
# manifest_short_name = "MWW"
#---Highcharts settings---
# highcharts_enabled = 1
# graph_page_show_all_button = 1
# graph_page_default_graphgroup = "day"
# highcharts_homepage_graphgroup = "homepage"
# highcharts_decimal = "auto"
# highcharts_thousands = "auto"
#---MQTT Websockets defaults---
# mqtt_websockets_enabled = 0
# mqtt_websockets_host = ""
# mqtt_websockets_port = 1883
# mqtt_websockets_ssl = 0
# mqtt_websockets_topic = ""
# mqtt_websockets_username = ""
# mqtt_websockets_password = ""
# disconnect_live_website_visitor = 1800000
# show_last_updated_alert = 0
# last_updated_alert_threshold = 1800
# webpage_autorefresh = 0
#---Image Reload Section---
# reload_hook_images = 0
# reload_images_radar = 300
# reload_images_hook_asi = -1
# reload_images_hook_af = -1
# reload_images_hook_as = -1
# reload_images_hook_ac = -1
#---Forecast defaults---
# forecast_enabled = 0
# forecast_provider = "" # aeris (Aeris/XWeather) or pirateweather (Pirate Weather)
#---forecast API configuration---
# forecast_api_id = "" # Aeris/XWeather Client ID or Pirate Weather API Key
# forecast_api_secret = "" # Only for Aeris/XWeather
# forecast_units = "us"
# forecast_interval_hours = 24
# forecast_lang = "en"
# forecast_stale = 3540 # 59 minutes
# current_conditions_stale = 3540 # 59 minutes
# forecast_aeris_use_metar = 1
# forecast_alert_enabled = 0
# forecast_alert_limit = 1
# forecast_show_daily_forecast_link = 0
# forecast_daily_forecast_link = ""
# forecast_show_humidity_dewpoint = 0
# forecast_place = "" # defaults to station lat/lon
# current_conditions = "obs"
# current_conditions_timestamp_enabled = 0
# forecast_write_provider = 1 # Write provider tag into JSON for front-end switching
#---Air Quality Index (AQI) defaults for Aeris/Xweather---
# aqi_enabled = 0
# aqi_location_enabled = 0
#---Show Beaufort wind scale category under wind table---
# beaufort_category = 0
# beaufort_category_gusts = 0
#---Earthquake defaults---
# earthquake_enabled = 0
# earthquake_maxradiuskm = 1000
# earthquake_stale = 10740
# earthquake_server = USGS
# geonet_mmi = 4
#---Social Share Button Defaults. Define the text below under Labels---
# facebook_enabled = 0
# twitter_enabled = 0
# social_share_html = ""
#---Google Analytics---
# googleAnalyticsId = ""
# This is the display of the Pi Kiosk which is in the /pi folder
# pi_kiosk_bold = "false"
# pi_theme = "auto"
# This is the display of the kiosk page which is kiosk.html
# radar_html_kiosk = ""
# radar_width_kiosk = 490
# radar_height_kiosk = 362
# mqtt_websockets_host_kiosk = ""
# mqtt_websockets_port_kiosk = ""
# mqtt_websockets_ssl_kiosk = ""
# forecast_interval_hours_kiosk = 24
# aqi_enabled_kiosk = 0
# Display a Back To Top Button
# back_to_top_button_enabled = 0
# back_to_top_button_position = 0
# back_to_top_button_opacity = 0.8
#-------------------------------------------------------------
#---
#--- python's ConfigObj has a limitation in how it processes
#--- comments, so we need to define an 'unused' variable below
#--- to ensure that this whole stanza makes it into weewx.conf
#---
#--- please ignore the following 'unused' variable
#---
#-------------------------------------------------------------
work_around_ConfigObj_limitations = "true"
# [[[Labels]]]
# [[[[Generic]]]]
#-- Footer information --
# footer_copyright_text = "My Weather Website"
# footer_disclaimer_text = "Never make important decisions based on info from this website."
#-- Default page headers --
# home_page_header = "My Station Weather Conditions"
# graphs_page_header = "Weather Observation Graphs"
# reports_page_header = "Weather Observation Reports"
# records_page_header = "Weather Observation Records"
# about_page_header = "About This Site"
# powered_by = 'Observations are powered by a <a href="/about" target="_blank">Personal Weather Station</a>'
#-- Twitter Social Share --
# twitter_text = "Check out my website: My Weather Website Weather Conditions"
# twitter_owner = "YourTwitterUsernameHere"
# twitter_hashtags = "WeeWX #weather"
"""
config_dict = configobj.ConfigObj(StringIO(extension_config))
# ----------------------------------
# files stanza
# ----------------------------------
files = [
("bin/user", ["bin/user/belchertown.py"]),
(
"skins/Belchertown",
[
"skins/Belchertown/favicon.ico",
"skins/Belchertown/footer.html.tmpl",
"skins/Belchertown/header.html.tmpl",
"skins/Belchertown/index.html.tmpl",
"skins/Belchertown/about.inc.example",
"skins/Belchertown/kiosk.html.tmpl",
"skins/Belchertown/kiosk.css",
"skins/Belchertown/celestial.inc",
"skins/Belchertown/daylight.inc",
"skins/Belchertown/graphs.conf.example",
"skins/Belchertown/page-header.inc",
"skins/Belchertown/manifest.json.tmpl",
"skins/Belchertown/records.inc.example",
"skins/Belchertown/records-table.inc.example",
"skins/Belchertown/robots.txt",
"skins/Belchertown/skin.conf",
"skins/Belchertown/belchertown-dark.min.css",
"skins/Belchertown/style.css",
],
),
("skins/Belchertown/about", ["skins/Belchertown/about/index.html.tmpl"]),
("skins/Belchertown/graphs", ["skins/Belchertown/graphs/index.html.tmpl"]),
(
"skins/Belchertown/NOAA",
[
"skins/Belchertown/NOAA/NOAA-YYYY-MM.txt.tmpl",
"skins/Belchertown/NOAA/NOAA-YYYY.txt.tmpl",
],
),
("skins/Belchertown/pi", ["skins/Belchertown/pi/index.html.tmpl"]),
("skins/Belchertown/records", ["skins/Belchertown/records/index.html.tmpl"]),
("skins/Belchertown/reports", ["skins/Belchertown/reports/index.html.tmpl"]),
(
"skins/Belchertown/js",
[
"skins/Belchertown/js/belchertown.js.tmpl",
"skins/Belchertown/js/index.html",
"skins/Belchertown/js/responsive-menu.js",
],
),
(
"skins/Belchertown/json",
[
"skins/Belchertown/json/index.html",
"skins/Belchertown/json/weewx_data.json.tmpl",
],
),
(
"skins/Belchertown/lang",
[
"skins/Belchertown/lang/ca.conf",
"skins/Belchertown/lang/de.conf",
"skins/Belchertown/lang/it.conf",
],
),
(
"skins/Belchertown/images",
[
"skins/Belchertown/images/clear-day.png",
"skins/Belchertown/images/clear-night.png",
"skins/Belchertown/images/cloudy.png",
"skins/Belchertown/images/drizzle.png",
"skins/Belchertown/images/fog.png",
"skins/Belchertown/images/hail.png",
"skins/Belchertown/images/mostly-clear-day.png",
"skins/Belchertown/images/mostly-clear-night.png",
"skins/Belchertown/images/mostly-cloudy-day.png",
"skins/Belchertown/images/mostly-cloudy-night.png",
"skins/Belchertown/images/partly-cloudy-day.png",
"skins/Belchertown/images/partly-cloudy-night.png",
"skins/Belchertown/images/rain.png",
"skins/Belchertown/images/sleet.png",
"skins/Belchertown/images/snow.png",
"skins/Belchertown/images/snowflake-icon-15px.png",
"skins/Belchertown/images/station.png",
"skins/Belchertown/images/station48.png",
"skins/Belchertown/images/station72.png",
"skins/Belchertown/images/station96.png",
"skins/Belchertown/images/station144.png",
"skins/Belchertown/images/station168.png",
"skins/Belchertown/images/station192.png",
"skins/Belchertown/images/sunrise.png",
"skins/Belchertown/images/sunset.png",
"skins/Belchertown/images/thunderstorm.png",
"skins/Belchertown/images/tornado.png",
"skins/Belchertown/images/unknown.png",
"skins/Belchertown/images/wind.png",
"skins/Belchertown/images/windy.png",
"skins/Belchertown/images/index.html",
"skins/Belchertown/images/aeris-icon-list.json",
],
),
]
files_dict = files
# ---------------------------------
# done
# ---------------------------------