mirror of
https://github.com/adrianjagielak/home-assistant-futurehome.git
synced 2025-09-13 15:47:08 +00:00
Fix exposing temperature sensor by correcting invalid units
This commit is contained in:
parent
c26f4ad92f
commit
6dea4e5e77
@ -9,7 +9,7 @@ export function handlePresenceSensor(client: MqttClient, dev: any, svc: any) {
|
|||||||
uniq_id: uid,
|
uniq_id: uid,
|
||||||
dev_cla: "presence",
|
dev_cla: "presence",
|
||||||
stat_t: `${base}/state`,
|
stat_t: `${base}/state`,
|
||||||
unit_of_meas: "℃",
|
unit_of_meas: "°C",
|
||||||
device: { identifiers: [dev.id.toString()], name: dev.name, model: dev.model }
|
device: { identifiers: [dev.id.toString()], name: dev.name, model: dev.model }
|
||||||
}), { retain: true });
|
}), { retain: true });
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ export function handleTempSensor(client: MqttClient, dev: any, svc: any) {
|
|||||||
uniq_id: uid,
|
uniq_id: uid,
|
||||||
dev_cla: "temperature",
|
dev_cla: "temperature",
|
||||||
stat_t: `${base}/state`,
|
stat_t: `${base}/state`,
|
||||||
unit_of_meas: "℃",
|
unit_of_meas: "°C",
|
||||||
device: { identifiers: [dev.id.toString()], name: dev.name, model: dev.model }
|
device: { identifiers: [dev.id.toString()], name: dev.name, model: dev.model }
|
||||||
}), { retain: true });
|
}), { retain: true });
|
||||||
|
|
||||||
|
@ -5,9 +5,9 @@ import { HaComponent } from "../ha/publish_device";
|
|||||||
export function sensor_dew__components(vinculumDeviceData: VinculumPd7Device, svc: InclusionReportService): { [key: string]: HaComponent } {
|
export function sensor_dew__components(vinculumDeviceData: VinculumPd7Device, svc: InclusionReportService): { [key: string]: HaComponent } {
|
||||||
if (!svc.address) { return {}; }
|
if (!svc.address) { return {}; }
|
||||||
|
|
||||||
let unit = svc.props?.sup_units?.[0] ?? "℃";
|
let unit = svc.props?.sup_units?.[0] ?? "°C";
|
||||||
if (unit === 'C') unit = '℃';
|
if (unit === 'C') unit = '°C';
|
||||||
if (unit === 'F') unit = '℉';
|
if (unit === 'F') unit = '°F';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
[svc.address]: {
|
[svc.address]: {
|
||||||
|
@ -5,9 +5,9 @@ import { HaComponent } from "../ha/publish_device";
|
|||||||
export function sensor_temp__components(vinculumDeviceData: VinculumPd7Device, svc: InclusionReportService): { [key: string]: HaComponent } {
|
export function sensor_temp__components(vinculumDeviceData: VinculumPd7Device, svc: InclusionReportService): { [key: string]: HaComponent } {
|
||||||
if (!svc.address) { return {}; }
|
if (!svc.address) { return {}; }
|
||||||
|
|
||||||
let unit = svc.props?.sup_units?.[0] ?? "℃";
|
let unit = svc.props?.sup_units?.[0] ?? "°C";
|
||||||
if (unit === 'C') unit = '℃';
|
if (unit === 'C') unit = '°C';
|
||||||
if (unit === 'F') unit = '℉';
|
if (unit === 'F') unit = '°F';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
[svc.address]: {
|
[svc.address]: {
|
||||||
|
@ -5,9 +5,9 @@ import { HaComponent } from "../ha/publish_device";
|
|||||||
export function sensor_wattemp__components(vinculumDeviceData: VinculumPd7Device, svc: InclusionReportService): { [key: string]: HaComponent } {
|
export function sensor_wattemp__components(vinculumDeviceData: VinculumPd7Device, svc: InclusionReportService): { [key: string]: HaComponent } {
|
||||||
if (!svc.address) { return {}; }
|
if (!svc.address) { return {}; }
|
||||||
|
|
||||||
let unit = svc.props?.sup_units?.[0] ?? "℃";
|
let unit = svc.props?.sup_units?.[0] ?? "°C";
|
||||||
if (unit === 'C') unit = '℃';
|
if (unit === 'C') unit = '°C';
|
||||||
if (unit === 'F') unit = '℉';
|
if (unit === 'F') unit = '°F';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
[svc.address]: {
|
[svc.address]: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user