1- import QtQuick 1 .1
1+ import QtQuick 2 .1
22import qb.components 1.0
33import qb.base 1.0
44
1010 property int debug : 0
1111
1212 property url tileUrl : " HomeassistantTile.qml" ;
13- property url thumbnailIcon: " ./drawables /homeAssistant.png" ;
13+ property url thumbnailIcon: " qrc:/tsc /homeAssistant.png" ;
1414
1515 property HomeassistantConfigurationScreen homeAssistantConfigurationScreen
1616 property url homeAssistantConfigurationScreenUrl : " HomeassistantConfigurationScreen.qml"
3434
3535 FileIO {
3636 id: tokenFile
37- source: " ./ token.txt"
37+ source: " file:///mnt/data/tsc/homeassistant. token.txt"
3838 }
3939
4040 property variant homeAssistantSettingsJson : {
4646
4747 FileIO {
4848 id: userSettingsFile
49- source: " ./ userSettings.json"
49+ source: " file:///mnt/data/tsc/homeassistant. userSettings.json"
5050 }
5151
5252 property string homeAssistantSensor1 : " "
7171
7272 FileIO {
7373 id: sensorFile
74- source: " ./ sensors.json"
74+ source: " file:///mnt/data/tsc/homeassistant. sensors.json"
7575 }
7676
7777 property variant homeAssistantSensor1Info : []
@@ -108,7 +108,7 @@ App {
108108
109109 FileIO {
110110 id: scenesFile
111- source: " ./ scenes.json"
111+ source: " file:///mnt/data/tsc/homeassistant. scenes.json"
112112 }
113113
114114 property variant homeAssistantScene1Info : []
@@ -129,16 +129,16 @@ App {
129129 property real homeAssistantSlider1Min : 0.0
130130 property real homeAssistantSlider1Step : 0.0
131131 property int homeAssistantSlider1Options : 0
132- property string imgNotSelected : " ./drawables /notselected.png"
133- property string imgSelected : " ./drawables /selected.png"
132+ property string imgNotSelected : " qrc:/tsc /notselected.png"
133+ property string imgSelected : " qrc:/tsc /selected.png"
134134
135135 property variant homeAssistantSlidersJson : {
136136 ' Slider1' : " " ,
137137 }
138138
139139 FileIO {
140140 id: slidersFile
141- source: " ./ sliders.json"
141+ source: " file:///mnt/data/tsc/homeassistant. sliders.json"
142142 }
143143
144144 property variant homeAssistantSlider1Info : []
@@ -163,7 +163,7 @@ App {
163163
164164 FileIO {
165165 id: switchFile
166- source: " ./ switches.json"
166+ source: " file:///mnt/data/tsc/homeassistant. switches.json"
167167 }
168168
169169 property variant homeAssistantSwitch1Info : []
@@ -193,7 +193,7 @@ App {
193193
194194 FileIO {
195195 id: alarmFile
196- source: " ./ alarm.json"
196+ source: " file:///mnt/data/tsc/homeassistant. alarm.json"
197197 }
198198
199199 property string timeStr
@@ -270,7 +270,7 @@ App {
270270 }
271271 catch (err) {
272272 var doc1 = new XMLHttpRequest ();
273- doc1 .open (" PUT" , " file:///HCBv2/qml/apps /homeassistant/ token.txt" );
273+ doc1 .open (" PUT" , " file:///mnt/data/tsc /homeassistant. token.txt" );
274274 doc1 .send (' ' );
275275 logText (" Please verify token.txt. " + err);
276276 }
@@ -296,7 +296,7 @@ App {
296296 " Legacy" : homeAssistantLegacy,
297297 }
298298 var doc2 = new XMLHttpRequest ();
299- doc2 .open (" PUT" , " file:///HCBv2/qml/apps /homeassistant/ userSettings.json" );
299+ doc2 .open (" PUT" , " file:///mnt/data/tsc /homeassistant. userSettings.json" );
300300 doc2 .send (JSON .stringify (homeAssistantSettingsJson));
301301
302302 if (homeAssistantSSL == " yes" ) {
@@ -329,7 +329,7 @@ App {
329329 " Sensor8" : homeAssistantSensor8,
330330 }
331331 var doc3 = new XMLHttpRequest ();
332- doc3 .open (" PUT" , " file:///HCBv2/qml/apps /homeassistant/ sensors.json" );
332+ doc3 .open (" PUT" , " file:///mnt/data/tsc /homeassistant. sensors.json" );
333333 doc3 .send (JSON .stringify (homeAssistantSensorsJson));
334334
335335 getSensorInfo ();
@@ -397,7 +397,7 @@ App {
397397 " Scene4" : homeAssistantScene4,
398398 }
399399 var doc4 = new XMLHttpRequest ();
400- doc4 .open (" PUT" , " file:///HCBv2/qml/apps /homeassistant/ scenes.json" );
400+ doc4 .open (" PUT" , " file:///mnt/data/tsc /homeassistant. scenes.json" );
401401 doc4 .send (JSON .stringify (homeAssistantScenesJson));
402402
403403 getSceneInfo ();
@@ -429,7 +429,7 @@ App {
429429 " Slider1" : homeAssistantSlider1,
430430 }
431431 var doc5 = new XMLHttpRequest ();
432- doc5 .open (" PUT" , " file:///HCBv2/qml/apps /homeassistant/ sliders.json" );
432+ doc5 .open (" PUT" , " file:///mnt/data/tsc /homeassistant. sliders.json" );
433433 doc5 .send (JSON .stringify (homeAssistantSlidersJson));
434434
435435 getSliderInfo ();
@@ -515,7 +515,7 @@ App {
515515 " Switch5" : homeAssistantSwitch5,
516516 }
517517 var doc6 = new XMLHttpRequest ();
518- doc6 .open (" PUT" , " file:///HCBv2/qml/apps /homeassistant/ switches.json" );
518+ doc6 .open (" PUT" , " file:///mnt/data/tsc /homeassistant. switches.json" );
519519 doc6 .send (JSON .stringify (homeAssistantSwitchesJson));
520520
521521 getSwitchInfo ();
@@ -579,7 +579,7 @@ App {
579579 " Code" : homeAssistantAlarm2,
580580 }
581581 var doc7 = new XMLHttpRequest ();
582- doc7 .open (" PUT" , " file:///HCBv2/qml/apps /homeassistant/ alarm.json" );
582+ doc7 .open (" PUT" , " file:///mnt/data/tsc /homeassistant. alarm.json" );
583583 doc7 .send (JSON .stringify (homeAssistantAlarmJson));
584584
585585 getAlarmInfo ();
@@ -657,7 +657,7 @@ App {
657657 }
658658 catch (err) {
659659 var doc8 = new XMLHttpRequest ();
660- doc8 .open (" PUT" , " file:///HCBv2/qml/apps /homeassistant/ token.txt" );
660+ doc8 .open (" PUT" , " file:///mnt/data/tsc /homeassistant. token.txt" );
661661 doc8 .send (' ' );
662662 logText (" Please add access token to token.txt. " + err);
663663 }
0 commit comments