diff --git a/PROGRESS.md b/PROGRESS.md index 4823efc3..e441be2e 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -38,11 +38,11 @@ List grouped by domains and categorized based on their similar behaviors ### Climate - [x] climate - - [ ] horizontal temp select - - [ ] issue + - [x] horizontal temp select + - [x] issue - [x] fan -- [ ] humidifier -- [ ] water_heater +- [x] humidifier +- [x] water_heater ### Other diff --git a/src/lib/Components/StateLogic.svelte b/src/lib/Components/StateLogic.svelte index 33c649dd..0077c434 100644 --- a/src/lib/Components/StateLogic.svelte +++ b/src/lib/Components/StateLogic.svelte @@ -53,6 +53,10 @@ {:else if getDomain(entity_id) === 'humidifier' && entity?.state === 'on' && attributes?.action} {$lang('humidifier_' + attributes?.action)} + +{:else if getDomain(entity_id) === 'water_heater'} + {$lang('water_heater_' + entity?.state)} + {:else if entity_id && (getDomain(entity_id) === 'input_number' || getDomain(entity_id) === 'number')} {Number(state) || $lang('unknown')} diff --git a/src/lib/Main/Button.svelte b/src/lib/Main/Button.svelte index 49e48d8d..7b724c83 100644 --- a/src/lib/Main/Button.svelte +++ b/src/lib/Main/Button.svelte @@ -264,6 +264,10 @@ openModal(() => import('$lib/Modal/CameraModal.svelte'), { sel }); break; + case 'water_heater': + openModal(() => import('$lib/Modal/WaterHeaterModal.svelte'), { sel }); + break; + case 'humidifier': openModal(() => import('$lib/Modal/HumidifierModal.svelte'), { sel }); break; diff --git a/src/lib/Modal/WaterHeaterModal.svelte b/src/lib/Modal/WaterHeaterModal.svelte new file mode 100644 index 00000000..0d38477d --- /dev/null +++ b/src/lib/Modal/WaterHeaterModal.svelte @@ -0,0 +1,179 @@ + + +{#if isOpen} + +

{getName(sel, entity)}

+ + +

{$lang('toggle')}

+ + { + const service = entity?.state !== 'off' ? 'turn_off' : 'turn_on'; + handleEvent(service); + }} + /> + + + {#if entity?.state} +

{$lang('state')}

+ + {$lang('water_heater_' + entity?.state)} + {/if} + + +

+ {$lang('target')} + + + {#if attributes?.current_temperature} + {attributes?.current_temperature}° -> + {/if} + + {attributes?.temperature}° + +

+ + {#if attributes?.temperature} + { + handleEvent('set_temperature', event?.detail); + }} + /> + {/if} + + + {#if supports?.OPERATION_MODE && options} +

+ {$lang('mode')} +

+ +