-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes
131 lines (96 loc) · 3.61 KB
/
notes
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
//
//
// openHAB iOS User Interface
// Copyright © 2011 Pablo Romeu
//
// 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/>.
TO DO:
- IMAGES FOR ROLLERSHUTTERS
- See http://code.google.com/p/openhab/wiki/Security LOGIN and HTTPS
- Server and sitemap cells in master or Hide
- MJPEG not working - Solve image error: should timeout if image is not retrieved
- Refresh items too...
- Fast setup wiki
How the model works:
- openhab manages everything
--- openhabItem is an item/group
--- openhabWidget is a widget/s
---> restqueue calls commlibrary and creates a request queue
--------> commLibrary executes the calls
ITEMS GRAMAR
------------
rammar org.openhab.model.Items with org.eclipse.xtext.common.Terminals
generate items "http://www.openhab.org/model/Items"
ItemModel :
{ItemModel} (items+=ModelItem)*
;
ModelItem :
(ModelNormalItem | ModelGroupItem) name=ID
(label=STRING)?
('<' icon=(ID|STRING) '>')?
('(' groups+=[ModelGroupItem] (',' groups+=[ModelGroupItem])* ')')?
('{' bindings+=ModelBinding (',' bindings+=ModelBinding)* '}')?
;
ModelGroupItem :
{ModelGroupItem} 'Group' (':' type=ModelItemType ( ':' function=ModelGroupFunction ('(' args+=(ID|STRING) (',' args+=(ID|STRING))* ')')?)?)?
;
enum ModelGroupFunction :
AND='AND' | OR='OR' | AVG='AVG' | MAX='MAX' | MIN='MIN'
;
ModelNormalItem :
type=ModelItemType
;
ModelItemType :
'Switch' | 'Rollershutter' | 'Number' | 'String' | 'Dimmer' | 'Contact' | 'DateTime'
;
ModelBinding:
type=ID '=' configuration=STRING
;
WIDGET GRAMMAR
--------------
grammar org.openhab.model.Sitemap with org.eclipse.xtext.common.Terminals
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
generate sitemap "http://www.openhab.org/model/Sitemap"
SitemapModel :
'sitemap' Sitemap;
Sitemap :
name=ID ('label=' label=STRING)? ('icon=' icon=STRING)? '{'
(children+=Widget)+
'}';
Widget :
(LinkableWidget | ((Switch | Selection | Slider | List) ));
LinkableWidget :
(Text | Group | Image | Frame) ('label=' label=(ID|STRING))? ('icon=' icon=(ID|STRING))?
('{'
(children+=Widget)+
'}')?;
Frame : 'Frame' {Frame} ('item=' item=ID)?;
Text :
'Text' {Text} ('item=' item=ID)?;
Group :
'Group' ('item=' item=ID);
Image :
'Image' ('item=' item=ID)? ('url=' url=(STRING));
Switch :
'Switch' ('item=' item=ID) ('label=' label=(ID|STRING))? ('icon=' icon=(ID|STRING))? ('mappings=[' mappings+=Mapping (',' mappings+=Mapping)* ']')?;
Slider :
'Slider' ('item=' item=ID) ('label=' label=(ID|STRING))? ('icon=' icon=(ID|STRING))? ('sendFrequency=' frequency=ID)? (switchEnabled?='switchSupport')?;
Selection :
'Selection' ('item=' item=ID) ('label=' label=(ID|STRING))? ('icon=' icon=(ID|STRING))? ('mappings=[' mappings+=Mapping (',' mappings+=Mapping)* ']')?;
List :
'List' ('item=' item=ID) ('label=' label=(ID|STRING))? ('icon=' icon=(ID|STRING))? ('separator=' separator=STRING);
Mapping :
cmd=(ID|STRING) '=' label=(ID|STRING);
terminal ID : '^'?('a'..'z'|'A'..'Z'|'_'|'0'..'9')+;
terminal INT returns ecore::EInt: '/*deactivate int definition as we dont need it*/';