From dad1c04eec87ebdff07c21fe6a7dc8e24f329487 Mon Sep 17 00:00:00 2001 From: SiriosDev <26876994+SiriosDev@users.noreply.github.com> Date: Thu, 23 May 2024 23:28:52 +0200 Subject: [PATCH 1/4] readme: fix and optimization --- README.md | 99 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 54 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 40e2bf7..8489305 100644 --- a/README.md +++ b/README.md @@ -12,13 +12,13 @@ Consider joining us! The Horizon Card tracks the position of the Sun and the Moon over the horizon and shows the times of various Sun and Moon events, as well as their current azimuth and elevation, in a visually appealing and easy-to-read format. -Light theme default look | Dark theme default look -:-----------------------------:|:-----------------------------: -![](https://raw.githubusercontent.com/rejuvenate/lovelace-horizon-card/main/images/default-light.png) | ![](https://raw.githubusercontent.com/rejuvenate/lovelace-horizon-card/main/images/default-dark.png) +| Light theme default look | Dark theme default look | +| :---------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------: | +| ![](https://raw.githubusercontent.com/rejuvenate/lovelace-horizon-card/main/images/default-light.png) | ![](https://raw.githubusercontent.com/rejuvenate/lovelace-horizon-card/main/images/default-dark.png) | -Light theme full look | Dark theme full look -:-----------------------------:|:-----------------------------: -![](https://raw.githubusercontent.com/rejuvenate/lovelace-horizon-card/main/images/full-light.png) | ![](https://raw.githubusercontent.com/rejuvenate/lovelace-horizon-card/main/images/full-dark.png) +| Light theme full look | Dark theme full look | +| :------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------: | +| ![](https://raw.githubusercontent.com/rejuvenate/lovelace-horizon-card/main/images/full-light.png) | ![](https://raw.githubusercontent.com/rejuvenate/lovelace-horizon-card/main/images/full-dark.png) | ### How it works @@ -34,10 +34,9 @@ The elevation of the Sun follows a predetermined curve that approximates the act If showing the moon phase is enabled, the icon will be rotated to match the approximate view for your latitude. You can disable this by setting `moon_phase_rotation: 0` or set a different angle to match your location or preferences. - ## Installation -Please ensure you have [HACS](https://hacs.xyz/) and the [Sun integration](https://www.home-assistant.io/integrations/sun/) enabled in your Home Assistant setup. +Please ensure you have [HACS](https://hacs.xyz/), the [Sun integration](https://www.home-assistant.io/integrations/sun/) and the [Moon Integration](https://www.home-assistant.io/integrations/moon/) (_for the moon info_) enabled in your Home Assistant setup. If you have My Home Assistant configured, simply click here: @@ -59,11 +58,13 @@ Installation via HACS is recommended, but a manual setup is supported. 1. If necessary, create a `www` folder in your configuration folder (where `configuration.yaml` is found). 1. Copy the downloaded file into your `www` folder. 1. Add the resources, depending on whether you manage your Lovelace resources via the UI or YAML: - 1. **UI:** Go to [![My Home Assistant](https://my.home-assistant.io/badges/lovelace_resources.svg)](https://my.home-assistant.io/redirect/lovelace_resources) and click **Add resource** *(or navigate to Settings -> Dashboards -> Resources -> Add Resource)* and enter: + + 1. **UI:** Go to [![My Home Assistant](https://my.home-assistant.io/badges/lovelace_resources.svg)](https://my.home-assistant.io/redirect/lovelace_resources) and click **Add resource** _(or navigate to Settings -> Dashboards -> Resources -> Add Resource)_ and enter: **URL**: `/local/lovelace-horizon-card.js` **Type**: JavaScript Module + 1. **YAML:** Add the configuration to your `ui-lovelace.yaml`: ```yaml @@ -89,57 +90,63 @@ Installation via HACS is recommended, but a manual setup is supported. 1. Add a new card with `type: custom:horizon-card` to your cards list and include any additional configuration from the Config section below. -> Note: If you encounter an error like *Custom element doesn't exist*, clear the cache and reload the page. +> Note: If you encounter an error like _Custom element doesn't exist_, clear the cache and reload the page. ## Configuration ### General options -| Name | Accepted values | Description | Default | -|---------------------|-----------------|---------------------------------------------------|----------------------------------------------------------------| -| title | *string* | Card title | Doesn't display a title by default | -| moon | *boolean* | Shows the Moon together with the Sun | `true` | -| refresh_period | *number* | Refresh period between updates, in seconds | 60 | -| fields | See below | Fine-tuned control over visible fields | | -| southern_flip | *boolean* | Draws the graph in the opposite direction | `true` in the Southern hemisphere, `false` in the Northern one | -| moon_phase_rotation | *number* | Angle in degrees for rotating the moon phase icon | Determined from the latitude | +| Name | Accepted values | Description | Default | +| ------------------- | ------------------------------- | ------------------------------------------------- | -------------------------------------------------------------- | +| title | _string_ | Card title | Doesn't display a title by default | +| moon | _boolean_ | Shows the Moon together with the Sun | `true` | +| refresh_period | _number_ | Refresh period between updates, in seconds | `60` | +| fields | See [below](#visibility-fields) | Fine-tuned control over visible fields | | +| southern_flip | _boolean_ | Draws the graph in the opposite direction | `true` in the Southern hemisphere, `false` in the Northern one | +| moon_phase_rotation | _number_ | Angle in degrees for rotating the moon phase icon | Determined from the latitude | + +_Example: [here](#example-config)_ ### Advanced options In general, you should not need to set any of these as they override Home Assistant's settings or set debug options. -| Name | Accepted values | Description | Default | -|-----------|----------------------------------------------|--------------------------------------------------------------------------------|-----------------------------------------------------| -| language | See below | Changes card language | Home Assistant language or English if not supported | -| time_format | `language`, `12`, `24` | Set to `12` or `24` to force 12/24 hour clock | `language` - uses default for configured language | -| number_format | `language`, `comma_decimal`, `decimal_comma` | Set to `comma_decimal` or `decimal_comma` to force 123.45/123,45 number format | `language` - uses default for configured language | -| latitude | *number* | Latitude used for calculations | Home Assistant's latitude | -| longitude | *number* | Longitude used for calculations | Home Assistant's longitude | -| elevation | *number* | Elevation (above sea) used for calculations | Home Assistant's elevation | -| time_zone | *string* | Time zone (IANA) used for calculations and time presentation | Home Assistant's time zone | -| now | *Date* | Overrides the current moment shown on the card | None, i.e., always show the current moment | -| debug_level | *number* | Sets debug level, 0 and up | 0, i.e., no debug | +| Name | Accepted values | Description | Default | +| ------------- | -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- | +| language | See [below](#languages) | Changes card language | Home Assistant profile language or English if not supported | +| time_format | `language`, `12`, `24` | Set to `12` or `24` to force 12/24 hour clock, `language` follow the language representation | `language` | +| number_format | `language`, `comma_decimal`, `decimal_comma` | Set to `comma_decimal` or `decimal_comma` to force 123.45/123,45 number format, `language` follow the language representation | `language` | +| latitude | _number_ | Latitude used for calculations | Home Assistant latitude | +| longitude | _number_ | Longitude used for calculations | Home Assistant longitude | +| elevation | _number_ | Elevation (above sea) used for calculations | Home Assistant elevation | +| time_zone | _string_ | Time zone (IANA) used for calculations and time presentation | Home Assistant time zone | +| now | _Date_ | Overrides the current moment shown on the card | Current time | +| debug_level | _number_ | Sets debug level, `0` (no debug), `1` and `2` | `0` | + +_Example: [here](#example-config)_ ### Visibility Fields Supported settings inside the `fields` setting: -| Name | Accepted values | Description | Default | -|----------------|-----------------|-----------------------------|--------------------------| -| sunrise | *boolean* | Show sunrise time | `true` | -| sunset | *boolean* | Show sunset time | `true` | -| dawn | *boolean* | Show dawn time | `true` | -| noon | *boolean* | Show solar noon time | `true` | -| dusk | *boolean* | Show dusk time | `true` | -| azimuth | *boolean* | Show Sun and Moon azimuth | `false` | -| sun_azimuth | *boolean* | Show Sun azimuth | the value of `azimuth` | -| moon_azimuth | *boolean* | Show Moon azimuth | the value of `azimuth` | -| elevation | *boolean* | Show Sun and Moon elevation | `false` | -| sun_elevation | *boolean* | Show Sun elevation | the value of `elevation` | -| moon_elevation | *boolean* | Show Moon elevation | the value of `elevation` | -| moonrise | *boolean* | Show moonrise time | `false` | -| moonset | *boolean* | Show moonset time | `false` | -| moon_phase | *boolean* | Show the Moon phase | `false` | +| Name | Accepted values | Description | Default | +| -------------- | --------------- | --------------------------- | -------------------- | +| sunrise | _boolean_ | Show sunrise time | `true` | +| sunset | _boolean_ | Show sunset time | `true` | +| dawn | _boolean_ | Show dawn time | `true` | +| noon | _boolean_ | Show solar noon time | `true` | +| dusk | _boolean_ | Show dusk time | `true` | +| azimuth | _boolean_ | Show Sun and Moon azimuth | `false` | +| sun_azimuth | _boolean_ | Show Sun azimuth | Value of `azimuth` | +| moon_azimuth | _boolean_ | Show Moon azimuth | Value of `azimuth` | +| elevation | _boolean_ | Show Sun and Moon elevation | `false` | +| sun_elevation | _boolean_ | Show Sun elevation | Value of `elevation` | +| moon_elevation | _boolean_ | Show Moon elevation | Value of `elevation` | +| moonrise | _boolean_ | Show moonrise time | `false` | +| moonset | _boolean_ | Show moonset time | `false` | +| moon_phase | _boolean_ | Show the Moon phase | `false` | + +_Example: [here](#example-config)_ ### Languages @@ -182,6 +189,8 @@ Supported options for the `language` setting: - `zh-Hans` Chinese, simplified - `zh-Hant` Chinese, traditional +_Example: [here](#example-config)_ + ### Caveats The Moon phase name (if the field `moon_phase` is enabled) is obtained via the [Moon integration](https://www.home-assistant.io/integrations/moon/). If the integration is not installed, the card will still show the Moon phase as a human-readable constant followed by `(!)`, e.g., `waning_gibbuous (!)`. Due to the way Home Assistant works, the localized Moon phase name will always be in Home Assistant's language and not in the language set for the card via the `language` option. From c237ab88e70ca8605ed1a0e3dcdefe100d07cde3 Mon Sep 17 00:00:00 2001 From: SiriosDev <26876994+SiriosDev@users.noreply.github.com> Date: Thu, 23 May 2024 23:32:26 +0200 Subject: [PATCH 2/4] readme: added no_card in advanced option --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8489305..d57348b 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,7 @@ In general, you should not need to set any of these as they override Home Assist | longitude | _number_ | Longitude used for calculations | Home Assistant longitude | | elevation | _number_ | Elevation (above sea) used for calculations | Home Assistant elevation | | time_zone | _string_ | Time zone (IANA) used for calculations and time presentation | Home Assistant time zone | +| no_card | _boolean_ | Disable card background | `false` | | now | _Date_ | Overrides the current moment shown on the card | Current time | | debug_level | _number_ | Sets debug level, `0` (no debug), `1` and `2` | `0` | @@ -228,6 +229,7 @@ latitude: 42.55 longitude: 23.25 elevation: 1500 time_zone: Europe/Sofia +no_card: false now: 2023-07-06T00:30:05+0300 debug_level: 0 ``` From 344ef3e099b020916841ede5e727a6b9487c82f2 Mon Sep 17 00:00:00 2001 From: SiriosDev <26876994+SiriosDev@users.noreply.github.com> Date: Thu, 23 May 2024 23:33:54 +0200 Subject: [PATCH 3/4] readme: modified google weather "citation" --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d57348b..11a9ab8 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ [![hacs_badge](https://img.shields.io/badge/HACS-Default-41BDF5.svg?style=for-the-badge)](https://github.com/hacs/integration) + # Lovelace Horizon Card -A [Home Assistant Dashboard Card](https://www.home-assistant.io/dashboards/) available through the [Home Assistant Community Store](https://hacs.xyz) and inspired by Google Weather. +A [Home Assistant Dashboard Card](https://www.home-assistant.io/dashboards/) available through the [Home Assistant Community Store](https://hacs.xyz) and inspired by Google Weather (pre 2024 version). Lovelace Horizon Card is a fork of the original [home-assistant-sun-card](https://github.com/AitorDB/home-assistant-sun-card) project by [@AitorDB](https://github.com/AitorDB) to continue the great work and distribute the responsibility of supporting and advancing the project among a team of people. From ad72b5208e751ddc8611509b84e5d9b97ef25662 Mon Sep 17 00:00:00 2001 From: SiriosDev <26876994+SiriosDev@users.noreply.github.com> Date: Thu, 23 May 2024 23:47:11 +0200 Subject: [PATCH 4/4] read me: added fork call to action --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 11a9ab8..6981b86 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ A [Home Assistant Dashboard Card](https://www.home-assistant.io/dashboards/) ava Lovelace Horizon Card is a fork of the original [home-assistant-sun-card](https://github.com/AitorDB/home-assistant-sun-card) project by [@AitorDB](https://github.com/AitorDB) to continue the great work and distribute the responsibility of supporting and advancing the project among a team of people. -Consider joining us! +Consider joining us! Click [here to fork](https://github.com/rejuvenate/lovelace-horizon-card/fork) ## Introduction