-
Notifications
You must be signed in to change notification settings - Fork 261
fix: Migrate to ha-spinner #1234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I currently have no means to check this. From the source, it looks like a rather simple fix. So, I'll trust that it works. I'm not sure how to handle different HA versions, though. The new spinner will not work with older versions, I guess. Should we just "fix" it and hint on the version, where the change happened? Or keep both spinners for some time? Or check the version? I think, I'd prefer the first way... |
I just remembered that we've released pre-released only so far. So, it's not a breaking change (in relation to the main releases). I'm even finer to just fix it and not even hint on the version compatibility. |
you are right. Cannot give a ready solution, away from PC. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. After reviewing, I think, we should only support the most recent version; at least actively. We'll run in all sorts of trouble, if we start to make distinctions by versions. And we'll have to decide up to which version to support.
Finally, if this feature would have been proposed only now, we'd not even consider how to support older versions.
What do you think?
src/main.js
Outdated
&& this.config.entities[index].show_graph !== false, | ||
)) | ||
|| this.config.show.loading_indicator === false; | ||
const loadingElement = isPre2025_5(this._hass) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we really need to make this distinction. Couldn't we just put both tags in the card. Only one will be shown, because the other is not defined?
Or we wait another month and only insert the new spinner?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we just put both tags in the card. Only one will be shown, because the other is not defined?
Seems that currently only one spinner (the latest one) is available in HA. So, see no need to wait a month.
src/utils.js
Outdated
console.warn('mini-graph-card: ', message); | ||
}; | ||
|
||
const isPre2025_5 = hass => hass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be false for things like 2024.6
. If we really want to handle versions differently, we should maybe make this more generic to compare arbitrary versions, like isVersionBefore('2025.4.1', '2025.5')
?
But it will be complicated and we'll be starting to support old versions. Considering this, I think, we should take the decision to just support the most recent version. At least actively.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, the whole function must be revised.
(if we decide to support older versions)
It is easier not to support old HA versions, and we have no idea what happens to HA tomorrow... We can just remove that old indicator. Less headache. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
# [0.13.0](v0.12.1...v0.13.0) (2025-05-29) ### Bug Fixes * adapt state color to tooltip properties ([#1214](#1214)) ([1142f25](1142f25)) * computeUom() for attribute & empty unit ([#1236](#1236)) ([436b9a9](436b9a9)) * deprecated paper-item-icon-color ([#1247](#1247)) ([2e99db5](2e99db5)) * hide graph loading indicator when appropriate ([#1197](#1197)) ([d708d6a](d708d6a)) * indicator style for the 1st state ([#1105](#1105)) ([c0ad333](c0ad333)) * legend indicators respect entity attribute configuration ([#1115](#1115)) ([5fe01d1](5fe01d1)) * legend unit percent w/o whitespace ([#1191](#1191)) ([9f5cfd9](9f5cfd9)) * migrate to ha-spinner ([#1234](#1234)) ([d68f651](d68f651)) * more intuitive min_bound_range behavior ([#1136](#1136)) ([54d9875](54d9875)) * name and icon color respect attribute choice ([#1131](#1131)) ([cbfba7a](cbfba7a)) * padding fill ([#1238](#1238)) ([f930fa6](f930fa6)) * process absent UoM in computeLegend() ([#1237](#1237)) ([5724cfd](5724cfd)) * remove unused argument from getBoundary ([#1193](#1193)) ([f5261d9](f5261d9)) * use a proper config in renderState() ([#1217](#1217)) ([c980460](c980460)) * use d3 to interpolate colors ([#1118](#1118)) ([b8676f5](b8676f5)) ### Features * add "tooltip--label" class ([#1202](#1202)) ([0d3c184](0d3c184)) * Add loader ([#1180](#1180)) ([30c5263](30c5263)) * add show_legend_state ([#1173](#1173)) ([3b1c827](3b1c827))
🎉 This PR is included in version 0.13.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
# 1.0.0 (2025-06-01) ### Bug Fixes * adapt state color to tooltip properties ([kalkih#1214](https://github.com/brozikcz/mini-graph-card/issues/1214)) ([1142f25](1142f25)) * add first datapoint tooltip for line graph ([kalkih#882](https://github.com/brozikcz/mini-graph-card/issues/882)) ([7576fe6](7576fe6)) * allow zero tooltip ([057a395](057a395)), closes [kalkih#805](https://github.com/brozikcz/mini-graph-card/issues/805) * cards would always assume icon_image was set ([kalkih#957](https://github.com/brozikcz/mini-graph-card/issues/957)) ([f376732](f376732)) * computeUom() for attribute & empty unit ([kalkih#1236](https://github.com/brozikcz/mini-graph-card/issues/1236)) ([436b9a9](436b9a9)) * deprecated paper-item-icon-color ([kalkih#1247](https://github.com/brozikcz/mini-graph-card/issues/1247)) ([2e99db5](2e99db5)) * display a warning if entity is not available ([kalkih#545](https://github.com/brozikcz/mini-graph-card/issues/545)) ([a334b84](a334b84)), closes [kalkih#487](https://github.com/brozikcz/mini-graph-card/issues/487) * drop out-of-bound coords in reducer ([kalkih#881](https://github.com/brozikcz/mini-graph-card/issues/881)) ([527f005](527f005)), closes [kalkih#251](https://github.com/brozikcz/mini-graph-card/issues/251) * Fix undefined variable introduced by [kalkih#545](https://github.com/brozikcz/mini-graph-card/issues/545) ([9e923f5](9e923f5)) * hide graph loading indicator when appropriate ([kalkih#1197](https://github.com/brozikcz/mini-graph-card/issues/1197)) ([d708d6a](d708d6a)) * icon will properly follow entity's device_class [[kalkih#484](https://github.com/brozikcz/mini-graph-card/issues/484)] ([2f9e0a7](2f9e0a7)) * indicator style for the 1st state ([kalkih#1105](https://github.com/brozikcz/mini-graph-card/issues/1105)) ([c0ad333](c0ad333)) * legend indicators respect entity attribute configuration ([kalkih#1115](https://github.com/brozikcz/mini-graph-card/issues/1115)) ([5fe01d1](5fe01d1)) * legend unit percent w/o whitespace ([kalkih#1191](https://github.com/brozikcz/mini-graph-card/issues/1191)) ([9f5cfd9](9f5cfd9)) * migrate to ha-spinner ([kalkih#1234](https://github.com/brozikcz/mini-graph-card/issues/1234)) ([d68f651](d68f651)) * more intuitive min_bound_range behavior ([kalkih#1136](https://github.com/brozikcz/mini-graph-card/issues/1136)) ([54d9875](54d9875)) * name and icon color respect attribute choice ([kalkih#1131](https://github.com/brozikcz/mini-graph-card/issues/1131)) ([cbfba7a](cbfba7a)) * padding fill ([kalkih#1238](https://github.com/brozikcz/mini-graph-card/issues/1238)) ([f930fa6](f930fa6)) * process absent UoM in computeLegend() ([kalkih#1237](https://github.com/brozikcz/mini-graph-card/issues/1237)) ([5724cfd](5724cfd)) * remove unused argument from getBoundary ([kalkih#1193](https://github.com/brozikcz/mini-graph-card/issues/1193)) ([f5261d9](f5261d9)) * retain the last out-of-bounds state ([kalkih#961](https://github.com/brozikcz/mini-graph-card/issues/961)) ([8ebe173](8ebe173)), closes [kalkih#881](https://github.com/brozikcz/mini-graph-card/issues/881) [kalkih#960](https://github.com/brozikcz/mini-graph-card/issues/960) * Support for `fire-dom-event` ([c29f55f](c29f55f)), closes [kalkih#563](https://github.com/brozikcz/mini-graph-card/issues/563) * Time would sometime display 24:xx instead of 00:xx [[kalkih#536](https://github.com/brozikcz/mini-graph-card/issues/536)] ([7c7d921](7c7d921)) * tooltip interval start could be after end ([kalkih#1065](https://github.com/brozikcz/mini-graph-card/issues/1065)) ([930ee39](930ee39)), closes [kalkih#181](https://github.com/brozikcz/mini-graph-card/issues/181) * use a proper config in renderState() ([kalkih#1217](https://github.com/brozikcz/mini-graph-card/issues/1217)) ([c980460](c980460)) * use d3 to interpolate colors ([kalkih#1118](https://github.com/brozikcz/mini-graph-card/issues/1118)) ([b8676f5](b8676f5)) * **config:** Remove entity config error [kalkih#592](https://github.com/brozikcz/mini-graph-card/issues/592) ([kalkih#593](https://github.com/brozikcz/mini-graph-card/issues/593)) ([53d923a](53d923a)) * **documentation:** enquote html color ([dbdeab8](dbdeab8)), closes [kalkih#872](https://github.com/brozikcz/mini-graph-card/issues/872) * **log:** color_thresholds render incorectly with logaritmic on ([kalkih#542](https://github.com/brozikcz/mini-graph-card/issues/542)) ([b704885](b704885)), closes [kalkih#531](https://github.com/brozikcz/mini-graph-card/issues/531) * **stalebot:** issues should also use exemptLabels ([4d74c1f](4d74c1f)) * **workflows:** remove invalid description field ([e755e24](e755e24)) ### Features * add "tooltip--label" class ([kalkih#1202](https://github.com/brozikcz/mini-graph-card/issues/1202)) ([0d3c184](0d3c184)) * Add loader ([kalkih#1180](https://github.com/brozikcz/mini-graph-card/issues/1180)) ([30c5263](30c5263)) * add show_legend_state ([kalkih#1173](https://github.com/brozikcz/mini-graph-card/issues/1173)) ([3b1c827](3b1c827)) * Add support of attribute tree when available ([kalkih#996](https://github.com/brozikcz/mini-graph-card/issues/996)) ([9c1c31e](9c1c31e)) * Format numbers according to selected language [[kalkih#495](https://github.com/brozikcz/mini-graph-card/issues/495) [kalkih#509](https://github.com/brozikcz/mini-graph-card/issues/509)] ([5785bd8](5785bd8)) * pull two years worth of changes into release channel ([f5fb98d](f5fb98d)), closes [kalkih#1059](https://github.com/brozikcz/mini-graph-card/issues/1059) * **attribute:** Retrieve an attribute instead of the state ([kalkih#564](https://github.com/brozikcz/mini-graph-card/issues/564)) ([708bfde](708bfde)), closes [kalkih#411](https://github.com/brozikcz/mini-graph-card/issues/411) [kalkih#245](https://github.com/brozikcz/mini-graph-card/issues/245) [kalkih#501](https://github.com/brozikcz/mini-graph-card/issues/501) * **graph:** Add median aggregate function ([kalkih#521](https://github.com/brozikcz/mini-graph-card/issues/521)) ([57219bd](57219bd)) * **option:** override icon with an image URL ([kalkih#789](https://github.com/brozikcz/mini-graph-card/issues/789)) ([2860a09](2860a09)) * Interpolate color threshold stops ([kalkih#596](https://github.com/brozikcz/mini-graph-card/issues/596)) ([3826c0d](3826c0d))
# 1.0.0 (2025-10-16) ### Bug Fixes * adapt state color to tooltip properties ([kalkih#1214](https://github.com/bladeke/mini-graph-card/issues/1214)) ([1142f25](1142f25)) * add first datapoint tooltip for line graph ([kalkih#882](https://github.com/bladeke/mini-graph-card/issues/882)) ([7576fe6](7576fe6)) * allow zero tooltip ([057a395](057a395)), closes [kalkih#805](https://github.com/bladeke/mini-graph-card/issues/805) * cards would always assume icon_image was set ([kalkih#957](https://github.com/bladeke/mini-graph-card/issues/957)) ([f376732](f376732)) * changed repo in package.json to my fork ([a2b63f7](a2b63f7)) * computeUom() for attribute & empty unit ([kalkih#1236](https://github.com/bladeke/mini-graph-card/issues/1236)) ([436b9a9](436b9a9)) * deprecated paper-item-icon-color ([kalkih#1247](https://github.com/bladeke/mini-graph-card/issues/1247)) ([2e99db5](2e99db5)) * display a warning if entity is not available ([kalkih#545](https://github.com/bladeke/mini-graph-card/issues/545)) ([a334b84](a334b84)), closes [kalkih#487](https://github.com/bladeke/mini-graph-card/issues/487) * drop out-of-bound coords in reducer ([kalkih#881](https://github.com/bladeke/mini-graph-card/issues/881)) ([527f005](527f005)), closes [kalkih#251](https://github.com/bladeke/mini-graph-card/issues/251) * Fix undefined variable introduced by [kalkih#545](https://github.com/bladeke/mini-graph-card/issues/545) ([9e923f5](9e923f5)) * hide graph loading indicator when appropriate ([kalkih#1197](https://github.com/bladeke/mini-graph-card/issues/1197)) ([d708d6a](d708d6a)) * icon will properly follow entity's device_class [[kalkih#484](https://github.com/bladeke/mini-graph-card/issues/484)] ([2f9e0a7](2f9e0a7)) * indicator style for the 1st state ([kalkih#1105](https://github.com/bladeke/mini-graph-card/issues/1105)) ([c0ad333](c0ad333)) * legend indicators respect entity attribute configuration ([kalkih#1115](https://github.com/bladeke/mini-graph-card/issues/1115)) ([5fe01d1](5fe01d1)) * legend unit percent w/o whitespace ([kalkih#1191](https://github.com/bladeke/mini-graph-card/issues/1191)) ([9f5cfd9](9f5cfd9)) * lint errors ([63e4a60](63e4a60)) * migrate to ha-spinner ([kalkih#1234](https://github.com/bladeke/mini-graph-card/issues/1234)) ([d68f651](d68f651)) * more intuitive min_bound_range behavior ([kalkih#1136](https://github.com/bladeke/mini-graph-card/issues/1136)) ([54d9875](54d9875)) * name and icon color respect attribute choice ([kalkih#1131](https://github.com/bladeke/mini-graph-card/issues/1131)) ([cbfba7a](cbfba7a)) * padding fill ([kalkih#1238](https://github.com/bladeke/mini-graph-card/issues/1238)) ([f930fa6](f930fa6)) * process absent UoM in computeLegend() ([kalkih#1237](https://github.com/bladeke/mini-graph-card/issues/1237)) ([5724cfd](5724cfd)) * remove unused argument from getBoundary ([kalkih#1193](https://github.com/bladeke/mini-graph-card/issues/1193)) ([f5261d9](f5261d9)) * retain the last out-of-bounds state ([kalkih#961](https://github.com/bladeke/mini-graph-card/issues/961)) ([8ebe173](8ebe173)), closes [kalkih#881](https://github.com/bladeke/mini-graph-card/issues/881) [kalkih#960](https://github.com/bladeke/mini-graph-card/issues/960) * Support for `fire-dom-event` ([c29f55f](c29f55f)), closes [kalkih#563](https://github.com/bladeke/mini-graph-card/issues/563) * Time would sometime display 24:xx instead of 00:xx [[kalkih#536](https://github.com/bladeke/mini-graph-card/issues/536)] ([7c7d921](7c7d921)) * tooltip interval start could be after end ([kalkih#1065](https://github.com/bladeke/mini-graph-card/issues/1065)) ([930ee39](930ee39)), closes [kalkih#181](https://github.com/bladeke/mini-graph-card/issues/181) * use a proper config in renderState() ([kalkih#1217](https://github.com/bladeke/mini-graph-card/issues/1217)) ([c980460](c980460)) * use d3 to interpolate colors ([kalkih#1118](https://github.com/bladeke/mini-graph-card/issues/1118)) ([b8676f5](b8676f5)) * **config:** Remove entity config error [kalkih#592](https://github.com/bladeke/mini-graph-card/issues/592) ([kalkih#593](https://github.com/bladeke/mini-graph-card/issues/593)) ([53d923a](53d923a)) * **documentation:** enquote html color ([dbdeab8](dbdeab8)), closes [kalkih#872](https://github.com/bladeke/mini-graph-card/issues/872) * **log:** color_thresholds render incorectly with logaritmic on ([kalkih#542](https://github.com/bladeke/mini-graph-card/issues/542)) ([b704885](b704885)), closes [kalkih#531](https://github.com/bladeke/mini-graph-card/issues/531) * **stalebot:** issues should also use exemptLabels ([4d74c1f](4d74c1f)) * **workflows:** remove invalid description field ([e755e24](e755e24)) ### Features * add "tooltip--label" class ([kalkih#1202](https://github.com/bladeke/mini-graph-card/issues/1202)) ([0d3c184](0d3c184)) * Add loader ([kalkih#1180](https://github.com/bladeke/mini-graph-card/issues/1180)) ([30c5263](30c5263)) * add show_legend_state ([kalkih#1173](https://github.com/bladeke/mini-graph-card/issues/1173)) ([3b1c827](3b1c827)) * Add support of attribute tree when available ([kalkih#996](https://github.com/bladeke/mini-graph-card/issues/996)) ([9c1c31e](9c1c31e)) * added dynamic threshold color function ([8312879](8312879)) * Format numbers according to selected language [[kalkih#495](https://github.com/bladeke/mini-graph-card/issues/495) [kalkih#509](https://github.com/bladeke/mini-graph-card/issues/509)] ([5785bd8](5785bd8)) * Interpolate color threshold stops ([kalkih#596](https://github.com/bladeke/mini-graph-card/issues/596)) ([3826c0d](3826c0d)) * pull two years worth of changes into release channel ([f5fb98d](f5fb98d)), closes [kalkih#1059](https://github.com/bladeke/mini-graph-card/issues/1059) * **attribute:** Retrieve an attribute instead of the state ([kalkih#564](https://github.com/bladeke/mini-graph-card/issues/564)) ([708bfde](708bfde)), closes [kalkih#411](https://github.com/bladeke/mini-graph-card/issues/411) [kalkih#245](https://github.com/bladeke/mini-graph-card/issues/245) [kalkih#501](https://github.com/bladeke/mini-graph-card/issues/501) * **graph:** Add median aggregate function ([kalkih#521](https://github.com/bladeke/mini-graph-card/issues/521)) ([57219bd](57219bd)) * **option:** override icon with an image URL ([kalkih#789](https://github.com/bladeke/mini-graph-card/issues/789)) ([2860a09](2860a09))
Implements #1222
The old
ha-circular-progress
was removed from HA (https://github.com/home-assistant/frontend/releases/tag/20250326.0).