diff --git a/PROGRESS.md b/PROGRESS.md index d2d38f2e..34b7ad46 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -78,8 +78,8 @@ List grouped by domains and categorized based on their similar behaviors ### Date - [ ] date -- [ ] datetime -- [ ] input_datetime +- [x] datetime +- [x] input_datetime - [ ] parse date in state - [ ] time - [ ] time input like `timer` diff --git a/README.md b/README.md index 52295063..e93725fe 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ For "Operating System" or "Supervised" installation methods, you can install ha- 1. **Add Repository**: To begin, add the ha-fusion add-on repository to your Home Assistant instance. Click the button below or manually add the repository using this URL: . - [![Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.](https://my.home-assistant.io/badges/supervisor_add_addon_repository.svg)](https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Fmatt8707%2Faddon-ha-fusion) + [![Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.](https://my.home-assistant.io/badges/supervisor_add_addon_repository.svg)](https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Fmatt8707%2Faddon-ha-fusion) 2. **Install Add-on**: After adding the repository, refresh the add-on store page. Locate ha-fusion in the list and proceed with the installation. @@ -37,12 +37,12 @@ If you're using the "Container" or "Core" installation methods, ha-fusion can be 1. **Docker Compose File**: Place your edited copy of the [docker-compose.yml](https://github.com/matt8707/ha-fusion/blob/main/docker-compose.yml) file in a suitable directory. 2. **Create Container**: - Run the following commands in your terminal to start the container: + Run the following commands in your terminal to start the container: - ```bash - cd path/to/docker-compose.yml - docker-compose up -d ha-fusion - ``` + ```bash + cd path/to/docker-compose.yml + docker-compose up -d ha-fusion + ``` #### Update diff --git a/src/lib/Main/Button.svelte b/src/lib/Main/Button.svelte index 7fc0ed46..a89795c2 100644 --- a/src/lib/Main/Button.svelte +++ b/src/lib/Main/Button.svelte @@ -204,6 +204,11 @@ openModal(() => import('$lib/Modal/InputNumberModal.svelte'), { sel }); break; + case 'datetime': + case 'input_datetime': + openModal(() => import('$lib/Modal/InputDateModal.svelte'), { sel }); + break; + case 'input_select': case 'select': openModal(() => import('$lib/Modal/InputSelectModal.svelte'), { sel }); diff --git a/src/lib/Main/Camera.svelte b/src/lib/Main/Camera.svelte index 38d966d2..d4596f2c 100644 --- a/src/lib/Main/Camera.svelte +++ b/src/lib/Main/Camera.svelte @@ -60,7 +60,8 @@ title={$lang('camera')} style:width="{width}px" style:aspect-ratio="{width} / {height}" - style:transform="scale({Math.min(offsetHeight / height, offsetWidth / width)}) translate(-50%, -50%)" + style:transform="scale({Math.min(offsetHeight / height, offsetWidth / width)}) translate(-50%, + -50%)" /> {/if} diff --git a/src/lib/Modal/InputDateModal.svelte b/src/lib/Modal/InputDateModal.svelte new file mode 100644 index 00000000..f7b9912d --- /dev/null +++ b/src/lib/Modal/InputDateModal.svelte @@ -0,0 +1,120 @@ + + +{#if isOpen} + +

{getName(sel, entity)}

+ +

+ {#if domain === 'datetime' || type === 'datetime'} + {$lang('date_or_time')} + {:else if type} + {$lang(type)} + {/if} + + + {format(state, type || 'datetime')} + +

+ + + + +
+{/if} + +