CHNAGE: added size comparism

This commit is contained in:
2024-08-02 07:07:44 +02:00
parent f98a3035e1
commit 15365cfbfe
2 changed files with 25 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
get device_entity(): MQTTEntity {
if (
this._device_entity_cached.listlen ===
this.generatorService.created_entity_num
)
return this._device_entity_cached.entity;
let entites = Array.from(this.generatorService.created_enteties).sort(
(a, b) => {
return a.size - b.size;
}
);
this._device_entity_cached = {
entity: entites[0],
listlen: this.generatorService.created_entity_num,
};
console.log('sizing');
console.log(this._device_entity_cached);
return entites[0];
}