forked from gjr80/weewx-gw1000
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.py
executable file
·60 lines (49 loc) · 2.05 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
"""
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 GW1000 Driver
Version: 0.1.0b5 Date: 24 July 2020
Revision History
?? ????? 2020 v0.1.0
- initial implementation
"""
import weewx
from distutils.version import StrictVersion
from setup import ExtensionInstaller
REQUIRED_VERSION = "3.7.0"
GW1000_VERSION = "0.1.0b5"
def loader():
return Gw1000Installer()
class Gw1000Installer(ExtensionInstaller):
def __init__(self):
if StrictVersion(weewx.__version__) < StrictVersion(REQUIRED_VERSION):
msg = "%s requires WeeWX %s or greater, found %s" % (''.join(('GW1000 driver ', GW1000_VERSION)),
REQUIRED_VERSION,
weewx.__version__)
raise weewx.UnsupportedFeature(msg)
super(Gw1000Installer, self).__init__(
version=GW1000_VERSION,
name='GW1000',
description='WeeWX driver for GW1000 WiFi gateway.',
author="Gary Roderick",
author_email="gjroderick<@>gmail.com",
files=[('bin/user', ['bin/user/gw1000.py'])],
config={
'GW1000': {
'driver': 'user.gw1000'
},
'Accumulator': {
'lightning_strike_count': {
'extractor': 'sum'
},
'lightning_last_det_time': {
'extractor': 'last'
}
}
}
)