-
Notifications
You must be signed in to change notification settings - Fork 2
/
HomeAssistantScreen.qml
68 lines (59 loc) · 1.16 KB
/
HomeAssistantScreen.qml
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
import QtQuick 1.1
import BasicUIControls 1.0
import qb.components 1.0
Screen {
id: homeassistantScreen
screenTitleIconUrl: "drawables/hass.png"
screenTitle: qsTr("Home Assistant")
onShown: {
addCustomTopRightButton("Settings");
}
onCustomButtonClicked: {
stage.openFullscreen(app.homeassistantSettingsUrl);
}
Row {
spacing: 10
anchors {
top: parent.top
topMargin: 20
left: parent.left
leftMargin: 32
}
Repeater {
id: groupRepeater
model: app.groups
StandardButton {
id: btnConfigScreen
width: 106
height: 45
text: app.groups[index]
onClicked: {
app.switchSelectedGroup(app.groups[index])
}
}
}
}
Grid {
spacing: 10
columns: 4
rows: 5
visible: true
anchors {
top: parent.top
topMargin: 75
left: parent.left
leftMargin: 32
}
Repeater {
id: switchesRepeater
model: app.devices
SwitchItem {
entity_id: app.devices[index]['entity_id']
friendly_name: app.devices[index]['attributes']['friendly_name']
last_changed: app.devices[index]['last_changed']
last_updated: app.devices[index]['last_updated']
switchState: app.devices[index]['state']
}
}
}
}