Skip to content

Commit

Permalink
Merge pull request #584 from MrPrisoner/main
Browse files Browse the repository at this point in the history
fix: 🐛 secondary info indexes on individual elements
  • Loading branch information
flixlix authored Apr 21, 2024
2 parents c844ed3 + 63e6029 commit 4c81aed
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
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 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")}
<ha-icon id="individual-left-bottom-icon" .icon=${individualObj?.icon}></ha-icon>
${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")}
<ha-icon id="individual-left-top-icon" .icon=${individualObj.icon}></ha-icon>
${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")}
<ha-icon id="individual-right-bottom-icon" .icon=${individualObj.icon}></ha-icon>
${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")}
<ha-icon id="individual-right-top-icon" .icon=${individualObj.icon}></ha-icon>
${individualObj?.field?.display_zero_state !== false || (individualObj.state || 0) > (individualObj.displayZeroTolerance ?? 0)
? html` <span class="individual-top individual-right-top">
Expand Down

0 comments on commit 4c81aed

Please sign in to comment.