Skip to content

Commit

Permalink
Update widget.html
Browse files Browse the repository at this point in the history
  • Loading branch information
wmpmills authored May 16, 2024
1 parent 1e5d053 commit 7f37235
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions widget.html
Original file line number Diff line number Diff line change
Expand Up @@ -217,21 +217,18 @@ <h1 class="title" id="closeProximiity">...</h1>
console.log(
`Getting Temperature and Humidity values from In-Room Navigator [${navID}]`
);
temperature.innerHTML = convertTemp(
await xapi.Status.Peripherals.ConnectedDevice[
navID
].RoomAnalytics.AmbientTemperature.get()
);
humidity.innerHTML =
await xapi.Status.Peripherals.ConnectedDevice[
navID
].RoomAnalytics.RelativeHumidity.get();

const tValue = await xapi.Status.Peripherals.ConnectedDevice[navID].RoomAnalytics.AmbientTemperature.get()
temperature.innerHTML = convertTemp(tValue)

const hValue = await xapi.Status.Peripherals.ConnectedDevice[navID].RoomAnalytics.RelativeHumidity.get();
humidity.innerHTML = hValue + "%";

xapi.Status.RoomAnalytics.AmbientTemperature.on((value) => {
temperature.innerHTML = convertTemp(value);
});

xapi.Status.RoomAnalytics.RelativeHumidity.on((value) => {
xapi.Status.Peripherals.ConnectedDevice[navID].RoomAnalytics.RelativeHumidity.on((value) => {
humidity.innerHTML = value + "%";
});
} else {
Expand All @@ -251,8 +248,8 @@ <h1 class="title" id="closeProximiity">...</h1>
}

try {
humidity.innerHTML =
await xapi.Status.RoomAnalytics.RelativeHumidity.get();
const value = await xapi.Status.RoomAnalytics.RelativeHumidity.get();
humidity.innerHTML = value+"%";
xapi.Status.RoomAnalytics.RelativeHumidity.on((value) => {
humidity.innerHTML = value+"%";
});
Expand Down

0 comments on commit 7f37235

Please sign in to comment.