Skip to content

Commit 879d538

Browse files
author
Eric Meyer
committed
Initial takeover commit
1 parent 96342dc commit 879d538

File tree

9 files changed

+39
-147
lines changed

9 files changed

+39
-147
lines changed

.releaserc.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ module.exports = {
1010
{
1111
replacements: [
1212
{
13-
files: ["dist/power-flow-card.js"],
14-
from: /Power Flow Card v(\d+\.\d+\.\d+)/,
15-
to: "Power Flow Card v${nextRelease.version}",
13+
files: ["dist/system-flow-card.js"],
14+
from: /System Flow Card v(\d+\.\d+\.\d+)/,
15+
to: "System Flow Card v${nextRelease.version}",
1616
results: [
1717
{
18-
file: "dist/power-flow-card.js",
18+
file: "dist/system-flow-card.js",
1919
hasChanged: true,
2020
numMatches: 2,
2121
numReplacements: 2,

CHANGELOG.md

Lines changed: 0 additions & 108 deletions
This file was deleted.

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Power Flow Card
1+
# System Flow Card
22

33
[![hacs_badge](https://img.shields.io/badge/HACS-Default-41BDF5.svg?style=flat-square)](https://github.com/hacs/integration)
4-
![GitHub release (latest by date)](https://img.shields.io/github/v/release/ulic75/power-flow-card?style=flat-square)
5-
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/ulic75/power-flow-card/CI?style=flat-square)
6-
![GitHub all releases](https://img.shields.io/github/downloads/ulic75/power-flow-card/total?style=flat-square)
4+
![GitHub release (latest by date)](https://img.shields.io/github/v/release/ulic75/system-flow-card?style=flat-square)
5+
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/ulic75/system-flow-card/CI?style=flat-square)
6+
![GitHub all releases](https://img.shields.io/github/downloads/ulic75/system-flow-card/total?style=flat-square)
77
[![ko-fi support](https://img.shields.io/badge/support-me-ff5e5b?style=flat-square&logo=ko-fi)](https://ko-fi.com/ulic75)
88

9-
This card for [Home Assistant](https://home-assistant.io/) Dashboards is designed to provide power distribution in an identical style to the Official Energy Distribution card included by Home Assistant.
9+
This card for [Home Assistant](https://home-assistant.io/) Dashboards is designed to provide system distribution in an identical style to the Official Energy Distribution card included by Home Assistant.
1010

11-
![power-flow-2 4 0](https://user-images.githubusercontent.com/5641964/169116530-f5ddefc4-6ee1-46cc-b89e-a8d8fabaa892.png)
11+
![system-flow-2 4 0](https://user-images.githubusercontent.com/5641964/169116530-f5ddefc4-6ee1-46cc-b89e-a8d8fabaa892.png)
1212

1313
## Install
1414

@@ -19,17 +19,17 @@ This card is available in [HACS](https://hacs.xyz/) (Home Assistant Community St
1919

2020
### Manual install
2121

22-
1. Download and copy `power-flow-card.js` from the [latest release](https://github.com/ulic75/power-flow-card/releases/latest) into your `config/www` directory.
22+
1. Download and copy `system-flow-card.js` from the [latest release](https://github.com/ulic75/system-flow-card/releases/latest) into your `config/www` directory.
2323

2424
2. Add the resource reference as decribed below.
2525

2626
### Add resource reference
2727

28-
If you configure Dashboards via YAML, add a reference to `power-flow-card.js` inside your `configuration.yaml`:
28+
If you configure Dashboards via YAML, add a reference to `system-flow-card.js` inside your `configuration.yaml`:
2929

3030
```yaml
3131
resources:
32-
- url: /local/power-flow-card.js
32+
- url: /local/system-flow-card.js
3333
type: module
3434
```
3535
@@ -40,8 +40,8 @@ Else, if you prefer the graphical editor, use the menu to add the resource:
4040
3. Click three dot icon
4141
4. Select Resources
4242
5. Hit (+ ADD RESOURCE) icon
43-
6. Enter URL `/local/power-flow-card.js` and select type "JavaScript Module".
44-
(Use `/hacsfiles/power-flow-card/power-flow-card.js` and select "JavaScript Module" for HACS install if HACS didn't do it already)
43+
6. Enter URL `/local/system-flow-card.js` and select type "JavaScript Module".
44+
(Use `/hacsfiles/system-flow-card/system-flow-card.js` and select "JavaScript Module" for HACS install if HACS didn't do it already)
4545

4646
## Using the card
4747

@@ -54,7 +54,7 @@ I recommend looking at the [Example usage section](#example-usage) to understand
5454

5555
| Name | Type | Default | Description |
5656
| ----------------- | -------- | :----------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
57-
| type | `string` | **required** | `custom:power-flow-card`. |
57+
| type | `string` | **required** | `custom:system-flow-card`. |
5858
| entities | `object` | **required** | One or more sensor entities, see [entities object](#entities-object) for additional entity options. |
5959
| title | `string` | | Shows a title at the top of the card. |
6060
| dashboard_link | `string` | | Shows a link to an Energy Dashboard. Should be a url path to location of your choice. If you wanted to link to the built-in dashboard you would enter `/energy` for example. |
@@ -92,7 +92,7 @@ Can be use with either Grid or Battery configuration. The same `unit_of_measurem
9292
Using combined entities for grid, battery and solor that support positive state values for consumption and negative state values for production.
9393

9494
```yaml
95-
type: custom:power-flow-card
95+
type: custom:system-flow-card
9696
entities:
9797
battery: sensor.battery_in_out
9898
battery_charge: sensor.battery_percent
@@ -105,7 +105,7 @@ entities:
105105
Using combined entites as above but where the battery and grid entities are inverted (negative = consumption and positive = production).
106106

107107
```yaml
108-
type: custom:power-flow-card
108+
type: custom:system-flow-card
109109
entities:
110110
battery: sensor.battery_in_out
111111
battery_charge: sensor.battery_percent
@@ -119,7 +119,7 @@ inverted_entities: battery, grid
119119
Using split entities for grid and battery where each consumption and production entity state has a positive value.
120120

121121
```yaml
122-
type: custom:power-flow-card
122+
type: custom:system-flow-card
123123
entities:
124124
battery:
125125
consumption: sensor.battery_out

hacs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "Power Flow Card",
2+
"name": "System Flow Card",
33
"render_readme": true,
44
"homeassistant": "2021.8.0"
55
}

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "power-distribution-card",
2+
"name": "system-flow-card",
33
"version": "2.5.1",
4-
"description": "A power distribution card for Home Assistant",
4+
"description": "A system flow card for Home Assistant",
55
"keywords": [
66
"home-assistant",
77
"homeassistant",
@@ -12,14 +12,14 @@
1212
"main": "index.js",
1313
"repository": {
1414
"type": "git",
15-
"url": "git+https://github.com/ulic75/power-distribution-card.git"
15+
"url": "git+https://github.com/flyrmyr/system-flow-card.git"
1616
},
1717
"author": "",
1818
"license": "ISC",
1919
"bugs": {
20-
"url": "https://github.com/ulic75/power-distribution-card/issues"
20+
"url": "https://github.com/flyrmyr/system-flow-card/issues"
2121
},
22-
"homepage": "https://github.com/ulic75/power-distribution-card#readme",
22+
"homepage": "https://github.com/flyrmyr/system-flow-card#readme",
2323
"scripts": {
2424
"build": "rollup -c",
2525
"lint": "eslint src/*",

rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const serveOptions = {
2020

2121
export default [
2222
{
23-
input: "src/power-flow-card.ts",
23+
input: "src/system-flow-card.ts",
2424
output: [
2525
{
2626
dir: "./dist",

src/logging.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import { version } from "../package.json";
44

55
// Log Version
66
console.groupCollapsed(
7-
`%c⚡ Power Flow Card v${version} is installed`,
7+
`%c⚡ System Flow Card v${version} is installed`,
88
"color: #488fc2; font-weight: bold"
99
);
10-
console.log("Readme:", "https://github.com/ulic75/power-flow-card");
10+
console.log("Readme:", "https://github.com/ulic75/system-flow-card");
1111
console.groupEnd();
1212

1313
export const logError = debounce((error: string) => {
1414
console.log(
15-
`%c⚡ Power Flow Card v${version} %cError: ${error}`,
15+
`%c⚡ System Flow Card v${version} %cError: ${error}`,
1616
"color: #488fc2; font-weight: bold",
1717
"color: #b33a3a; font-weight: normal"
1818
);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { LovelaceCardConfig } from "custom-card-helpers";
22
import { ComboEntity } from "./type.js";
33

4-
export interface PowerFlowCardConfig extends LovelaceCardConfig {
4+
export interface SystemFlowCardConfig extends LovelaceCardConfig {
55
entities: {
66
battery?: string | ComboEntity;
77
battery_charge?: string;
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { formatNumber, HomeAssistant } from "custom-card-helpers";
1717
import { css, html, LitElement, svg, TemplateResult } from "lit";
1818
import { customElement, property, query, state } from "lit/decorators.js";
1919
import { classMap } from "lit/directives/class-map.js";
20-
import { PowerFlowCardConfig } from "./power-flow-card-config.js";
20+
import { SystemFlowCardConfig } from "./system-flow-card-config.js";
2121
import {
2222
coerceNumber,
2323
coerceStringArray,
@@ -33,10 +33,10 @@ const MAX_FLOW_RATE = 6;
3333
const MIN_FLOW_RATE = 0.75;
3434
const W_DECIMALS = 1;
3535

36-
@customElement("power-flow-card")
37-
export class PowerFlowCard extends LitElement {
36+
@customElement("system-flow-card")
37+
export class SystemFlowCard extends LitElement {
3838
@property({ attribute: false }) public hass!: HomeAssistant;
39-
@state() private _config?: PowerFlowCardConfig;
39+
@state() private _config?: SystemFlowCardConfig;
4040

4141
@query("#battery-grid-flow") batteryGridFlow?: SVGSVGElement;
4242
@query("#battery-home-flow") batteryToHomeFlow?: SVGSVGElement;
@@ -45,7 +45,7 @@ export class PowerFlowCard extends LitElement {
4545
@query("#solar-grid-flow") solarToGridFlow?: SVGSVGElement;
4646
@query("#solar-home-flow") solarToHomeFlow?: SVGSVGElement;
4747

48-
setConfig(config: PowerFlowCardConfig): void {
48+
setConfig(config: SystemFlowCardConfig): void {
4949
if (
5050
!config.entities ||
5151
(!config.entities.battery &&
@@ -907,14 +907,14 @@ const windowWithCards = window as unknown as Window & {
907907
};
908908
windowWithCards.customCards = windowWithCards.customCards || [];
909909
windowWithCards.customCards.push({
910-
type: "power-flow-card",
911-
name: "Power Flow Card",
910+
type: "system-flow-card",
911+
name: "System Flow Card",
912912
description:
913-
"A power distribution card inspired by the official Energy Distribution card for Home Assistant",
913+
"A system distribution card inspired by the official Energy Distribution card for Home Assistant",
914914
});
915915

916916
declare global {
917917
interface HTMLElementTagNameMap {
918-
"power-flow-card": PowerFlowCard;
918+
"system-flow-card": SystemFlowCard;
919919
}
920920
}

0 commit comments

Comments
 (0)