Skip to content

Commit

Permalink
🐛 fix city display + clean css (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
JaouherK authored May 22, 2021
1 parent d41411a commit 1262408
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 945 deletions.
Binary file modified Release/com.jk.weather.streamDeckPlugin
Binary file not shown.
15 changes: 15 additions & 0 deletions Sources/com.jk.weather.sdPlugin/pi/main_pi.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,21 @@
</select>
</div>

<div class="sdpi-item">
<div class="sdpi-item-label">Display city name</div>
<select
class="sdpi-item-value select"
id="displayCity"
onchange="updateSettings()"
>
<option value="0">Hide</option>
<option value="1">Show in top left</option>
<option value="2">Show in top right</option>
<option value="3">Show in bottom left</option>
<option value="4">Show in bottom right</option>
</select>
</div>

<div class="sdpi-item">
<button class="sdpi-item-value" onclick="openPage(getProviderUrl())">
Get my API key
Expand Down
6 changes: 5 additions & 1 deletion Sources/com.jk.weather.sdPlugin/pi/main_pi.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function connectElgatoStreamDeckSocket(
const payload = jsonObj.payload.settings;
initiateElement("cityName", payload.cityName);
initiateElement("frequency", payload.frequency, 0);
initiateElement("displayCity", payload.displayCity, 0);
initiateElement("unit", payload.unit, "celsius");
}
if (jsonObj.event === "didReceiveGlobalSettings") {
Expand All @@ -68,6 +69,9 @@ function updateSettings() {
payload.cityName = document.getElementById("cityName").value;
payload.frequency = document.getElementById("frequency").value;
payload.unit = document.getElementById("unit").value;
payload.displayCity = parseInt(
document.getElementById("displayCity").value
);
const json = {
event: "setSettings",
context: uuid,
Expand Down Expand Up @@ -104,7 +108,7 @@ function openPage(site) {
}

function getProviderUrl() {
const provider = document.getElementById("provider").value || 'weatherApi';
const provider = document.getElementById("provider").value || "weatherApi";
let url;
switch (provider) {
case "weatherApi":
Expand Down
Loading

0 comments on commit 1262408

Please sign in to comment.