Skip to content

Commit

Permalink
additional service params
Browse files Browse the repository at this point in the history
fixes #82
  • Loading branch information
htmltiger authored Jul 25, 2023
1 parent b95c225 commit 3fb7bf2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions numberbox-card.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
((LitElement) => {

console.info('NUMBERBOX_CARD 4.13');
console.info('NUMBERBOX_CARD 4.14');
const html = LitElement.prototype.html;
const css = LitElement.prototype.css;
class NumberBox extends LitElement {
Expand Down Expand Up @@ -225,7 +225,7 @@ publishNum(dhis){
if(dhis.pending===false){return;}
const s=dhis.config.service.split('.');
if(s[0]=='input_datetime'){dhis.pending=dhis.numTime(dhis.pending,1);}
const v={entity_id: dhis.config.entity, [dhis.config.param]: dhis.pending};
const v = { ...dhis.config.service_params, [dhis.config.param]: dhis.pending };
dhis.pending=false;
dhis.old.state=dhis.state;
dhis._hass.callService(s[0], s[1], v);
Expand Down Expand Up @@ -374,6 +374,7 @@ setConfig(config) {
refresh: 0,
initial: undefined,
moreinfo: config.entity,
service_params: {entity_id: config.entity},
...config
};
if(this.config.service.split('.').length < 2){
Expand Down

0 comments on commit 3fb7bf2

Please sign in to comment.