Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…_moon into master
  • Loading branch information
jeremyhamm committed Oct 24, 2020
2 parents 533a25b + 6c1a2d0 commit 75ab196
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Custom card for displaying the current phase of the moon in [Home Assistant](https://www.home-assistant.io). This card uses the [Sun Entity](https://www.home-assistant.io/integrations/sun/) to determine the background color of the card.
Custom card for displaying the current phase of the moon in [Home Assistant](https://www.home-assistant.io) using the [moon integration](https://www.home-assistant.io/integrations/moon/). This card also (optionally) uses the [Sun Entity](https://www.home-assistant.io/integrations/sun/) to determine the background color of the card.

#### When sun is above horizon
![Day example](/example/moon-day-example.png)
Expand All @@ -29,11 +29,11 @@ Link `moon-card` inside your ui-lovelace.yaml.
type: module

## Config
Name | Type | Default | Description
------------ | ------------- | ------------- | -------------
type | string | **Required** | `custom:moon-phases`
entity | string | **Required** | `sensor.moon`
entity | string | Optional | `sun.sun`
Name | Type | Default | Reference | Description
------------ | ------------- | ------------- | ------------- | -------------
type | string | **Required** | `custom:moon-phases` | Card reference
entity | string | **Required** | `sensor.moon` | Moon entity
entity | string | Optional | `sun.sun` | Include if you would like the card to use light mode while sun is up

#### Example
type: 'custom:moon-phases'
Expand Down
4 changes: 2 additions & 2 deletions moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
*/
const getMoonPhase = (phase) => {
switch(phase) {
case 'new':
case 'new_moon':
return 'New Moon';
case 'waxing_crescent':
return 'Waxing Crescent Moon';
case 'first_quarter':
return 'First Quarter Moon';
case 'waxing_gibbous':
return 'Waxing Gibbous Moon';
case 'full':
case 'full_moon':
return 'Full Moon';
case 'waning_gibbous':
return 'Waning Gibbous Moon';
Expand Down

0 comments on commit 75ab196

Please sign in to comment.