-
Notifications
You must be signed in to change notification settings - Fork 3
/
install.py
executable file
·183 lines (174 loc) · 8.3 KB
/
install.py
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
"""
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
Installer for Highcharts for WeeWX
Version: 0.3.2 Date: 17 March 2021
Revision History
17 March 2021
- version number change only
16 October 2020
- version number change only
20 September 2020 v0.3.0
- now supports WeeWX 4.0.0 under python 2 or python 3
- removed highcharts.py from install file list
- renamed highchartsSearchX.py to highchartssearchlist.py
4 September 2018 v0.2.2
- version number change only
16 May 2017 v0.2.1
- fixed errors in various 'Extras' settings (error previously hidden
due to [[Windrose]]/[[WindRose]] issue)
4 May 2017 v0.2.0
- version number change only
21 November 2016 v0.1.0
- initial implementation
"""
import weewx
from distutils.version import StrictVersion
from setup import ExtensionInstaller
REQUIRED_VERSION = "3.4.0"
HFW_VERSION = "0.3.2"
def loader():
return HfwInstaller()
class HfwInstaller(ExtensionInstaller):
def __init__(self):
if StrictVersion(weewx.__version__) < StrictVersion(REQUIRED_VERSION):
msg = "%s requires WeeWX %s or greater, found %s" % ('Hfw ' + HFW_VERSION,
REQUIRED_VERSION,
weewx.__version__)
raise weewx.UnsupportedFeature(msg)
super(HfwInstaller, self).__init__(
version=HFW_VERSION,
name='Hfw',
description='WeeWX support for plotting observational data using Highcharts.',
author="Gary Roderick",
author_email="gjroderick<@>gmail.com",
config={
'StdReport': {
'Highcharts': {
'skin': 'Highcharts',
'CheetahGenerator': {
'ToDate': {
'YearJSON': {
'stale_age': '3600'
}
}
},
'Units': {
'Groups': {
'group_altitude': 'meter',
'group_degree_day': 'degree_C_day',
'group_pressure': 'hPa',
'group_rain': 'mm',
'group_rainrate': 'mm_per_hour',
'group_speed': 'km_per_hour',
'group_speed2': 'km_per_hour2',
'group_temperature': 'degree_C'
},
'StringFormats': {
'centibar': '%.0f',
'cm': '%.2f',
'cm_per_hour': '%.2f',
'degree_C': '%.1f',
'degree_F': '%.1f',
'degree_compass': '%.0f',
'foot': '%.0f',
'hPa': '%.1f',
'inHg': '%.3f',
'inch': '%.2f',
'inch_per_hour': '%.2f',
'km_per_hour': '%.0f',
'km_per_hour2': '%.1f',
'knot': '%.0f',
'knot2': '%.1f',
'mbar': '%.1f',
'meter': '%.0f',
'meter_per_second': '%.1f',
'meter_per_second2': '%.1f',
'mile_per_hour': '%.0f',
'mile_per_hour2': '%.1f',
'mm': '%.1f',
'mmHg': '%.1f',
'mm_per_hour': '%.1f',
'percent': '%.0f',
'uv_index': '%.1f',
'volt': '%.1f',
'watt_per_meter_squared': '%.0f',
'NONE': 'N/A'
},
'Labels': {
'centibar': 'cb',
'cm': 'cm',
'cm_per_hour': 'cm/hr',
'degree_C': '\u00B0 C',
'degree_F': '\u00B0 F',
'degree_compass': '\u00B0',
'foot': 'feet',
'hPa': 'hPa',
'inHg': 'inHg',
'inch': 'in',
'inch_per_hour': 'in/hr',
'km_per_hour': 'km/hr',
'km_per_hour2': 'km/hr',
'knot': 'knots',
'knot2': 'knots',
'mbar': 'mbar',
'meter': 'meters',
'meter_per_second': 'm/s',
'meter_per_second2': 'm/s',
'mile_per_hour': 'mph',
'mile_per_hour2': 'mph',
'mm': 'mm',
'mmHg': 'mmHg',
'mm_per_hour': 'mm/hr',
'percent': '%',
'uv_index': 'Index',
'volt': 'V',
'watt_per_meter_squared': 'W/m\u00B2',
'NONE': ''
}
},
'Extras': {
'MinRange': {
'outTemp': [10, 'degree_C'],
'windchill': [10, 'degree_C'],
'barometer': [20, 'hPa'],
'windSpeed': '10',
'rain': [5, 'mm'],
'radiation': '500',
'UV': '16'
},
'WindRose': {
'title': 'Wind Rose',
'source': 'windSpeed',
'period': [86400, 604800, 'month', 'year'],
'aggregate_type': '',
'aggregate_interval': '',
'petals': '16',
'petal_colors': ['aqua', '0x0099FF', '0x0033FF', '0x009900', '0x00CC00', '0x33FF33', '0xCCFF00'],
'speedfactor': ['0.0', '0.1', '0.2', '0.3', '0.5', '0.7', '1.0'],
'show_legend_title': 'True',
'show_band_percent': 'True',
'bullseye_percent': 'True',
'precision': '1',
'bullseye_size': '20',
'bullseye_color': '0xFFFACD',
'calm_limit': '0.5'
}
}
}
}
},
files=[('bin/user', ['bin/user/highchartssearchlist.py']
),
('skins/Highcharts', ['skins/Highcharts/json/week.json.tmpl',
'skins/Highcharts/json/year.json.tmpl',
'skins/Highcharts/skin.conf'
]
)
]
)