Skip to content

Commit

Permalink
Update status and status text according to breaking change on easee_h…
Browse files Browse the repository at this point in the history
…ass v0.9.22
  • Loading branch information
tmjo committed Nov 6, 2020
1 parent 13a931b commit 2e9245c
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 115 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "charger-card",
"version": "1.10.1",
"version": "1.10.2",
"description": "Charger card for Home Assistant Lovelace UI",
"main": "dist/charger-card.js",
"scripts": {
Expand Down
189 changes: 90 additions & 99 deletions src/const.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,68 @@
export const CARD_VERSION = '0.0.1';

export const CHARGERDOMAIN = "easee";
export const STATUS_ENTITY_BASE = "_status";
export const CHARGERDOMAIN = 'easee';
export const STATUS_ENTITY_BASE = '_status';

export const CHARGERSTATUS = {
STANDBY_1:"STANDBY",
PAUSED_2:"PAUSED",
CHARGING_3:"CHARGING",
READY_4:"READY_TO_CHARGE",
ERROR_5:"ERROR",
CONNECTED_6:"CAR_CONNECTED",
STANDBY_1: 'disconnected',
PAUSED_2: 'awaiting_start',
CHARGING_3: 'charging',
READY_4: 'completed',
ERROR_5: 'error',
CONNECTED_6: 'ready_to_charge',
};

export const LEDIMAGES = {
normal: {
DEFAULT: ledOff,
disconnected: ledWhite2,
awaiting_start: ledWhiteAll,
charging: ledWhiteFlashing,
completed: ledWhiteAll,
error: ledRedFlashing,
ready_to_charge: ledWhiteAll,
},
smart: {
DEFAULT: ledOff,
disconnected: ledBlue2,
awaiting_start: ledBlueAll,
charging: ledBlueFlashing,
completed: ledBlueAll,
error: ledRedFlashing,
ready_to_charge: ledBlueAll,
},
};

export const ENTITIES = {
cableLocked : "binary_sensor.cable_locked_car",
cableLockedPermanently : "switch.cable_permanently_locked_charger",
basicSchedule : "binary_sensor.basic_schedule",
circuitCurrent : "sensor.circuit_current",
costPerKwh : "sensor.cost_per_kwh",
dynamicChargerCurrent : "sensor.dynamic_charger_current",
dynamicCircuitCurrent : "sensor.dynamic_circuit_current",
enableIdleCurrent : "switch.enable_idle_current",
inCurrent : "sensor.in_current",
isEnabled : "switch.is_enabled",
maxChargerCurrent : "sensor.max_charger_current",
maxCircuitCurrent : "sensor.max_circuit_current",
isOnline : "binary_sensor.online",
outputCurrent : "sensor.output_current",
reasonForNoCurrent : "sensor.reason_for_no_current",
sessionEnergy : "sensor.session_energy",
energyPerHour : "sensor.energy_per_hour",
smartCharging : "switch.smart_charging",
totalPower : "sensor.total_power",
updateAvailable : "binary_sensor.update_available",
voltage : "sensor.voltage",
cableLocked: 'binary_sensor.cable_locked_car',
cableLockedPermanently: 'switch.cable_permanently_locked_charger',
basicSchedule: 'binary_sensor.basic_schedule',
circuitCurrent: 'sensor.circuit_current',
costPerKwh: 'sensor.cost_per_kwh',
dynamicChargerCurrent: 'sensor.dynamic_charger_current',
dynamicCircuitCurrent: 'sensor.dynamic_circuit_current',
enableIdleCurrent: 'switch.enable_idle_current',
inCurrent: 'sensor.in_current',
isEnabled: 'switch.is_enabled',
maxChargerCurrent: 'sensor.max_charger_current',
maxCircuitCurrent: 'sensor.max_circuit_current',
isOnline: 'binary_sensor.online',
outputCurrent: 'sensor.output_current',
reasonForNoCurrent: 'sensor.reason_for_no_current',
sessionEnergy: 'sensor.session_energy',
energyPerHour: 'sensor.energy_per_hour',
smartCharging: 'switch.smart_charging',
totalPower: 'sensor.total_power',
updateAvailable: 'binary_sensor.update_available',
voltage: 'sensor.voltage',
};

export const SERVICES = {
chargerMaxCurrent: 'set_charger_max_current',
chargerDynCurrent: 'set_charger_dynamic_current',
circuitMaxCurrent: 'set_charger_circuit_max_current',
circuitDynCurrent: 'set_charger_circuit_dynamic_current'
}
chargerMaxCurrent: 'set_charger_max_current',
chargerDynCurrent: 'set_charger_dynamic_current',
circuitMaxCurrent: 'set_charger_circuit_max_current',
circuitDynCurrent: 'set_charger_circuit_dynamic_current',
};

import imageGeneric from './img/charger_generic_223x302.png';
import imageAnthracite from './img/charger_anthracite_223x302.png';
Expand All @@ -50,15 +71,14 @@ import imageBlack from './img/charger_black_223x302.png';
import imageWhite from './img/charger_white_223x302.png';
import imageDarkblue from './img/charger_darkblue_223x302.png';


export const DEFAULTIMAGE = "Generic";
export const DEFAULTIMAGE = 'Generic';
export const CHARGER_IMAGES = [
{name: "Generic", img: imageGeneric},
{name: "Anthracite", img: imageAnthracite},
{name: "Red", img: imageRed},
{name: "Black", img: imageBlack},
{name: "White", img: imageWhite},
{name: "Darkblue", img: imageDarkblue},
{ name: 'Generic', img: imageGeneric },
{ name: 'Anthracite', img: imageAnthracite },
{ name: 'Red', img: imageRed },
{ name: 'Black', img: imageBlack },
{ name: 'White', img: imageWhite },
{ name: 'Darkblue', img: imageDarkblue },
];

import ledOff from './img/charger_leds_bg.gif';
Expand All @@ -70,67 +90,38 @@ import ledBlueAll from './img/charger_leds_blue_all.gif';
import ledBlueFlashing from './img/charger_leds_blue_flashing.gif';
import ledRedFlashing from './img/charger_leds_red_flashing.gif';


export const LEDIMAGES = {
normal: {
'DEFAULT': ledOff,
'STANDBY': ledWhite2,
'PAUSED': ledWhiteAll,
'CHARGING': ledWhiteFlashing,
'READY_TO_CHARGE': ledWhiteAll,
'ERROR': ledRedFlashing,
'CAR_CONNECTED': ledWhiteAll,
},
smart: {
'DEFAULT': ledOff,
'STANDBY': ledBlue2,
'PAUSED': ledBlueAll,
'CHARGING': ledBlueFlashing,
'READY_TO_CHARGE': ledBlueAll,
'ERROR': ledRedFlashing,
'CAR_CONNECTED': ledBlueAll,
}

export const ICONS = {
'binary_sensor.cable_locked_car': 'mdi:lock',
'switch.cable_permanently_locked_charger': 'mdi:lock',
'binary_sensor.basic_schedule': 'mdi:clock-check',
'sensor.circuit_current': 'mdi:sine-wave',
'sensor.cost_per_kwh': 'mdi:currency-usd',
'sensor.dynamic_charger_current': 'mdi:sine-wave',
'sensor.dynamic_circuit_current': 'mdi:sine-wave',
'switch.enable_idle_current': 'mdi:current-dc',
'sensor.in_current': 'mdi:sine-wave',
'switch.is_enabled': 'mdi:power',
'sensor.max_charger_current': 'mdi:sine-wave',
'sensor.max_circuit_current': 'mdi:sine-wave',
'binary_sensor.online': 'mdi:wifi',
'sensor.output_current': 'mdi:sine-wave',
'sensor.reason_for_no_current': 'mdi:alert-circle',
'sensor.session_energy': 'mdi:flash',
'sensor.energy_per_hour': 'mdi:flash',
'switch.smart_charging': 'mdi:auto-fix',
'sensor.total_power': 'mdi:flash',
'binary_sensor.update_available': 'mdi:file-download',
'sensor.voltage': 'mdi:sine-wave',
};


export const ICONS={
"binary_sensor.cable_locked_car" : "mdi:lock",
"switch.cable_permanently_locked_charger" : "mdi:lock",
"binary_sensor.basic_schedule" : "mdi:clock-check",
"sensor.circuit_current" : "mdi:sine-wave",
"sensor.cost_per_kwh" : "mdi:currency-usd",
"sensor.dynamic_charger_current" : "mdi:sine-wave",
"sensor.dynamic_circuit_current" : "mdi:sine-wave",
"switch.enable_idle_current" : "mdi:current-dc",
"sensor.in_current" : "mdi:sine-wave",
"switch.is_enabled" : "mdi:power",
"sensor.max_charger_current" : "mdi:sine-wave",
"sensor.max_circuit_current" : "mdi:sine-wave",
"binary_sensor.online" : "mdi:wifi",
"sensor.output_current" : "mdi:sine-wave",
"sensor.reason_for_no_current" : "mdi:alert-circle",
"sensor.session_energy" : "mdi:flash",
"sensor.energy_per_hour" : "mdi:flash",
"switch.smart_charging" : "mdi:auto-fix",
"sensor.total_power" : "mdi:flash",
"binary_sensor.update_available" : "mdi:file-download",
"sensor.voltage" : "mdi:sine-wave",

}

export const CURRENTLIMITS = [8.0, 10.0, 16.0, 20.0, 25.0, 32.0];


export const DEFAULT_CUSTOMCARDTHEME = "theme_default";
export const DEFAULT_CUSTOMCARDTHEME = 'theme_default';
export const CUSTOM_CARD_THEMES = [
{name: "theme_default", desc: "Default (HA)"},
{name: "theme_transp_blue", desc: "Transparent Blue"},
{name: "theme_transp_black", desc: "Transparent Black"},
{name: "theme_lightgrey_blue", desc: "LightGrey Blue"}
{ name: 'theme_default', desc: 'Default (HA)' },
{ name: 'theme_transp_blue', desc: 'Transparent Blue' },
{ name: 'theme_transp_black', desc: 'Transparent Black' },
{ name: 'theme_lightgrey_blue', desc: 'LightGrey Blue' },
];


export const STATE_BUTTONS = [
{state: "PAUSED", img: imageGeneric},
];
export const STATE_BUTTONS = [{ state: 'PAUSED', img: imageGeneric }];
14 changes: 7 additions & 7 deletions src/translations/en.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"status": {
"STANDBY": "Standby",
"PAUSED": "Paused",
"CHARGING": "Charging",
"READY_TO_CHARGE": "Ready to charge",
"ERROR": "Error",
"CAR_CONNECTED": "Car connected"
"disconnected": "Disconnected",
"awaiting_start": "Paused or awaiting start",
"charging": "Charging",
"completed": "Completed or awaiting car",
"error": "Error",
"ready_to_charge": "Ready to charge"
},
"common": {
"name": "Charger Card",
Expand Down Expand Up @@ -43,7 +43,7 @@
"show_stats_aria_label_off": "Toggle display data table off",
"show_collapsibles": "Show collapsible menu buttons",
"show_collapsibles_aria_label_on": "Toggle display collapsible menus on",
"show_collapsibles_aria_label_off": "Toggle display collapsible menus off",
"show_collapsibles_aria_label_off": "Toggle display collapsible menus off",
"show_toolbar": "Show Toolbar",
"show_toolbar_aria_label_on": "Toggle display toolbar on",
"show_toolbar_aria_label_off": "Toggle display toolbar off",
Expand Down
14 changes: 7 additions & 7 deletions src/translations/nb.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"status": {
"STANDBY": "Ventemodus",
"PAUSED": "Pause",
"CHARGING": "Lader",
"READY_TO_CHARGE": "Klar til lading",
"ERROR": "Feil",
"CAR_CONNECTED": "Bil tilkoblet"
"disconnected": "Frakoblet",
"awaiting_start": "Pauset eller venter på start",
"charging": "Lader",
"completed": "Fullført eller venter på bil",
"error": "Feil",
"ready_to_charge": "Klar til lading"
},
"common": {
"name": "Charger Card",
Expand Down Expand Up @@ -43,7 +43,7 @@
"show_stats_aria_label_off": "Toggle display data table off",
"show_collapsibles": "Vis sammenslåbare menyvalg",
"show_collapsibles_aria_label_on": "Toggle display collapsible menus on",
"show_collapsibles_aria_label_off": "Toggle display collapsible menus off",
"show_collapsibles_aria_label_off": "Toggle display collapsible menus off",
"show_toolbar": "Vis verktøylinje",
"show_toolbar_aria_label_on": "Toggle display toolbar on",
"show_toolbar_aria_label_off": "Toggle display toolbar off",
Expand Down

0 comments on commit 2e9245c

Please sign in to comment.