Skip to content

Commit

Permalink
Fix up elgato stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
LordTocs committed Aug 3, 2023
1 parent c3f0129 commit fb8c626
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/castmate/src/main/plugins/elgato.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ElgatoKeyLight extends Light {
const info = await this.axios.get("accessory-info")

this.config = {
name: info.data.displayName,
name: info.data.displayName ?? info.data.productName,
plugin: "elgato",
type: "bulb",
rgb: {
Expand Down Expand Up @@ -147,7 +147,7 @@ class ElgatoLightStrip extends Light {
const lights = await this.axios.get("lights")

this.config = {
name: info.data.displayName,
name: info.data.displayName ?? info.data.productName,
plugin: "elgato",
type: "bulb",
rgb: {
Expand Down Expand Up @@ -214,9 +214,9 @@ class ElgatoIoTProvider extends IoTProvider {
this.keylightBrowser = this.bonjour.find(
{ type: "elg" },
async (service) => {
console.log(util.inspect(service))
if (service.txt.md.includes("Key")) {
const light = new ElgatoKeyLight(service)
if (service.txt.md.includes("Light Strip")) {
//Light strip?
const light = new ElgatoLightStrip(service)
try {
//console.log("Elgato Light!")
await light.init()
Expand All @@ -226,8 +226,7 @@ class ElgatoIoTProvider extends IoTProvider {
console.error(err)
}
} else {
//Light strip?
const light = new ElgatoLightStrip(service)
const light = new ElgatoKeyLight(service)
try {
//console.log("Elgato Light!")
await light.init()
Expand Down

0 comments on commit fb8c626

Please sign in to comment.