Skip to content

Commit

Permalink
Add fields to show if color and infrared are supported
Browse files Browse the repository at this point in the history
  • Loading branch information
meisenzahl committed Jun 14, 2019
1 parent 0716eff commit ead23a7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/lifx/LifxLamp.vala
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,18 @@ namespace Lifx {
this._obj.set_int_member ("kelvin", value);
}
}

public bool supports_infrared {
get {
if (!this._obj.has_member ("supportsInfrared")) {
this.supports_infrared = false;
}

return this._obj.get_boolean_member ("supportsInfrared");
}
set {
this._obj.set_boolean_member ("supportsInfrared", value);
}
}
}
}
13 changes: 13 additions & 0 deletions src/models/Lamp.vala
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,17 @@ public class Lamp : Thing {
this._obj.set_string_member ("model", value);
}
}

public bool supports_color {
get {
if (!this._obj.has_member ("supportsColor")) {
this.supports_color = false;
}

return this._obj.get_boolean_member ("supportsColor");
}
set {
this._obj.set_boolean_member ("supportsColor", value);
}
}
}

0 comments on commit ead23a7

Please sign in to comment.