Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
basbruss committed Jun 12, 2023
2 parents 398aed6 + fbf4703 commit 4402d40
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
ulm_custom_card_yagrasdemonde_lights_count_language_variables:
variables:
ulm_custom_card_yagrasdemonde_lights_count_light_0: "Свет отключен"
ulm_custom_card_yagrasdemonde_lights_count_light_1: "1 лампа включена"
ulm_custom_card_yagrasdemonde_lights_count_light_many: "лампы включены"
ulm_custom_card_yagrasdemonde_lights_count_cover_0: "Нет открытых ворот"
ulm_custom_card_yagrasdemonde_lights_count_cover_1: "1 ворота открыты"
ulm_custom_card_yagrasdemonde_lights_count_cover_many: "ворот открыты"
85 changes: 85 additions & 0 deletions custom_cards/custom_chip_tesla_temperature/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Custom-chip `Tesla Temperature`

![example-image](../../docs/assets/img/custom_chip_tesla_temperature.png)

## Information

Custom-chip `Tesla Temperature` is a chip showing the status of set temperature and current inside temperature.

## Changelog

<details>
<summary>1.0.0</summary>
Initial release
</details>

## Usage

```yaml
- type: "custom:button-card"
template: custom_chip_tesla_temperature
variables:
ulm_chip_hvac: climate.tesla_hvac_climate_system
```
## Requirements
[UI Lovelace Minimalist](https://github.com/UI-Lovelace-Minimalist/UI)
[Tesla Custom Integration](https://github.com/alandtse/tesla)
## Variables
<table>
<tr>
<th>Variable</th>
<th>Default</th>
<th>Required</th>
<th>Explanation</th>
</tr>
<tr>
<td>ulm_chip_hvac</td>
<td></td>
<td>Yes</td>
<td>Tesla hvac entity</td>
</tr>
</table>
## Template code
```yaml
---
custom_chip_tesla_temperature:
template:
- "chip_icon_label"
- "ulm_translation_engine"
variables:
ulm_card_enable_popup: false
triggers_update: "all"
label: |
[[[
function convertTemperature(temp) {
if (parseFloat(temp) == temp && Math.floor(temp) != temp) {
return parseFloat(temp).toFixed(1);
}
return temp;
}
var set_temp = states[variables.ulm_chip_hvac].attributes.temperature;
var inside_temp = states[variables.ulm_chip_hvac].attributes.current_temperature;
var label = "Set " + convertTemperature(set_temp) + "°" + " / Current " + convertTemperature(inside_temp) + "°";
return label;
]]]
icon: |
[[[
var preset = states[variables.ulm_chip_hvac].attributes.preset_mode.toLowerCase();
var icon = {
"normal": "mdi:thermometer",
"defrost": "mdi:snowflake-melt",
"keep on": "mdi:heat-wave",
"dog mode": "mdi:dog-side",
"camp mode": "mdi:campfire",
"default": "mdi:thermometer"
}
return (icon[preset] || icon["default"]);
]]]
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
custom_chip_tesla_temperature:
template:
- "chip_icon_label"
- "ulm_translation_engine"
variables:
ulm_card_enable_popup: false
triggers_update: "all"
label: |
[[[
function convertTemperature(temp) {
if (parseFloat(temp) == temp && Math.floor(temp) != temp) {
return parseFloat(temp).toFixed(1);
}
return temp;
}
var set_temp = states[variables.ulm_chip_hvac].attributes.temperature;
var inside_temp = states[variables.ulm_chip_hvac].attributes.current_temperature;
var label = "Set " + convertTemperature(set_temp) + "°" + " / Current " + convertTemperature(inside_temp) + "°";
return label;
]]]
icon: |
[[[
var preset = states[variables.ulm_chip_hvac].attributes.preset_mode;
var icon = {
"Normal": "mdi:thermometer",
"Defrost": "mdi:snowflake-melt",
"Keep On": "mdi:heat-wave",
"Dog Mode": "mdi:dog-side",
"Camp Mode": "mdi:campfire",
"default": "mdi:thermometer"
}
return (icon[preset] || icon["default"]);
]]]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4402d40

Please sign in to comment.