-
Notifications
You must be signed in to change notification settings - Fork 22
/
wfpiconsole.kv
237 lines (227 loc) · 8.5 KB
/
wfpiconsole.kv
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
##:kivy
## WeatherFlow PiConsole: Raspberry Pi Python console for WeatherFlow Tempest
## and Smart Home Weather stations.
## Copyright (C) 2018-2023 Peter Davis
## 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 3 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, see <http://www.gnu.org/licenses/>.
## =============================================================================
## Import required modules
## =============================================================================
#:import Factory kivy.factory.Factory
#:import utils kivy.utils
## =============================================================================
## Include required kv lang files
## =============================================================================
#:include kvlang/astro.kv
#:include kvlang/barometer.kv
#:include kvlang/forecast.kv
#:include kvlang/layout.kv
#:include kvlang/lightning.kv
#:include kvlang/rainfall.kv
#:include kvlang/settings.kv
#:include kvlang/temperature.kv
#:include kvlang/update.kv
#:include kvlang/widgets.kv
#:include kvlang/wind.kv
## =============================================================================
## CURRRENT CONDITIONS SCREEN
## =============================================================================
<CurrentConditions>:
name: 'CurrentConditions'
id: CurrentConditions
canvas.before:
Color:
rgba: utils.rgba('000000ff')
Rectangle:
pos: self.pos
size: self.size
BoxLayout:
padding: ['2dp', '2dp', '2dp', '0dp']
spacing: '3dp'
orientation: 'vertical'
id: panel_layout
BoxLayout:
spacing: '4dp'
orientation: 'vertical'
id: row_layout
BoxLayout:
spacing: '4dp'
size_hint: (1, 31/444)
BoxLayout:
id: button_one
BoxLayout:
id: button_two
BoxLayout:
id: button_three
BoxLayout:
id: button_four
BoxLayout:
id: button_five
BoxLayout:
id: button_six
BoxLayout:
id: GraphsButton
BoxLayout:
PanelButton:
text: 'Menu'
on_release: Factory.mainMenu().open()
## =============================================================================
## Graphs SCREEN
## =============================================================================
<graphs>:
name: 'graphs'
id: graphs
canvas.before:
Color:
rgba: utils.rgba('000000ff')
Rectangle:
pos: self.pos
size: self.size
BoxLayout:
padding: ['2dp', '2dp', '2dp', '0dp']
spacing: '3dp'
orientation: 'vertical'
BoxLayout:
spacing: '4dp'
orientation: 'vertical'
BoxLayout:
spacing: '5dp'
BoxLayout:
id: graph_one
BoxLayout:
id: graph_two
BoxLayout:
spacing: '5dp'
BoxLayout:
id: graph_three
BoxLayout:
id: graph_four
BoxLayout:
spacing: '4dp'
size_hint: (1, 31/444)
BoxLayout:
id: button_one
BoxLayout:
id: button_two
BoxLayout:
id: button_three
BoxLayout:
id: button_four
BoxLayout:
id: button_five
BoxLayout:
id: button_six
BoxLayout:
id: GraphsButton
PanelButton:
text: 'Weather'
on_release: app.screen_manager.current = 'CurrentConditions'
BoxLayout:
PanelButton:
text: 'Menu'
on_release: Factory.mainMenu().open()
## =============================================================================
## MAIN MENU
## =============================================================================
<mainMenu>:
size_hint: (.8, .8)
canvas:
Color:
rgba: 0,0,0,1
Rectangle:
pos: self.pos
size: self.size
GridLayout:
padding: dp(5)
cols: 1
size_hint: None, None
pos: root.pos
size: root.size
TabbedPanel:
background_color: (0, 0, 0,0)
do_default_tab: False
tab_pos: 'bottom_left'
tab_height: 40*app.scaleFactor
tab_width: 100*app.scaleFactor
MainMenuTab:
text: 'System'
MainMenuLayout:
id: status_panel
BoxLayout:
id: station_panel
orientation: 'vertical'
size_hint: (1,.5)
BoxLayout:
orientation: 'horizontal'
size_hint: (1,.1)
StatusColumn:
size_hint: (.15,1)
text: 'Device'
StatusColumn:
size_hint: (.12,1)
text: 'Status'
StatusColumn:
size_hint: (.22,1)
text: 'Last Observation'
StatusColumn:
size_hint: (.20,1)
text: 'Battery Voltage'
StatusColumn:
size_hint: (.31,1)
text: '24 hr Observation Count'
BoxLayout:
id: device_panel
size_hint: (1, .4)
orientation: 'vertical'
padding: [dp(0), dp(0), dp(0), dp(10)]
BoxLayout:
size_hint: (1, .1)
orientation: 'horizontal'
spacing: dp(10)
padding: [dp(0), dp(0), dp(0), dp(2)]
MenuButton:
text: 'Close'
on_release: root.dismiss(animation=False)
MenuButton:
text: 'Settings'
on_release: app.open_settings()
MenuButton:
text: 'Exit'
on_release: app.stop()
MenuButton:
text: 'Reboot'
on_release: app.reboot_system()
MenuButton:
text: 'Shutdown'
on_release: app.shutdown_system()
MainMenuTab:
text: 'Station'
MainMenuLayout:
BoxLayout:
id: selector_panel
orientation: 'vertical'
padding: [dp(10), dp(10), dp(10), dp(20)]
spacing: dp(10)
MainMenuTab:
text: 'Credits'
MainMenuLayout:
id: credits
CreditsMultilineField:
text:
'Python Console for Weather Flow Tempest and Smart Home Weather Station \n' \
'Code written by Peter Davis. Copyright 2018-2023 \n' \
'GNU General Public License v3.0 \n\n' \
'Graphics inspired by Weather34 Home Weather Station \n' \
'Copyright 2015-2023 Brian Underdown \n' \
'CC Attribution-NonCommercial-NoDerivatives 4.0 International License \n' \
'www.weather34.com/homeweatherstation/ \n\n' \
'Weather forecast data provided by \n' \
'WeatherFlow BetterForecast API \n'