Skip to content

Commit

Permalink
adding debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarlsen committed Nov 20, 2019
1 parent a3319d5 commit b6df3cf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,19 @@ entities:
- entity: light.kokken
```

## Debug

To show the current values of your lights you can add the `debug` attribute

```yaml
type: 'custom:light-with-profiles'
title: Lys
debug: true
entities:
- entity: light.spisestuen
- entity: light.entreen
- entity: light.kokken
```

---
<a href="https://www.buymeacoffee.com/tcarlsen" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/white_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>
10 changes: 9 additions & 1 deletion light-with-profiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@ class LightWithProfiles extends LitElement {
const stateObj = this.hass.states[ent.entity];
return stateObj
? html`
<span class="label">${ent.name ? ent.name : stateObj.attributes.friendly_name}</span>
<span class="label">
${ent.name ? ent.name : stateObj.attributes.friendly_name}
${this.config.debug
? html`
<small>x,y: ${stateObj.attributes.xy_color ? stateObj.attributes.xy_color.toString() : 'null'}</small>
<small>brightness: ${stateObj.attributes.brightness ? stateObj.attributes.brightness.toString() : 'null'}</small>
`
: ''}
</span>
<div class="profiles">
${ent.profiles
? ent.profiles.map(profile => {
Expand Down

0 comments on commit b6df3cf

Please sign in to comment.