forked from chaunceygardiner/weewx-airlink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.py
71 lines (64 loc) · 2.59 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
# Copyright 2020 by John A Kline <[email protected]>
#
# 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.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import sys
import weewx
from setup import ExtensionInstaller
def loader():
if sys.version_info[0] < 3 or (sys.version_info[0] == 3 and sys.version_info[1] < 7):
sys.exit("weewx-airlink requires Python 3.7 or later, found %s.%s" % (sys.version_info[0], sys.version_info[1]))
if weewx.__version__ < "4":
sys.exit("weewx-airlink requires WeeWX 4, found %s" % weewx.__version__)
return AirLinkInstaller()
class AirLinkInstaller(ExtensionInstaller):
def __init__(self):
super(AirLinkInstaller, self).__init__(
version="1.0.1",
name='airlink',
description='Record air quality as provided by a Davis AirLink sensor.',
author="John A Kline",
author_email="[email protected]",
data_services='user.airlink.AirLink',
config = {
'StdReport': {
'AirLinkReport': {
'HTML_ROOT':'airlink',
'enable': 'true',
'skin':'airlink',
},
},
'AirLink': {
'Sensor1' : {
'enable' : True,
'hostname' : 'airlink',
'port' : '80',
'timeout' : '2',
},
'Sensor2': {
'enable' : False,
'hostname' : 'airlink2',
'port' : '80',
'timeout' : '2',
},
},
},
files=[
('bin/user', ['bin/user/airlink.py']),
('skins/nws', [
'skins/airlink/index.html.tmpl',
'skins/airlink/skin.conf',
]),
]
)