1 Commits

Author SHA1 Message Date
dependabot[bot]
f463439ad2 Bump docker/login-action from 3.5.0 to 3.7.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 3.5.0 to 3.7.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v3.5.0...v3.7.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: 3.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-02 06:25:59 +00:00
3 changed files with 10 additions and 41 deletions

View File

@@ -98,7 +98,7 @@ jobs:
- name: Login to GitHub Container Registry
if: env.BUILD_ARGS != '--test'
uses: docker/login-action@v3.5.0
uses: docker/login-action@v3.7.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}

View File

@@ -370,25 +370,16 @@ export function _meter__components(
break;
}
// Map FIMP unit names to HA-compatible unit_of_measurement values
const haUnit =
unit === 'power_factor' ? '' :
unit === 'VAr' ? 'var' :
unit === 'kVArh' ? 'kvarh' : unit;
const component: SensorComponent = {
unique_id: componentId,
platform: 'sensor',
entity_category: 'diagnostic',
name: friendlyName,
unit_of_measurement: unit,
state_class: stateClass,
value_template: `{{ value_json['${svc.addr}'].meter.${unit}.val | default(0) }}`,
};
if (haUnit) {
component.unit_of_measurement = haUnit;
}
if (deviceClass) {
component.device_class = deviceClass;
}
@@ -469,24 +460,16 @@ export function _meter__components(
break;
}
// Map FIMP unit names to HA-compatible unit_of_measurement values
const haUnit =
unit === 'VAr' ? 'var' :
unit === 'kVArh' ? 'kvarh' : unit;
const component: SensorComponent = {
unique_id: componentId,
platform: 'sensor',
entity_category: 'diagnostic',
name: friendlyName,
unit_of_measurement: unit,
state_class: stateClass,
value_template: `{{ value_json['${svc.addr}'].meter_export.${unit}.val | default(0) }}`,
};
if (haUnit) {
component.unit_of_measurement = haUnit;
}
if (deviceClass) {
component.device_class = deviceClass;
}
@@ -527,25 +510,14 @@ export function _meter__components(
// Determine unit based on value name
let unit = '';
const isPhasePower =
if (
valueName.startsWith('p_') ||
valueName.startsWith('p1') ||
valueName.startsWith('p2') ||
valueName.startsWith('p3');
if (isPhasePower && valueName.includes('_react')) {
unit = 'var';
} else if (isPhasePower && valueName.includes('_apparent')) {
unit = 'VA';
} else if (isPhasePower || valueName === 'dc_p') {
unit = 'W';
} else if (
(valueName.startsWith('e_') ||
valueName.startsWith('e1') ||
valueName.startsWith('e2') ||
valueName.startsWith('e3')) &&
valueName.includes('_react')
valueName.startsWith('p3') ||
valueName === 'dc_p'
) {
unit = 'kvarh';
unit = 'W';
} else if (
valueName.startsWith('e_') ||
valueName.startsWith('e1') ||
@@ -593,9 +565,9 @@ export function _meter__components(
}
// Set suggested display precision
if (unit === 'kWh' || unit === 'kvarh') {
if (unit === 'kWh') {
component.suggested_display_precision = 3;
} else if (unit === 'W' || unit === 'V' || unit === 'A' || unit === 'var' || unit === 'VA') {
} else if (unit === 'W' || unit === 'V' || unit === 'A') {
component.suggested_display_precision = 1;
} else if (unit === 'Hz') {
component.suggested_display_precision = 2;

View File

@@ -72,15 +72,12 @@ export function _sensor_numeric__components(
if (!data) return undefined;
let device_class = data[0];
const device_class = data[0];
const name = data[1];
let unit = svc.props?.sup_units?.[0] ?? data[2];
if (unit === 'C') unit = '°C';
if (unit === 'F') unit = '°F';
if (unit === 'kph') unit = 'km/h';
if (unit === 'Lux') unit = 'lx';
// HA rejects illuminance + %; drop device_class for percentage-reporting sensors
if (device_class === 'illuminance' && unit === '%') device_class = undefined;
const state_class = data[3];
return {