@@ -20,7 +20,7 @@ import Unity.Test 0.1 as UT
20import Unity.Indicators 0.1 as Indicators
20import Unity.Indicators 0.1 as Indicators
21import Ubuntu.Components 1.3
21import Ubuntu.Components 1.3
22import Powerd 0.1
22import Powerd 0.1
23−import Lights 0.1
23+import Hfd 0.1
24import QMenuModel 0.1
24import QMenuModel 0.1
25import "../../../../qml/Panel/Indicators"
25import "../../../../qml/Panel/Indicators"
@@ -75,7 +75,7 @@ Item {
75 radius: width / 2
75 radius: width / 2
76 anchors.centerIn: parent
76 anchors.centerIn: parent
78− color: Lights.state === Lights.On ? Lights.color : "transparent"
78+ color: Leds.state === Leds.On ? Leds.color : "transparent"
80 border.color: "black"
80 border.color: "black"
81 border.width: 1
81 border.width: 1
@@ -162,79 +162,79 @@ Item {
163 // new messages
163 // new messages
165− { tag: "Powerd.On with No Message", powerd: Powerd.On, actionData: noNewMessage, expectedLightsState: Lights.Off },
165+ { tag: "Powerd.On with No Message", powerd: Powerd.On, actionData: noNewMessage, expectedLightsState: Leds.Off },
166− { tag: "Powerd.Off with No Message", powerd: Powerd.Off, actionData: noNewMessage, expectedLightsState: Lights.Off },
166+ { tag: "Powerd.Off with No Message", powerd: Powerd.Off, actionData: noNewMessage, expectedLightsState: Leds.Off },
167− { tag: "Powerd.On with New Message", powerd: Powerd.On, actionData: newMessage, expectedLightsState: Lights.Off },
167+ { tag: "Powerd.On with New Message", powerd: Powerd.On, actionData: newMessage, expectedLightsState: Leds.Off },
168− { tag: "Powerd.Off with New Message", powerd: Powerd.Off, actionData: newMessage, expectedLightsState: Lights.On },
168+ { tag: "Powerd.Off with New Message", powerd: Powerd.Off, actionData: newMessage, expectedLightsState: Leds.On },
171 // show charging
171 // show charging
173 { tag: "Powerd.Off while charging",
173 { tag: "Powerd.Off while charging",
174− expectedLightsState: Lights.On,
174+ expectedLightsState: Leds.On,
175 powerd: Powerd.Off, actionData: deviceStateDBusSignals.charging },
175 powerd: Powerd.Off, actionData: deviceStateDBusSignals.charging },
177 { tag: "Powerd.On while charging",
177 { tag: "Powerd.On while charging",
178− expectedLightsState: Lights.Off,
178+ expectedLightsState: Leds.Off,
179 powerd: Powerd.On, actionData: deviceStateDBusSignals.charging },
179 powerd: Powerd.On, actionData: deviceStateDBusSignals.charging },
181 { tag: "Powerd.On while charging",
181 { tag: "Powerd.On while charging",
182− expectedLightsState: Lights.Off,
182+ expectedLightsState: Leds.Off,
183 powerd: Powerd.On, wizardStatus: batteryIconNames.charging },
183 powerd: Powerd.On, wizardStatus: batteryIconNames.charging },
186 // show charging and full
186 // show charging and full
188 { tag: "Powerd.Off while charging and battery full",
188 { tag: "Powerd.Off while charging and battery full",
189− expectedLightsState: Lights.On, expectedLightsColor: green,
189+ expectedLightsState: Leds.On, expectedLightsColor: green,
190 powerd: Powerd.Off, actionData: deviceStateDBusSignals.fullyCharged },
190 powerd: Powerd.Off, actionData: deviceStateDBusSignals.fullyCharged },
192 { tag: "Powerd.On while charging and battery full",
192 { tag: "Powerd.On while charging and battery full",
193− expectedLightsState: Lights.Off,
193+ expectedLightsState: Leds.Off,
194 powerd: Powerd.On, actionData: deviceStateDBusSignals.fullyCharged },
194 powerd: Powerd.On, actionData: deviceStateDBusSignals.fullyCharged },
196 { tag: "Powerd.Off while discharging and battery full",
196 { tag: "Powerd.Off while discharging and battery full",
197− expectedLightsState: Lights.Off,
197+ expectedLightsState: Leds.Off,
198 powerd: Powerd.Off, actionData: deviceStateDBusSignals.discharging, wizardStatus: batteryIconNames.fullyCharged },
198 powerd: Powerd.Off, actionData: deviceStateDBusSignals.discharging, wizardStatus: batteryIconNames.fullyCharged },
201 // show empty
201 // show empty
203 { tag: "Powerd.Off while discharging and battery empty",
203 { tag: "Powerd.Off while discharging and battery empty",
204− expectedLightsState: Lights.On, expectedLightsColor: orangeRed,
204+ expectedLightsState: Leds.On, expectedLightsColor: orangeRed,
205 powerd: Powerd.Off, wizardStatus: batteryIconNames.caution },
205 powerd: Powerd.Off, wizardStatus: batteryIconNames.caution },
207 { tag: "Powerd.On while discharging and battery empty",
207 { tag: "Powerd.On while discharging and battery empty",
208− expectedLightsState: Lights.Off,
208+ expectedLightsState: Leds.Off,
209 powerd: Powerd.On, wizardStatus: batteryIconNames.caution },
209 powerd: Powerd.On, wizardStatus: batteryIconNames.caution },
211 { tag: "Powerd.On while discharging and battery empty",
211 { tag: "Powerd.On while discharging and battery empty",
212− expectedLightsState: Lights.Off,
212+ expectedLightsState: Leds.Off,
213 powerd: Powerd.On, wizardStatus: batteryIconNames.empty },
213 powerd: Powerd.On, wizardStatus: batteryIconNames.empty },
215 { tag: "Powerd.Off while charging and battery empty",
215 { tag: "Powerd.Off while charging and battery empty",
216− expectedLightsState: Lights.On, expectedLightsColor: white,
216+ expectedLightsState: Leds.On, expectedLightsColor: white,
217 powerd: Powerd.Off, actionData: deviceStateDBusSignals.charging },
217 powerd: Powerd.Off, actionData: deviceStateDBusSignals.charging },
220 // new message has highest priority
220 // new message has highest priority
222 { tag: "Powerd.Off with New Message, discharging and battery empty",
222 { tag: "Powerd.Off with New Message, discharging and battery empty",
223− expectedLightsState: Lights.On,
223+ expectedLightsState: Leds.On,
224 expectedLightsColor: darkGreen,
224 expectedLightsColor: darkGreen,
225 expectedLightsOnMillisec: 1000,
225 expectedLightsOnMillisec: 1000,
226 expectedLightsOffMillisec: 3000,
226 expectedLightsOffMillisec: 3000,
227 powerd: Powerd.Off, actionData: newMessage, wizardStatus: batteryIconNames.caution },
227 powerd: Powerd.Off, actionData: newMessage, wizardStatus: batteryIconNames.caution },
229 { tag: "Powerd.Off with New Message and charging",
229 { tag: "Powerd.Off with New Message and charging",
230− expectedLightsState: Lights.On,
230+ expectedLightsState: Leds.On,
231 expectedLightsColor: darkGreen,
231 expectedLightsColor: darkGreen,
232 expectedLightsOnMillisec: 1000,
232 expectedLightsOnMillisec: 1000,
233 expectedLightsOffMillisec: 3000,
233 expectedLightsOffMillisec: 3000,
234 powerd: Powerd.Off, actionData: combinedDBusSignals.hasMessageAndCharging },
234 powerd: Powerd.Off, actionData: combinedDBusSignals.hasMessageAndCharging },
236 { tag: "Powerd.Off with New Message, charging and battery full",
236 { tag: "Powerd.Off with New Message, charging and battery full",
237− expectedLightsState: Lights.On,
237+ expectedLightsState: Leds.On,
238 expectedLightsColor: darkGreen,
238 expectedLightsColor: darkGreen,
239 expectedLightsOnMillisec: 1000,
239 expectedLightsOnMillisec: 1000,
240 expectedLightsOffMillisec: 3000,
240 expectedLightsOffMillisec: 3000,
@@ -244,11 +244,11 @@ Item {
244 // use battery level
244 // use battery level
246 { tag: "Powerd.Off while charging and battery level at 80%",
246 { tag: "Powerd.Off while charging and battery level at 80%",
247− expectedLightsState: Lights.On, expectedLightsColor: white,
247+ expectedLightsState: Leds.On, expectedLightsColor: white,
248 powerd: Powerd.Off, actionData: batteryLevelDBusSignals["80"], wizardStatus: batteryIconNames.charging },
248 powerd: Powerd.Off, actionData: batteryLevelDBusSignals["80"], wizardStatus: batteryIconNames.charging },
250 { tag: "Powerd.Off while charging and battery level at 100%",
250 { tag: "Powerd.Off while charging and battery level at 100%",
251− expectedLightsState: Lights.On, expectedLightsColor: green,
251+ expectedLightsState: Leds.On, expectedLightsColor: green,
252 expectedLightsOnMillisec: 1000,
252 expectedLightsOnMillisec: 1000,
253 expectedLightsOffMillisec: 0,
253 expectedLightsOffMillisec: 0,
254 powerd: Powerd.Off, actionData: batteryLevelDBusSignals["100"], wizardStatus: batteryIconNames.charging },
254 powerd: Powerd.Off, actionData: batteryLevelDBusSignals["100"], wizardStatus: batteryIconNames.charging },
@@ -257,13 +257,13 @@ Item {
257 // Support for Multicolor LED
257 // Support for Multicolor LED
259 { tag: "Powerd.Off with New Message & no support for multicolor led",
259 { tag: "Powerd.Off with New Message & no support for multicolor led",
260− expectedLightsState: Lights.On,
260+ expectedLightsState: Leds.On,
261 powerd: Powerd.Off, actionData: newMessage, supportsMultiColorLed: false },
261 powerd: Powerd.Off, actionData: newMessage, supportsMultiColorLed: false },
262 { tag: "Powerd.Off while charging & support for multicolor led",
262 { tag: "Powerd.Off while charging & support for multicolor led",
263− expectedLightsState: Lights.On,
263+ expectedLightsState: Leds.On,
264 powerd: Powerd.Off, actionData: deviceStateDBusSignals.charging, supportsMultiColorLed: true },
264 powerd: Powerd.Off, actionData: deviceStateDBusSignals.charging, supportsMultiColorLed: true },
265 { tag: "Powerd.Off while charging & no support for multicolor led",
265 { tag: "Powerd.Off while charging & no support for multicolor led",
266− expectedLightsState: Lights.Off,
266+ expectedLightsState: Leds.Off,
267 powerd: Powerd.Off, actionData: deviceStateDBusSignals.charging, supportsMultiColorLed: false },
267 powerd: Powerd.Off, actionData: deviceStateDBusSignals.charging, supportsMultiColorLed: false },
@@ -280,13 +280,13 @@ Item {
280 if (data.hasOwnProperty("wizardStatus"))
280 if (data.hasOwnProperty("wizardStatus"))
281 loader.item.batteryIconName = data.wizardStatus
281 loader.item.batteryIconName = data.wizardStatus
283− compare(Lights.state, data.expectedLightsState, "Lights state does not match expected value");
283+ compare(Leds.state, data.expectedLightsState, "Lights state does not match expected value");
284 if (data.hasOwnProperty("expectedLightsColor"))
284 if (data.hasOwnProperty("expectedLightsColor"))
285− compare(Lights.color, data.expectedLightsColor, "Lights color does not match expected value")
285+ compare(Leds.color, data.expectedLightsColor, "Lights color does not match expected value")
286 if (data.hasOwnProperty("expectedLightsOnMillisec"))
286 if (data.hasOwnProperty("expectedLightsOnMillisec"))
287− compare(Lights.onMillisec, data.expectedLightsOnMillisec, "Lights OnMillisec does not match expected value")
287+ compare(Leds.onMillisec, data.expectedLightsOnMillisec, "Lights OnMillisec does not match expected value")
288 if (data.hasOwnProperty("expectedLightsOffMillisec"))
288 if (data.hasOwnProperty("expectedLightsOffMillisec"))
289− compare(Lights.offMillisec, data.expectedLightsOffMillisec, "Lights OffMillisec does not match expected value")
289+ compare(Leds.offMillisec, data.expectedLightsOffMillisec, "Lights OffMillisec does not match expected value")