Skip to content

Commit ba80ef4

Browse files
committed
rm redundant endpoint
1 parent f7af689 commit ba80ef4

1 file changed

Lines changed: 1 addition & 19 deletions

File tree

http-server/server.js

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ app.post("/", async (req, res) => {
112112
}
113113
});
114114

115+
// XXX LEGACY endpoint, will be removed soon
115116
// POST /devices/:id/leds – set led's of a specific device (pc component, such as mainboard, ram, etc)
116117
// Body example: { color: {red: 100, green: 100, blue: 100 }, mode: "Breathing", ledIndex: X }
117118
app.post("/devices/:id/leds", async (req, res) => {
@@ -162,25 +163,6 @@ app.post("/devices/:id/leds", async (req, res) => {
162163
}
163164
});
164165

165-
// TODO
166-
// POST /devices/:id/zone/:zoneId – set zone color(s)
167-
// Body: { colors: [...], fast?: boolean }
168-
app.post("/devices/:id/zone/:zoneId", async (req, res) => {
169-
try {
170-
const id = parseInt(req.params.id);
171-
const zoneId = parseInt(req.params.zoneId);
172-
const { colors, fast = false } = req.body;
173-
const device = (await client.getAllControllerData())[id];
174-
const zone = device.zones.find((z) => z.id === zoneId);
175-
if (!zone) throw new Error("Zone not found");
176-
await client.updateZoneColors(id, zoneId, colors, fast);
177-
return res.status(200).json({ zone: zoneId });
178-
} catch (err) {
179-
console.error(err);
180-
return res.status(500).send(err.message);
181-
}
182-
});
183-
184166
// TODO
185167
// POST /devices/:id/profile – load or save profile
186168
// Body: { profile: name_or_index, save?: boolean }

0 commit comments

Comments
 (0)