Compare commits
3 Commits
4a9a32ef3e
...
0932bad462
| Author | SHA1 | Date | |
|---|---|---|---|
| 0932bad462 | |||
| 508681a969 | |||
| fbc469da57 |
@ -7,11 +7,12 @@
|
|||||||
#MMM-HomeAssistant-Touch .ha-entity {
|
#MMM-HomeAssistant-Touch .ha-entity {
|
||||||
border: 0.1rem solid grey;
|
border: 0.1rem solid grey;
|
||||||
border-radius: 0.5rem;
|
border-radius: 0.5rem;
|
||||||
padding: 0.5rem;
|
|
||||||
margin: 0.5rem;
|
margin: 0.5rem;
|
||||||
height: 7rem;
|
width: max-content;
|
||||||
width: 7rem;
|
height: 1rem;
|
||||||
font-size: 18px;
|
padding: 1rem 0rem 0rem 0rem;
|
||||||
|
font-size: 25px;
|
||||||
|
line-height: 0em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#MMM-HomeAssistant-Touch .ha-entity .title,
|
#MMM-HomeAssistant-Touch .ha-entity .title,
|
||||||
|
|||||||
@ -102,10 +102,10 @@ function loadEntityClasses() {
|
|||||||
this.entities = {};
|
this.entities = {};
|
||||||
|
|
||||||
// load UI Classes
|
// load UI Classes
|
||||||
for (const entity of this.config.entities) {
|
for (const entity in this.config.entities_name) {
|
||||||
const entityClass = this.UIClassFactory.getEntityClass(entity);
|
const entityClass = this.UIClassFactory.getEntityClass(entity);
|
||||||
if (entityClass) {
|
if (entityClass) {
|
||||||
this.entities[entity] = new entityClass(entity, this);
|
this.entities[entity] = new entityClass(entity, this, this.config.entities_name[entity]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,13 +1,16 @@
|
|||||||
class Base {
|
class Base {
|
||||||
constructor(id, mm) {
|
constructor(id, mm, name = "") {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.type = id.split(".")[0];
|
this.type = id.split(".")[0];
|
||||||
this.name = id;
|
if (name == "")
|
||||||
|
this.name = id;
|
||||||
|
else
|
||||||
|
this.name = name;
|
||||||
this.mm = mm;
|
this.mm = mm;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateState(state) {
|
updateState(state) {
|
||||||
this.name = (state.attributes || {}).friendly_name || this.id;
|
//this.name = (state.attributes || {}).friendly_name || this.id;
|
||||||
this.state = state.state;
|
this.state = state.state;
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user