@kipk/ha-better-history 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +7 -2
- package/dist/decorate-DcIY_31L.js +2328 -0
- package/dist/define.js +1 -1
- package/dist/ha-better-history-Bf_QcE8w.js +2291 -0
- package/dist/ha-better-history.d.ts +5 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -2
- package/dist/picker.d.ts +1 -0
- package/dist/picker.js +2 -0
- package/dist/series-picker-element-GuL5icaQ.js +140 -0
- package/dist/types/config.d.ts +2 -0
- package/dist/ui/entity-picker.d.ts +3 -0
- package/dist/ui/series-picker-element.d.ts +38 -0
- package/package.json +9 -1
- package/dist/ha-better-history-BY4eqV1H.js +0 -4410
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 KipK
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -6,6 +6,9 @@ Standalone web component for Home Assistant history charts. Built with **Lit 3**
|
|
|
6
6
|
|
|
7
7
|
**Status: WIP** — API not yet stable.
|
|
8
8
|
|
|
9
|
+
If this component helps you, you can support development on
|
|
10
|
+
[Buy Me a Coffee](https://buymeacoffee.com/kipk).
|
|
11
|
+
|
|
9
12
|
## Why ha-better-history?
|
|
10
13
|
|
|
11
14
|
`ha-better-history` keeps the familiar Home Assistant history-chart experience, but exposes it as a reusable web component with extra controls for dashboards, dialogs, and custom cards.
|
|
@@ -124,6 +127,7 @@ Each series describes what to plot and how it should be displayed.
|
|
|
124
127
|
interface SeriesConfig {
|
|
125
128
|
entity: string; // Required: entity_id (e.g. "climate.living")
|
|
126
129
|
attribute?: string | string[]; // Dotted path or array; omit = entity.state
|
|
130
|
+
forced?: boolean; // default: true; false = removable from picker chips
|
|
127
131
|
label?: string; // Legend label; default = friendly_name or attribute path
|
|
128
132
|
color?: string; // CSS color; default = automatic palette
|
|
129
133
|
unit?: string; // Override unit (for axis grouping and label)
|
|
@@ -294,13 +298,14 @@ chart.config = {
|
|
|
294
298
|
chart.config = {
|
|
295
299
|
defaultEntities: ["climate.living", "sensor.outdoor_temp"],
|
|
296
300
|
series: [
|
|
297
|
-
{ entity: "climate.living", attribute: "current_temperature", label: "Indoor" }
|
|
301
|
+
{ entity: "climate.living", attribute: "current_temperature", label: "Indoor" },
|
|
302
|
+
{ entity: "sensor.grid_power", label: "Grid power", forced: false }
|
|
298
303
|
]
|
|
299
304
|
};
|
|
300
305
|
</script>
|
|
301
306
|
```
|
|
302
307
|
|
|
303
|
-
The entity picker lets users browse entity attributes and add/remove series at runtime. The attribute browser includes a local search field that finds top-level attributes, nested dotted paths, and primitive values inside attribute dictionaries. Non-default series are removable via chip buttons. Selected source chips can be dragged to reorder user-added graphs without refetching history; the chip order previews while dragging and is restored if the drag is cancelled.
|
|
308
|
+
The entity picker lets users browse entity attributes and add/remove series at runtime. The attribute browser includes a local search field that finds top-level attributes, nested dotted paths, and primitive values inside attribute dictionaries. Non-default series are removable via chip buttons. Configured series are fixed by default; set `forced: false` on a `SeriesConfig` to show it as a removable chip in the graph picker. Selected source chips can be dragged to reorder user-added graphs without refetching history; the chip order previews while dragging and is restored if the drag is cancelled.
|
|
304
309
|
|
|
305
310
|
### Viewer tools
|
|
306
311
|
|