Skip to content

Commit 4d8006c

Browse files
authored
Add links to migration help on deprecation errors (#270)
1 parent 63c0f49 commit 4d8006c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/parse-config/deprecations.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ export default function getDeprecationError(path: string, value: any) {
77
}
88
function _getDeprecationError(path: string, value: any) {
99
if (path.match(/^no_theme$/))
10-
return "renamed to ha_theme (inverted logic) in v3.0.0";
10+
return `renamed to <a href="https://github.com/dbuezas/lovelace-plotly-graph-card#home-assistant-theming">ha_theme</a> (inverted logic) in v3.0.0`;
1111
if (path.match(/^no_default_layout$/))
12-
return "replaced with more general raw_plotly_config in v3.0.0";
12+
return `replaced with more general <a href="https://github.com/dbuezas/lovelace-plotly-graph-card#raw-plotly-config">raw-plotly-config</a> in v3.0.0. See <a href="https://github.com/dbuezas/lovelace-plotly-graph-card#no_default_layout">layout migration guide</a>.`;
1313
if (path.match(/^offset$/)) return "renamed to time_offset in v3.0.0";
1414
if (path.match(/^entities\.\d+\.offset$/)) {
1515
try {
1616
parseTimeDuration(value);
17-
return 'renamed to time_offset in v3.0.0 to avoid conflicts with <a href="https://plotly.com/javascript/reference/bar/#bar-offset">bar-offsets</a>';
17+
return 'renamed to time_offset in v3.0.0 to avoid conflicts with <a href="https://plotly.com/javascript/reference/bar/#bar-offset">bar-offsets</a>.';
1818
} catch (e) {
1919
// bar-offsets are numbers without time unit
2020
}
2121
}
2222
if (path.match(/^entities\.\d+\.lambda$/))
23-
return "removed in v3.0.0, use filters instead";
23+
return `removed in v3.0.0, use <a href="https://github.com/dbuezas/lovelace-plotly-graph-card#filters">filters</a> instead. See <a href="https://github.com/dbuezas/lovelace-plotly-graph-card#lambda">lambda migration guide</a>.`;
2424
if (path.match(/^entities\.\d+\.show_value\.right_margin$/))
2525
return "removed in v3.0.0, use `true` and set the global `time_offset` or `layout.margins.r` to make space at the right. ";
2626
if (path.match(/^significant_changes_only$/))

0 commit comments

Comments
 (0)