mirror of
https://github.com/home-assistant/frontend.git
synced 2026-04-02 00:27:49 +01:00
Fix distribution card stub error (#29915)
* Fix distribution card stub error * unit check not required
This commit is contained in:
@@ -68,9 +68,9 @@ export class HuiDistributionCard
|
||||
|
||||
// Strategy 1: Try to find power sensors (W, kW) - most common use case
|
||||
const powerFilter = (stateObj: HassEntity): boolean => {
|
||||
const unit = stateObj.attributes.unit_of_measurement;
|
||||
const stateValue = Number(stateObj.state);
|
||||
return (unit === "W" || unit === "kW") && !isNaN(stateValue);
|
||||
const deviceClass = stateObj.attributes.device_class;
|
||||
return deviceClass === "power" && !isNaN(stateValue);
|
||||
};
|
||||
|
||||
let foundEntities = findEntities(
|
||||
|
||||
Reference in New Issue
Block a user