Skip to content

Commit

Permalink
feat: Set custom text for the "DAILY GRID BUY" and "DAILY GRID BUY" l…
Browse files Browse the repository at this point in the history
…abels. See the `label_daily_grid_buy:` and `label_daily_grid_sell:` attributes in the Grid section
  • Loading branch information
slipx06 committed Jun 8, 2024
1 parent ae6eab5 commit 06bb90b
Show file tree
Hide file tree
Showing 21 changed files with 46 additions and 12 deletions.
14 changes: 7 additions & 7 deletions dist/sunsynk-power-flow-card.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ These attributes are only needed if `show_solar` is set to `true`
| import_icon: | Optional | | Set the grid connected/import image using any mdi icon e.g. `mdi:transmission-tower-import`. You can also provide a sensor that returns the mdi icon. If defined overrides the card default icon. |
| export_icon: | Optional | | Set the grid export image using any mdi icon e.g. `mdi:transmission-tower-export`. You can also provide a sensor that returns the mdi icon. If defined overrides the card default icon. |
| disconnected_icon: | Optional | | Set the grid disconnected image using any mdi icon e.g. `mdi:transmission-tower-off`. You can also provide a sensor that returns the mdi icon. If defined overrides the card default icon. |
| label_daily_grid_buy: | Optional | | Set custom text for the "DAILY GRID BUY" label that is displayed. |
| label_daily_grid_sell: | Optional | | Set custom test for the "DAILY GRID SELL" label that is displayed. |

### Entities

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": "sunsynk-power-flow-card",
"version": "4.42.0",
"version": "4.43.0",
"description": "A customizable Home Assistant card to emulate the Sunsynk System flow that's displayed on the Inverter screen.",
"main": "sunsynk-power-flow-card.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/cards/compact-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,12 @@ export const compactCard = (config: sunsynkPowerFlowCardConfig, inverterImg: str
<text id="daily_grid_buy" x="5" y="282.1" class="st3 left-align"
fill="${data.gridShowDailyBuy !== true ? 'transparent' : `${data.gridColour}`}"
display="${!config.show_grid ? 'none' : ''}">
${localize('common.daily_grid_buy')}
${config.grid.label_daily_grid_buy}
</text>
<text id="daily_grid_sell" x="5" y="179" class="st3 left-align"
fill="${data.gridShowDailySell !== true ? 'transparent' : `${data.gridColour}`}"
display="${!config.show_grid ? 'none' : ''}">
${localize('common.daily_grid_sell')}
${config.grid.label_daily_grid_sell}
</text>
<text id="daily_solar" x="200" y="40" class="st3 left-align"
display="${config.solar.display_mode === 1 ? '' : 'none'}"
Expand Down
4 changes: 2 additions & 2 deletions src/cards/full-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string
class="st3 left-align"
fill="${data.gridShowDailyBuy !== true ? 'transparent' : `${data.gridColour}`}"
display="${!config.show_grid ? 'none' : ''}">
${localize('common.daily_grid_buy')}
${config.grid.label_daily_grid_buy}
</text>
<text id="daily_grid_sell"
x="${!data.showNonessential ? '311' : '347'}"
Expand All @@ -422,7 +422,7 @@ export const fullCard = (config: sunsynkPowerFlowCardConfig, inverterImg: string
class="st3 left-align"
fill="${data.gridShowDailySell !== true ? 'transparent' : `${data.gridColour}`}"
display="${!config.show_grid ? 'none' : ''}">
${localize('common.daily_grid_sell')}
${config.grid.label_daily_grid_sell}
</text>
<text id="aux_one" x="411" y="82" class="st3 st8"
display="${!data.showAux || [1, 2].includes(data.additionalAuxLoad) ? 'none' : ''}"
Expand Down
2 changes: 2 additions & 0 deletions src/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ export default {
grid: {
colour: '#5490c2',
grid_name: localize('common.grid_name'),
label_daily_grid_buy: localize('common.daily_grid_buy'),
label_daily_grid_sell: localize('common.daily_grid_sell'),
show_daily_buy: false,
show_daily_sell: false,
show_nonessential: true,
Expand Down
2 changes: 2 additions & 0 deletions src/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ export class SunSynkCardEditor extends LitElement implements LovelaceCardEditor
{name: 'export_colour', selector: {color_rgb: {}}},
{name: 'grid_off_colour', selector: {color_rgb: {}}},
{name: 'grid_name', selector: {text: {}}},
{name: 'label_daily_grid_buy', selector: {text: {}}},
{name: 'label_daily_grid_sell', selector: {text: {}}},
{name: 'show_absolute', selector: {boolean: {}}},
{name: 'energy_cost_decimals', selector: {number: {mode: 'box', min: 0, max: 3,}}},
{name: 'show_nonessential', selector: {boolean: {}}},
Expand Down
2 changes: 2 additions & 0 deletions src/localize/languages/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@
"energy_cost_decimals": "Energy Cost Decimals",
"show_remaining_energy": "Show Remaining Energy",
"path_threshold": "Path Threshold",
"label_daily_grid_buy": "Daily Grid Buy Label",
"label_daily_grid_sell": "Daily Grid Sell Label",
"cat_title": {
"title": "Title Options",
"general": "General Options",
Expand Down
2 changes: 2 additions & 0 deletions src/localize/languages/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@
"energy_cost_decimals": "Energy Cost Decimals",
"show_remaining_energy": "Show Remaining Energy",
"path_threshold": "Path Threshold",
"label_daily_grid_buy": "Daily Grid Buy Label",
"label_daily_grid_sell": "Daily Grid Sell Label",
"cat_title": {
"title": "Title Options",
"general": "General Options",
Expand Down
2 changes: 2 additions & 0 deletions src/localize/languages/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@
"energy_cost_decimals": "Energiudgift Decimaler",
"show_remaining_energy": "Vis resterende Energi",
"path_threshold": "Path Threshold",
"label_daily_grid_buy": "Daily Grid Buy Label",
"label_daily_grid_sell": "Daily Grid Sell Label",
"cat_title": {
"title": "Titel Options",
"general": "Generelle Options",
Expand Down
2 changes: 2 additions & 0 deletions src/localize/languages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@
"energy_cost_decimals": "Energy Cost Decimals",
"show_remaining_energy": "Show Remaining Energy",
"path_threshold": "Path Threshold",
"label_daily_grid_buy": "Daily Grid Buy Label",
"label_daily_grid_sell": "Daily Grid Sell Label",
"cat_title": {
"title": "Title Options",
"general": "General Options",
Expand Down
2 changes: 2 additions & 0 deletions src/localize/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@
"energy_cost_decimals": "Energy Cost Decimals",
"show_remaining_energy": "Show Remaining Energy",
"path_threshold": "Path Threshold",
"label_daily_grid_buy": "Daily Grid Buy Label",
"label_daily_grid_sell": "Daily Grid Sell Label",
"cat_title": {
"title": "Title Options",
"general": "General Options",
Expand Down
2 changes: 2 additions & 0 deletions src/localize/languages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@
"energy_cost_decimals": "Energy Cost Decimals",
"show_remaining_energy": "Show Remaining Energy",
"path_threshold": "Path Threshold",
"label_daily_grid_buy": "Daily Grid Buy Label",
"label_daily_grid_sell": "Daily Grid Sell Label",
"cat_title": {
"title": "Title Options",
"general": "General Options",
Expand Down
2 changes: 2 additions & 0 deletions src/localize/languages/et.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@
"energy_cost_decimals": "Energy Cost Decimals",
"show_remaining_energy": "Show Remaining Energy",
"path_threshold": "Path Threshold",
"label_daily_grid_buy": "Daily Grid Buy Label",
"label_daily_grid_sell": "Daily Grid Sell Label",
"cat_title": {
"title": "Title Options",
"general": "General Options",
Expand Down
2 changes: 2 additions & 0 deletions src/localize/languages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@
"energy_cost_decimals": "Energy Cost Decimals",
"show_remaining_energy": "Show Remaining Energy",
"path_threshold": "Path Threshold",
"label_daily_grid_buy": "Daily Grid Buy Label",
"label_daily_grid_sell": "Daily Grid Sell Label",
"cat_title": {
"title": "Title Options",
"general": "General Options",
Expand Down
2 changes: 2 additions & 0 deletions src/localize/languages/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@
"energy_cost_decimals": "Energy Cost Decimals",
"show_remaining_energy": "Show Remaining Energy",
"path_threshold": "Path Threshold",
"label_daily_grid_buy": "Daily Grid Buy Label",
"label_daily_grid_sell": "Daily Grid Sell Label",
"cat_title": {
"title": "Title Options",
"general": "General Options",
Expand Down
2 changes: 2 additions & 0 deletions src/localize/languages/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@
"energy_cost_decimals": "Energy Cost Decimals",
"show_remaining_energy": "Show Remaining Energy",
"path_threshold": "Path Threshold",
"label_daily_grid_buy": "Daily Grid Buy Label",
"label_daily_grid_sell": "Daily Grid Sell Label",
"cat_title": {
"title": "Title Options",
"general": "General Options",
Expand Down
2 changes: 2 additions & 0 deletions src/localize/languages/pt-br.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@
"energy_cost_decimals": "Decimais do custo de energia",
"show_remaining_energy": "Exibir energia restante",
"path_threshold": "Path Threshold",
"label_daily_grid_buy": "Daily Grid Buy Label",
"label_daily_grid_sell": "Daily Grid Sell Label",
"cat_title": {
"title": "Opções de título",
"general": "Opções gerais",
Expand Down
2 changes: 2 additions & 0 deletions src/localize/languages/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@
"energy_cost_decimals": "Разрядность Стоимости Энергии",
"show_remaining_energy": "Показать Остаток Энергии",
"path_threshold": "Path Threshold",
"label_daily_grid_buy": "Daily Grid Buy Label",
"label_daily_grid_sell": "Daily Grid Sell Label",
"cat_title": {
"title": "Параметры Заголовка",
"general": "Общие Настройки",
Expand Down
2 changes: 2 additions & 0 deletions src/localize/languages/sk.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@
"energy_cost_decimals": "Energy Cost Decimals",
"show_remaining_energy": "Show Remaining Energy",
"path_threshold": "Path Threshold",
"label_daily_grid_buy": "Daily Grid Buy Label",
"label_daily_grid_sell": "Daily Grid Sell Label",
"cat_title": {
"title": "Title Options",
"general": "General Options",
Expand Down
2 changes: 2 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ export interface sunsynkPowerFlowCardConfig extends LovelaceCardConfig {
grid: {
colour: string;
grid_name: string;
label_daily_grid_buy: string;
label_daily_grid_sell: string;
export_colour: string;
no_grid_colour: string;
grid_off_colour: string;
Expand Down

0 comments on commit 06bb90b

Please sign in to comment.