-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample-config.js
85 lines (69 loc) · 2.5 KB
/
sample-config.js
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
// Configuration file for node-nimbus-oww
var config = {};
// Connection parameters to the WinkAPI.
// See this to get credentials (http://www.quirky.com/forums/topic/21462)
config.clientId = "your client ID";
config.clientSecret = "your client secret";
config.login = "your login";
config.passwd = "your password";
// The path to the top level directory containing the weather data from oww. This should be
// the same as the logdir_name in the oww setup file
config.weatherDir = 'your weather data';
// Set up the dials for temp, wind and humidity/barometer
var dials = {};
config.dials = dials;
// A template for the dials
var template = {
dial_template_id: '10',
dial_configuration: {
min_value: 0,
max_value: 360,
min_position: 0,
max_position: 360,
scale_type: 'linear',
rotation: 'cw',
num_ticks: 12
},
channel_configuration: {
channel_id: '10'
},
name: 'Manual control'
};
// The temperature dial displays the current temp as both the label and the positon of the needle
temp = {};
dials.temp = temp;
temp.dial = 1;
temp.props = JSON.parse(JSON.stringify(template));
temp.props.name = "Temp";
temp.props.label = "Temp";
temp.props.dial_configuration.min_value = -40;
temp.props.dial_configuration.max_value = 110;
temp.props.dial_configuration.min_position = -135;
temp.props.dial_configuration.max_position = 135;
temp.props.dial_configuration.num_ticks = 270;
// The wind dial displays the wind speed and text direction as the label and the direction in degrees on
// the needle
wind = {};
dials.wind = wind;
wind.dial = 2;
wind.props = JSON.parse(JSON.stringify(template));
wind.props.name = "Wind";
wind.props.label = "Wind";
wind.props.dial_configuration.min_value = 0;
wind.props.dial_configuration.max_value = 360;
wind.props.dial_configuration.min_position = 0;
wind.props.dial_configuration.max_position = 360;
wind.props.dial_configuration.num_ticks = 360;
// The barometer/humidity displays the barometer in the label and the humidity on the needle
barometer = {};
dials.barometer = barometer;
barometer.dial = 3;
barometer.props = JSON.parse(JSON.stringify(template));
barometer.props.name = "Barometer";
barometer.props.label = "Barometer";
barometer.props.dial_configuration.min_value = 0;
barometer.props.dial_configuration.max_value = 101;
barometer.props.dial_configuration.min_position = -135;
barometer.props.dial_configuration.max_position = 135;
barometer.props.dial_configuration.num_ticks = 270;
module.exports = config;