Skip to content

Commit

Permalink
Add auto-start-stop and disable-circle and powerEntity
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Marc Collin committed Nov 2, 2024
1 parent e4e19ff commit c97377e
Show file tree
Hide file tree
Showing 8 changed files with 424 additions and 276 deletions.
265 changes: 141 additions & 124 deletions dist/versatile-thermostat-ui-card.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/climate-card-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const entitySharedConfigStruct = object({
entity: optional(string()),
name: optional(string()),
icon: optional(string()),
autoStartStopEnableEntity: optional(string()),
powerEntity: optional(string())
});
type EntitySharedConfig = Infer<typeof entitySharedConfigStruct>;

Expand All @@ -29,7 +31,9 @@ export type ClimateCardConfig = LovelaceCardConfig &
EntitySharedConfig &
{
disable_name?: boolean;
disable_circle?: boolean;
disable_window?: boolean;
disable_autoStartStop?: boolean;
disable_overpowering?: boolean;
disable_heat?: boolean;
disable_cool?: boolean;
Expand All @@ -52,7 +56,9 @@ export const climateCardConfigStruct = assign(
entitySharedConfigStruct,
object({
disable_name: optional(boolean()),
disable_circle: optional(boolean()),
disable_window: optional(boolean()),
disable_autoStartStop: optional(boolean()),
disable_overpowering: optional(boolean()),
disable_heat: optional(boolean()),
disable_cool: optional(boolean()),
Expand Down
2 changes: 1 addition & 1 deletion src/const.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const CARD_VERSION = '0.5.0';
export const CARD_VERSION = '0.6.2';
11 changes: 11 additions & 0 deletions src/ha/data/sensor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { HassEntityAttributeBase, HassEntityBase } from "home-assistant-js-websocket";

interface SensorEntityAttributes extends HassEntityAttributeBase {
value: number;
unit: string;
friendly_name: string;
}

export interface SensorEntity extends HassEntityBase {
attributes: SensorEntityAttributes;
}
17 changes: 14 additions & 3 deletions src/localize/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
"editor": {
"card": {
"climate": {
"autoStartStopEnableEntity": "Auto-start/stop entity",
"powerEntity": "Power consumption entity",
"disable_circle": "Désactiver le cercle",
"disable_window": "Disable window",
"disable_autoStartStop": "Disable auto-startStop",
"disable_overpowering": "Disable overpowering",
"disable_heat": "Disable heat",
"disable_cool": "Disable cool",
Expand All @@ -27,15 +31,17 @@
},
"extra_states": {
"window_open": "Window open",
"window_bypass": "Bypass window activated",
"night_mode": "Night mode",
"eco": "Eco",
"overpowering": "Overpowering",
"overpowering": "Overpowering detected",
"none": "Manual",
"comfort": "Comfort",
"boost": "Boost",
"frost": "Frost",
"power": "Overpowering",
"activity": "Activity",
"activity": "Activity detected",
"motion": "Motion detected",
"undefined": "None",
"auto_regulation_light": "Light",
"auto_regulation_medium": "Medium",
Expand All @@ -57,7 +63,12 @@
"fan_mute": "Mute",
"fan_turbo": "Turbo",
"fan_none": "None",
"fan_auto": "Auto",
"change_message": "Double click to change preset",
"toggle_message": "Click to toggle"
"toggle_message": "Click to toggle",
"auto_start_stop": "Stoppé par auto-start/stop",
"auto_start_stop_enable": "Active/désactive l'auto-start/stop",
"auto_start_stop_label": "Auto-start/stop",
"temp_unavailable": "-"
}
}
16 changes: 14 additions & 2 deletions src/localize/languages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
"editor": {
"card": {
"climate": {
"autoStartStopEnableEntity": "Entité - auto-start/stop",
"powerEntity": "Entité - puissance consommée",
"disable_circle": "Désactiver le cercle",
"disable_window": "Désactiver fenêtre status",
"disable_autoStartStop": "Désactiver auto-startStop",
"disable_overpowering": "Désactiver sur-puissance status",
"disable_heat": "Désactiver mode chauffe",
"disable_cool": "Désactiver mode clim",
Expand All @@ -26,14 +30,17 @@
},
"extra_states": {
"window_open": "Fenêtre ouverte",
"window_bypass": "Bypass fenêtre activé",
"eco": "Eco",
"overpowering": "Sur-puissance",
"overpowering": "Sur-puissance détectée",
"none": "Manuel",
"comfort": "Confort",
"boost": "Boost",
"frost": "Hors-gel",
"power": "Délestage",
"activity": "Activité",
"presence": "Présence détectée",
"motion": "Mouvement détecté",
"auto_regulation_light": "Légère",
"auto_regulation_medium": "Moyenne",
"auto_regulation_strong": "Forte",
Expand All @@ -54,7 +61,12 @@
"fan_mute": "Silence",
"fan_turbo": "Turbo",
"fan_none": "Aucun",
"fan_auto": "Auto",
"change_message": "Double clic pour changer le preset",
"toggle_message": "Clic pour basculer"
"toggle_message": "Clic pour basculer",
"auto_start_stop": "Stoppé par auto-start/stop",
"auto_start_stop_enable": "Active/désactive l'auto-start/stop",
"auto_start_stop_label": "Auto-start/stop",
"temp_unavailable": "-"
}
}
12 changes: 11 additions & 1 deletion src/versatile-thermostat-ui-card-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,28 @@ const loadHaComponents = (version: string) => {
}
};

const CLIMATE_LABELS = ["disable_name", "disable_window", "disable_overpowering", "disable_heat", "disable_cool", "disable_heat_cool", "disable_auto", "disable_dry", "disable_fan_only", "disable_off", "disable_menu", "disable_security_warning", "disable_buttons", "set_current_as_main", "disable_power_infos", "disable_auto_fan_infos"] as string[];
const CLIMATE_LABELS = ["autoStartStopEnableEntity", "powerEntity", "disable_name", "disable_circle", "disable_window", "disable_autoStartStop", "disable_overpowering", "disable_heat", "disable_cool", "disable_heat_cool", "disable_auto", "disable_dry", "disable_fan_only", "disable_off", "disable_menu", "disable_security_warning", "disable_buttons", "set_current_as_main", "disable_power_infos", "disable_auto_fan_infos"] as string[];

const computeSchema = memoizeOne(
(): any[] => [
{ name: "entity", selector: { entity: { domain: ["climate"] } } },
{ name: "name", selector: { text: {} } },
{
type: "grid",
name: "",
schema: [
{ name: "autoStartStopEnableEntity", selector: { entity: { domain: ["switch"] } } },
{ name: "powerEntity", selector: { entity: { domain: ["sensor", "input_number"] } } },
]
},
{
type: "grid",
name: "",
schema: [
{ name: "disable_name", selector: { boolean: {} } },
{ name: "disable_circle", selector: { boolean: {} } },
{ name: "disable_window", selector: { boolean: {} } },
{ name: "disable_autoStartStop", selector: { boolean: {} } },
{ name: "disable_overpowering", selector: { boolean: {} } },
{ name: "disable_heat", selector: { boolean: {} } },
{ name: "disable_cool", selector: { boolean: {} } },
Expand Down
Loading

0 comments on commit c97377e

Please sign in to comment.