Skip to content

Commit a65c8f3

Browse files
authored
Merge branch 'dev' into picture-card-image
2 parents cc557f7 + fdb4de9 commit a65c8f3

30 files changed

+807
-643
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
- [ ] I understand the code I am submitting and can explain how it works.
7070
- [ ] The code change is tested and works locally.
7171
- [ ] There is no commented out code in this PR.
72-
- [ ] I have followed the [development checklist][dev-checklist]
7372
- [ ] I have followed the [perfect PR recommendations][perfect-pr]
7473
- [ ] Any generated code has been carefully reviewed for correctness and compliance with project standards.
7574

@@ -105,6 +104,5 @@ To help with the load of incoming pull requests:
105104
106105
Below, some useful links you could explore:
107106
-->
108-
[dev-checklist]: https://developers.home-assistant.io/docs/development_checklist/
109107
[docs-repository]: https://github.com/home-assistant/home-assistant.io
110108
[perfect-pr]: https://developers.home-assistant.io/docs/review-process/#creating-the-perfect-pr
Lines changed: 288 additions & 288 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ enableGlobalCache: false
88

99
nodeLinker: node-modules
1010

11-
yarnPath: .yarn/releases/yarn-4.13.0.cjs
11+
yarnPath: .yarn/releases/yarn-4.14.1.cjs

gallery/src/pages/lovelace/gauge-card.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,38 @@ const CONFIGS = [
149149
max: 1.9
150150
unit: GBP/h`,
151151
},
152+
{
153+
heading: "A lot of segments",
154+
config: `
155+
- type: gauge
156+
needle: true
157+
name: Percent gauge
158+
entity: sensor.brightness_high
159+
unit: "%"
160+
min: 0
161+
max: 100
162+
segments:
163+
- from: 0
164+
color: "#db4437"
165+
- from: 10
166+
color: "#cc4d39"
167+
- from: 20
168+
color: "#bd563a"
169+
- from: 30
170+
color: "#ad603c"
171+
- from: 40
172+
color: "#9e693d"
173+
- from: 50
174+
color: "#8f723f"
175+
- from: 60
176+
color: "#807b41"
177+
- from: 70
178+
color: "#718442"
179+
- from: 80
180+
color: "#618e44"
181+
- from: 90
182+
color: "#43a047"`,
183+
},
152184
];
153185

154186
@customElement("demo-lovelace-gauge-card")

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,23 @@
3030
"@braintree/sanitize-url": "7.1.2",
3131
"@codemirror/autocomplete": "6.20.1",
3232
"@codemirror/commands": "6.10.3",
33-
"@codemirror/lang-jinja": "6.0.0",
33+
"@codemirror/lang-jinja": "6.0.1",
3434
"@codemirror/lang-yaml": "6.1.3",
3535
"@codemirror/language": "6.12.3",
3636
"@codemirror/search": "6.6.0",
3737
"@codemirror/state": "6.6.0",
3838
"@codemirror/view": "6.41.0",
3939
"@date-fns/tz": "1.4.1",
4040
"@egjs/hammerjs": "2.0.17",
41-
"@formatjs/intl-datetimeformat": "7.3.1",
42-
"@formatjs/intl-displaynames": "7.3.1",
43-
"@formatjs/intl-durationformat": "0.10.3",
44-
"@formatjs/intl-getcanonicallocales": "3.2.2",
45-
"@formatjs/intl-listformat": "8.3.1",
46-
"@formatjs/intl-locale": "5.3.1",
47-
"@formatjs/intl-numberformat": "9.3.1",
48-
"@formatjs/intl-pluralrules": "6.3.1",
49-
"@formatjs/intl-relativetimeformat": "12.3.1",
41+
"@formatjs/intl-datetimeformat": "7.3.2",
42+
"@formatjs/intl-displaynames": "7.3.2",
43+
"@formatjs/intl-durationformat": "0.10.4",
44+
"@formatjs/intl-getcanonicallocales": "3.2.3",
45+
"@formatjs/intl-listformat": "8.3.2",
46+
"@formatjs/intl-locale": "5.3.2",
47+
"@formatjs/intl-numberformat": "9.3.2",
48+
"@formatjs/intl-pluralrules": "6.3.2",
49+
"@formatjs/intl-relativetimeformat": "12.3.2",
5050
"@fullcalendar/core": "6.1.20",
5151
"@fullcalendar/daygrid": "6.1.20",
5252
"@fullcalendar/interaction": "6.1.20",
@@ -100,15 +100,15 @@
100100
"hls.js": "1.6.16",
101101
"home-assistant-js-websocket": "9.6.0",
102102
"idb-keyval": "6.2.2",
103-
"intl-messageformat": "11.2.0",
103+
"intl-messageformat": "11.2.1",
104104
"js-yaml": "4.1.1",
105105
"leaflet": "1.9.4",
106106
"leaflet-draw": "patch:leaflet-draw@npm%3A1.0.4#./.yarn/patches/leaflet-draw-npm-1.0.4-0ca0ebcf65.patch",
107107
"leaflet.markercluster": "1.5.3",
108108
"lit": "3.3.2",
109109
"lit-html": "3.3.2",
110110
"luxon": "3.7.2",
111-
"marked": "18.0.0",
111+
"marked": "18.0.1",
112112
"memoize-one": "6.0.0",
113113
"node-vibrant": "4.0.4",
114114
"object-hash": "3.0.0",
@@ -135,15 +135,15 @@
135135
"@babel/helper-define-polyfill-provider": "0.6.8",
136136
"@babel/plugin-transform-runtime": "7.29.0",
137137
"@babel/preset-env": "7.29.2",
138-
"@bundle-stats/plugin-webpack-filter": "4.22.0",
138+
"@bundle-stats/plugin-webpack-filter": "4.22.1",
139139
"@eslint/eslintrc": "3.3.5",
140140
"@eslint/js": "10.0.1",
141141
"@html-eslint/eslint-plugin": "0.59.0",
142142
"@lokalise/node-api": "15.7.1",
143143
"@octokit/auth-oauth-device": "8.0.3",
144144
"@octokit/plugin-retry": "8.1.0",
145145
"@octokit/rest": "22.0.1",
146-
"@rsdoctor/rspack-plugin": "1.5.7",
146+
"@rsdoctor/rspack-plugin": "1.5.9",
147147
"@rspack/core": "1.7.11",
148148
"@rspack/dev-server": "1.2.1",
149149
"@types/babel__plugin-transform-runtime": "7.9.5",
@@ -196,14 +196,14 @@
196196
"lodash.template": "4.5.0",
197197
"map-stream": "0.0.7",
198198
"pinst": "3.0.0",
199-
"prettier": "3.8.2",
199+
"prettier": "3.8.3",
200200
"rspack-manifest-plugin": "5.2.1",
201201
"serve": "14.2.6",
202202
"sinon": "21.1.2",
203203
"tar": "7.5.13",
204204
"terser-webpack-plugin": "5.4.0",
205205
"ts-lit-plugin": "2.0.2",
206-
"typescript": "6.0.2",
206+
"typescript": "6.0.3",
207207
"typescript-eslint": "8.58.2",
208208
"vite-tsconfig-paths": "6.1.1",
209209
"vitest": "4.1.4",
@@ -222,7 +222,7 @@
222222
"@material/mwc-list@^0.27.0": "patch:@material/mwc-list@npm%3A0.27.0#~/.yarn/patches/@material-mwc-list-npm-0.27.0-5344fc9de4.patch",
223223
"glob@^10.2.2": "^10.5.0"
224224
},
225-
"packageManager": "yarn@4.13.0",
225+
"packageManager": "yarn@4.14.1",
226226
"volta": {
227227
"node": "24.15.0"
228228
}

src/common/datetime/format_duration.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type { DurationInput } from "@formatjs/intl-durationformat/src/types";
21
import memoizeOne from "memoize-one";
32
import type { HaDurationData } from "../../components/ha-duration-input";
43
import type { FrontendLocaleData } from "../../data/translation";
@@ -114,7 +113,7 @@ export const formatDuration = (
114113
case "d": {
115114
const days = Math.floor(value);
116115
const hours = Math.floor((value - days) * 24);
117-
const input: DurationInput = {
116+
const input = {
118117
days,
119118
hours,
120119
};
@@ -123,7 +122,7 @@ export const formatDuration = (
123122
case "h": {
124123
const hours = Math.floor(value);
125124
const minutes = Math.floor((value - hours) * 60);
126-
const input: DurationInput = {
125+
const input = {
127126
hours,
128127
minutes,
129128
};
@@ -132,7 +131,7 @@ export const formatDuration = (
132131
case "min": {
133132
const minutes = Math.floor(value);
134133
const seconds = Math.floor((value - minutes) * 60);
135-
const input: DurationInput = {
134+
const input = {
136135
minutes,
137136
seconds,
138137
};

src/common/util/subscribe-one.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import type { Connection, UnsubscribeFunc } from "home-assistant-js-websocket";
1+
import type {
2+
Collection,
3+
Connection,
4+
UnsubscribeFunc,
5+
} from "home-assistant-js-websocket";
26

37
export const subscribeOne = async <T>(
48
conn: Connection,
@@ -13,3 +17,11 @@ export const subscribeOne = async <T>(
1317
resolve(items);
1418
});
1519
});
20+
21+
export const subscribeOneCollection = async <T>(collection: Collection<T>) =>
22+
new Promise<T>((resolve) => {
23+
const unsub = collection.subscribe((data) => {
24+
unsub();
25+
resolve(data);
26+
});
27+
});

src/components/ha-gauge.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ export class HaGauge extends LitElement {
132132
133133
const x1 = -arcRadius * Math.cos((startAngle * Math.PI) / 180);
134134
const y1 = -arcRadius * Math.sin((startAngle * Math.PI) / 180);
135-
const x2 = -arcRadius * Math.cos((endAngle * Math.PI) / 180);
136-
const y2 = -arcRadius * Math.sin((endAngle * Math.PI) / 180);
137135
138136
const isFirst = i === 0;
139137
const isLast = i === arr.length - 1;
@@ -144,7 +142,7 @@ export class HaGauge extends LitElement {
144142
class="level"
145143
stroke="${level.stroke}"
146144
style="stroke-linecap: butt"
147-
d="M ${x1} ${y1} A ${arcRadius} ${arcRadius} 0 ${largeArc} 1 ${x2} ${y2}"
145+
d="M ${x1} ${y1} A ${arcRadius} ${arcRadius} 0 ${largeArc} 1 40 0"
148146
/>
149147
`;
150148
}
@@ -157,9 +155,9 @@ export class HaGauge extends LitElement {
157155
158156
return svg`
159157
<path class="level" stroke="${level.stroke}" style="stroke-linecap: butt"
160-
d="M ${x1} ${y1} A ${arcRadius} ${arcRadius} 0 ${largeArc} 1 ${xm} ${ym}" />
158+
d="M ${x1} ${y1} A ${arcRadius} ${arcRadius} 0 ${largeArc} 1 40 0" />
161159
<path class="level" stroke="${level.stroke}" style="stroke-linecap: butt"
162-
d="M ${xm} ${ym} A ${arcRadius} ${arcRadius} 0 0 1 ${x2} ${y2}" />
160+
d="M ${xm} ${ym} A ${arcRadius} ${arcRadius} 0 0 1 40 0" />
163161
`;
164162
}
165163
@@ -168,7 +166,7 @@ export class HaGauge extends LitElement {
168166
class="level"
169167
stroke="${level.stroke}"
170168
style="stroke-linecap: butt"
171-
d="M ${x1} ${y1} A ${arcRadius} ${arcRadius} 0 ${largeArc} 1 ${x2} ${y2}"
169+
d="M ${x1} ${y1} A ${arcRadius} ${arcRadius} 0 ${largeArc} 1 40 0"
172170
></path>
173171
`;
174172
})}
@@ -178,7 +176,7 @@ export class HaGauge extends LitElement {
178176
? svg`
179177
<path
180178
class="needle"
181-
d="M -34,-3 L -48,-1 A 1,1,0,0,0,-48,1 L -34,3 A 2,2,0,0,0,-34,-3 Z"
179+
d="M -34,-3 L -40,-1 A 1,1,0,0,0,-40,1 L -34,3 A 2,2,0,0,0,-34,-3 Z"
182180
183181
style=${styleMap({ transform: `rotate(${this._angle}deg)` })}
184182
/>

0 commit comments

Comments
 (0)