Skip to content

Commit 6bb8a8c

Browse files
Mark option secondsColor as deprecated
1 parent e436e8e commit 6bb8a8c

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ planned for 2025-04-01
1717

1818
- Added Arabic translation.
1919
- Add CSS support to the digital clock hour/minute/second through the use of the classes `clock-hour-digital`, `clock-minute-digital`, and `clock-second-digital`.
20+
- Mark option `secondsColor` as deprecated in clock module.
2021

2122
### Changed
2223

js/app.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,23 @@ function App () {
153153
*/
154154
function checkDeprecatedOptions (userConfig) {
155155
const deprecated = require(`${global.root_path}/js/deprecated`);
156-
const deprecatedOptions = deprecated.configs;
157156

157+
// check for deprecated core options
158+
const deprecatedOptions = deprecated.configs;
158159
const usedDeprecated = deprecatedOptions.filter((option) => userConfig.hasOwnProperty(option));
159160
if (usedDeprecated.length > 0) {
160-
Log.warn(`WARNING! Your config is using deprecated options: ${usedDeprecated.join(", ")}. Check README and CHANGELOG for more up-to-date ways of getting the same functionality.`);
161+
Log.warn(`WARNING! Your config is using deprecated option(s): ${usedDeprecated.join(", ")}. Check README and CHANGELOG for more up-to-date ways of getting the same functionality.`);
162+
}
163+
164+
// check for deprecated module options
165+
for (const element of userConfig.modules) {
166+
if (deprecated[element.module] !== undefined && element.config !== undefined) {
167+
const deprecatedModuleOptions = deprecated[element.module];
168+
const usedDeprecatedModuleOptions = deprecatedModuleOptions.filter((option) => element.config.hasOwnProperty(option));
169+
if (usedDeprecatedModuleOptions.length > 0) {
170+
Log.warn(`WARNING! Your config for module ${element.module} is using deprecated option(s): ${usedDeprecatedModuleOptions.join(", ")}. Check README and CHANGELOG for more up-to-date ways of getting the same functionality.`);
171+
}
172+
}
161173
}
162174
}
163175

js/deprecated.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module.exports = {
2-
configs: ["kioskmode"]
2+
configs: ["kioskmode"],
3+
clock: ["secondsColor"]
34
};

modules/default/clock/clock.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Module.register("clock", {
2323
analogFace: "simple", // options: 'none', 'simple', 'face-###' (where ### is 001 to 012 inclusive)
2424
analogPlacement: "bottom", // options: 'top', 'bottom', 'left', 'right'
2525
analogShowDate: "top", // OBSOLETE, can be replaced with analogPlacement and showTime, options: false, 'top', or 'bottom'
26-
secondsColor: "#888888",
26+
secondsColor: "#888888", // DEPRECATED, use CSS instead. Class "clock-second-digital" for digital clock, "clock-second" for analog clock.
2727

2828
showSunTimes: false,
2929
showMoonTimes: false, // options: false, 'times' (rise/set), 'percent' (lit percent), 'phase' (current phase), or 'both' (percent & phase)

0 commit comments

Comments
 (0)