Skip to content

Commit

Permalink
fix turn_on/off for groups
Browse files Browse the repository at this point in the history
  • Loading branch information
ljmerza committed Apr 4, 2020
1 parent c7a50b6 commit a0e7160
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 19 deletions.
27 changes: 13 additions & 14 deletions dist/light-entity-card.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/light-entity-card.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "light-entity-card",
"version": "3.0.0",
"version": "3.2.2",
"description": "A light-entity card for Home Assistant Lovelace UI",
"keywords": [
"home-assistant",
Expand Down
7 changes: 6 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ import style from './style';

import defaultConfig from './defaults';
import LightEntityCardEditor from './index-editor';
import packageJson from '../package.json';


const editorName = 'light-entity-card-editor';
customElements.define(editorName, LightEntityCardEditor);

/* eslint no-console: 0 */
console.info(`%c LIGHT-ENTITY-CARD \n%c Version ${packageJson.version} `, "color: orange; font-weight: bold; background: black", "color: white; font-weight: bold; background: dimgray");


class LightEntityCard extends LitElement {
static get properties() {
Expand Down Expand Up @@ -460,7 +464,8 @@ class LightEntityCard extends LitElement {
*/
callEntityService(payload, stateObj, state) {
if (this._isUpdating) return;
const entityType = stateObj.entity_id.split('.')[0];
let entityType = stateObj.entity_id.split('.')[0];
if (entityType === 'group') entityType= 'homeassistant';

this.hass.callService(entityType, state || LightEntityCard.cmdToggle.on, {
entity_id: stateObj.entity_id,
Expand Down
1 change: 0 additions & 1 deletion webpack/config.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const path = require('path');

module.exports = {
entry: './src/index.js',
devtool: 'source-map',
output: {
filename: 'light-entity-card.js',
path: path.resolve(__dirname, '../dist')
Expand Down
3 changes: 2 additions & 1 deletion webpack/config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ const merge = require('webpack-merge');
const commonConfig = require('./config.common');

module.exports = merge(commonConfig, {
mode: 'development'
mode: 'development',
devtool: 'source-map',
});

0 comments on commit a0e7160

Please sign in to comment.