Skip to content
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

Release: version 0.2.2 #594

Merged
merged 22 commits into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0e95deb
fix: :bug: secondary info on individual uses incorrect index
MrPrisoner Apr 20, 2024
63e6029
docs: :memo: fix Power Outage table
MrPrisoner Apr 20, 2024
9884863
fix: :bug: decimal values not in individual
flixlix Apr 21, 2024
53a2648
fix: :bug: check if there is fossil
flixlix Apr 21, 2024
5ab4736
fix: :bug: missing unit white space config individual entity
flixlix Apr 21, 2024
57c3c95
feat: :art: hide icons
flixlix Apr 21, 2024
9d7e7dc
style: :art: whitespace formatting
flixlix Apr 21, 2024
d31dec9
fix: :bug: display zero behaviour individual secondary
flixlix Apr 21, 2024
cb6aaf1
fix: :art: individual-one-color-line-icon
flixlix Apr 21, 2024
c844ed3
chore: :bookmark: update version
flixlix Apr 21, 2024
4c81aed
Merge pull request #584 from MrPrisoner/main
flixlix Apr 21, 2024
4a54417
Merge pull request #587 from flixlix/585-decimal-values-is-not-presen…
flixlix Apr 21, 2024
6eccc28
Merge pull request #588 from flixlix/581-bug-fossil-fuel-dots-are-sho…
flixlix Apr 21, 2024
399804e
Merge pull request #590 from flixlix/568-support-unit-white-space-ind…
flixlix Apr 21, 2024
e37eb1e
feat: :art: hide icons
flixlix Apr 21, 2024
c19ab71
style: :art: whitespace formatting
flixlix Apr 21, 2024
9d80ef3
Merge branch '573-feature-request-option-to-hide-entity-icon-prob-usi…
flixlix Apr 21, 2024
47279a1
Merge branch 'v0.2.2-release' into 573-feature-request-option-to-hide…
flixlix Apr 21, 2024
ebdbe77
Merge pull request #591 from flixlix/573-feature-request-option-to-hi…
flixlix Apr 21, 2024
29dc608
Merge branch 'v0.2.2-release' into 567-bug-v021-individual-doesnt-sho…
flixlix Apr 21, 2024
9300869
Merge pull request #592 from flixlix/567-bug-v021-individual-doesnt-s…
flixlix Apr 21, 2024
01cc018
Merge pull request #593 from flixlix/524-flow-line-color-not-showing
flixlix Apr 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,14 @@ This Feature allows you to configure an additional small text for each Individua
This feature allows you to configure how the card handles a Grid Power Outage scenario.

| Name | Type | Description |
| ------------------- | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ------------------- | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| entity | `string` required | Entity ID providing a state that changes when there is a Power Outage. (eg: `binary_sensor.grid_connection_status`). Doesn't need to be a binary_sensor. |
| entity_generator | `string` | Entity ID providing the power of a Generator. (eg: `sensor.generator_power`). This is optional, meaning if you don't use this, the card will assume the grid is the only source of power. |
| state_alert | `string` | The state the provided entity is at when there is a power outage. Default is `on`, meaning if the entity's state is `on` the card will assume there is a power outage. |
| icon_alert | `string` | An icon path to be override the grid icon when there is a power outage. Default is `mdi:transmission-tower-off`. |
| label_alert | `string` | A text that will be displayed below the icon when there is a power outage. |
| calculate_flow_rate | `boolean` or `number` | `false` | If set to `true`, the flow rate will be calculated by using the flow rate formula (either the new or the old one, depending on your configuration). If set to a number, the flow rate will be set to that number. For example, defining the value `10` will ensure one dot will flow every 10 seconds. |
| calculate_flow_rate | `boolean` or `number` | `false` |
| | | If set to `true`, the flow rate will be calculated by using the flow rate formula (either the new or the old one, depending on your configuration). If set to a number, the flow rate will be set to that number. For example, defining the value `10` will ensure one dot will flow every 10 seconds. |

#### Display Zero Lines

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "power-flow-card-plus",
"version": "0.2.1",
"version": "0.2.2",
"description": "A power flow card for Home Assistant",
"keywords": [
"home-assistant",
Expand Down
2 changes: 1 addition & 1 deletion src/components/individualLeftBottomElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const individualLeftBottomElement = (
}
}}
>
${individualSecondarySpan(hass, main, config, templatesObj, individualObj, 1, "left-bottom")}
${individualSecondarySpan(hass, main, config, templatesObj, individualObj, indexOfIndividual, "left-bottom")}
${individualObj?.icon !== " " ? html` <ha-icon id="individual-left-bottom-icon" .icon=${individualObj?.icon} />` : null}
${individualObj?.field?.display_zero_state !== false || (individualObj?.state || 0) > (individualObj.displayZeroTolerance ?? 0)
? html` <span class="individual-bottom individual-left-bottom"
Expand Down
2 changes: 1 addition & 1 deletion src/components/individualLeftTopElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const individualLeftTopElement = (
}
}}
>
${individualSecondarySpan(main.hass, main, config, templatesObj, individualObj, 0, "left-top")}
${individualSecondarySpan(main.hass, main, config, templatesObj, individualObj, indexOfIndividual, "left-top")}
${individualObj.icon !== " " ? html` <ha-icon id="individual-left-top-icon" .icon=${individualObj.icon} />` : null}
${individualObj?.field?.display_zero_state !== false || (individualObj.state || 0) > (individualObj.displayZeroTolerance ?? 0)
? html` <span class="individual-top individual-left-top">
Expand Down
2 changes: 1 addition & 1 deletion src/components/individualRightBottomElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const individualRightBottomElement = (
}
}}
>
${individualSecondarySpan(main.hass, main, config, templatesObj, individualObj, 3, "right-bottom")}
${individualSecondarySpan(main.hass, main, config, templatesObj, individualObj, indexOfIndividual, "right-bottom")}
${individualObj.icon !== " " ? html` <ha-icon id="individual-right-bottom-icon" .icon=${individualObj.icon} />` : null}
${individualObj?.field?.display_zero_state !== false || (individualObj.state || 0) > (individualObj.displayZeroTolerance ?? 0)
? html` <span class="individual-bottom individual-right-bottom">
Expand Down
2 changes: 1 addition & 1 deletion src/components/individualRightTopElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const individualRightTopElement = (
}
}}
>
${individualSecondarySpan(main.hass, main, config, templatesObj, individualObj, 2, "right-top")}
${individualSecondarySpan(main.hass, main, config, templatesObj, individualObj, indexOfIndividual, "right-top")}
${individualObj.icon !== " " ? html` <ha-icon id="individual-right-top-icon" .icon=${individualObj.icon} />` : null}
${individualObj?.field?.display_zero_state !== false || (individualObj.state || 0) > (individualObj.displayZeroTolerance ?? 0)
? html` <span class="individual-top individual-right-top">
Expand Down
2 changes: 1 addition & 1 deletion src/components/nonFossil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const nonFossilElement = (
? html`
<svg width="80" height="30">
<path d="M40 -10 v40" class="low-carbon ${styleLine(nonFossil.state.power || 0, config)}" id="low-carbon" />
${checkShouldShowDots(config) && nonFossil.has
${checkShouldShowDots(config) && nonFossil.has && nonFossil.state.power > 0
? svg`<circle
r="1.75"
class="low-carbon"
Expand Down
2 changes: 1 addition & 1 deletion src/components/spans/individualSecondarySpan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ export const individualSecondarySpan = (

const shouldShowSecondary = () => {
if (!!templateResult) return true;
if (individual?.secondary?.displayZero === true) return true;
if (!individual?.secondary?.state) return false;
if (!isNumberValue(individual?.secondary?.state)) return true;
if (individual?.secondary?.displayZero === true) return true;

const toleranceSet = individual?.secondary?.displayZeroTolerance ?? 0;
return (
Expand Down
3 changes: 1 addition & 2 deletions src/power-flow-card-plus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,14 +481,13 @@ export class PowerFlowCardPlus extends LitElement {
},
};

/* return source object with largest value property */
const homeLargestSource = Object.keys(homeSources).reduce((a, b) => (homeSources[a].value > homeSources[b].value ? a : b));

const getIndividualDisplayState = (field?: IndividualObject) => {
if (!field) return "";
if (field?.state === undefined) return "";
// return displayValue(this.hass, field?.state, field?.unit, field?.unit_white_space, field?.decimals);
return displayValue(this.hass, this._config, field?.state, {
decimals: field?.decimals,
unit: field?.unit,
unitWhiteSpace: field?.unit_white_space,
watt_threshold: this._config.watt_threshold,
Expand Down
2 changes: 1 addition & 1 deletion src/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ export const styles = css`

.individual-top path,
.individual-top circle {
stroke: var(--icon-individual-left-top-color);
stroke: var(--individual-left-top-color);
}

#individual-left-bottom-icon {
Expand Down
5 changes: 5 additions & 0 deletions src/ui-editor/schema/individual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ const mainSchema = {
label: "Show Direction",
selector: { boolean: {} },
},
{
name: "unit_white_space",
label: "Unit White Space",
selector: { boolean: {} },
},
{
name: "use_metadata",
label: "Use Metadata",
Expand Down
Loading