Skip to content

Commit

Permalink
Add instructions to change unit_of_measurement
Browse files Browse the repository at this point in the history
closes #24
  • Loading branch information
pinkywafer committed Feb 6, 2020
1 parent 00a9c32 commit 803b0d7
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ The 'anniversaries' component is a Home Assistant custom sensor which counts dow
* [State and Attributes](#state-and-attributes)
* [State](#state)
* [Attributes](#attributes)
* [Notes about unit of measurement](#notes-about-unit-of-measurement)

## Installation

Expand Down Expand Up @@ -93,7 +94,29 @@ anniversaries:
* current years: number of years have passed since the first occurance (ie, current age) _(NOT displayed if year is unknown)_
* date: The date of the first occurence _(or the date of the next occurence if year is unknown)_ (formatted by the date_format attribute if set)
* weeks_remaining: The number of weeks until the anniversary
* unit_of_measurement: 'Days' By default, this is displayed after the state. _this is NOT translate-able. See below for work-around_

### Notes about unit of measurement

Unit_of_measurement is *not* translate-able.
You can, however, change the unit of measurement with a customization. There are two ways to do this:

* _NOTE that each sensor would require it's own customization_

_This example would replace `Days` with `Dias`_

* In customize.yaml:

```yaml
sensor.your_sensor_id:
unit_of_measurement: Dias
```

* Use the Customizations from the Configuration menu:
1. Select your sensor
2. under "Pick an attribute to override" select unit_of_measurement
3. Type `Dias` in the box
4. Press save

[patreon-shield]: https://c5.patreon.com/external/logo/become_a_patron_button.png
[patreon]: https://www.patreon.com/pinkywafer

23 changes: 23 additions & 0 deletions info.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,29 @@ Attributes:
* current years: number of years have passed since the first occurance (ie, current age) _(NOT displayed if year is unknown)_
* date: The date of the first occurence _(or the date of the next occurence if year is unknown)_ (formatted by the date_format attribute if set)
* weeks_remaining: The number of weeks until the anniversary
* unit_of_measurement: 'Days' By default, this is displayed after the state. _this is NOT translate-able. See below for work-around_

### Notes about unit of measurement

Unit_of_measurement is *not* translate-able.
You can, however, change the unit of measurement with a customization. There are two ways to do this:

* _NOTE that each sensor would require it's own customization_

_This example would replace `Days` with `Dias`_

* In customize.yaml:

```yaml
sensor.your_sensor_id:
unit_of_measurement: Dias
```
* Use the Customizations from the Configuration menu:
1. Select your sensor
2. under "Pick an attribute to override" select unit_of_measurement
3. Type `Dias` in the box
4. Press save

## Configuration

Expand Down

0 comments on commit 803b0d7

Please sign in to comment.