Fix exposing temperature sensor by correcting invalid units

This commit is contained in:
Adrian Jagielak 2025-07-23 13:09:22 +02:00
parent c26f4ad92f
commit 6dea4e5e77
No known key found for this signature in database
GPG Key ID: 0818CF7AF6C62BFB
5 changed files with 11 additions and 11 deletions

View File

@ -9,7 +9,7 @@ export function handlePresenceSensor(client: MqttClient, dev: any, svc: any) {
uniq_id: uid,
dev_cla: "presence",
stat_t: `${base}/state`,
unit_of_meas: "",
unit_of_meas: "°C",
device: { identifiers: [dev.id.toString()], name: dev.name, model: dev.model }
}), { retain: true });

View File

@ -9,7 +9,7 @@ export function handleTempSensor(client: MqttClient, dev: any, svc: any) {
uniq_id: uid,
dev_cla: "temperature",
stat_t: `${base}/state`,
unit_of_meas: "",
unit_of_meas: "°C",
device: { identifiers: [dev.id.toString()], name: dev.name, model: dev.model }
}), { retain: true });

View File

@ -5,9 +5,9 @@ import { HaComponent } from "../ha/publish_device";
export function sensor_dew__components(vinculumDeviceData: VinculumPd7Device, svc: InclusionReportService): { [key: string]: HaComponent } {
if (!svc.address) { return {}; }
let unit = svc.props?.sup_units?.[0] ?? "";
if (unit === 'C') unit = '';
if (unit === 'F') unit = '';
let unit = svc.props?.sup_units?.[0] ?? "°C";
if (unit === 'C') unit = '°C';
if (unit === 'F') unit = '°F';
return {
[svc.address]: {

View File

@ -5,9 +5,9 @@ import { HaComponent } from "../ha/publish_device";
export function sensor_temp__components(vinculumDeviceData: VinculumPd7Device, svc: InclusionReportService): { [key: string]: HaComponent } {
if (!svc.address) { return {}; }
let unit = svc.props?.sup_units?.[0] ?? "";
if (unit === 'C') unit = '';
if (unit === 'F') unit = '';
let unit = svc.props?.sup_units?.[0] ?? "°C";
if (unit === 'C') unit = '°C';
if (unit === 'F') unit = '°F';
return {
[svc.address]: {

View File

@ -5,9 +5,9 @@ import { HaComponent } from "../ha/publish_device";
export function sensor_wattemp__components(vinculumDeviceData: VinculumPd7Device, svc: InclusionReportService): { [key: string]: HaComponent } {
if (!svc.address) { return {}; }
let unit = svc.props?.sup_units?.[0] ?? "";
if (unit === 'C') unit = '';
if (unit === 'F') unit = '';
let unit = svc.props?.sup_units?.[0] ?? "°C";
if (unit === 'C') unit = '°C';
if (unit === 'F') unit = '°F';
return {
[svc.address]: {