Skip to content

Commit

Permalink
Merge pull request #612 from alex2844/master
Browse files Browse the repository at this point in the history
support action.devices.types.GAME_CONSOLE
  • Loading branch information
Caprico85 authored Nov 25, 2024
2 parents 38444fd + d7b923f commit d62e24c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ This is a generic node that supports the following Google [devices](https://deve
* Fireplace
* Freezer
* Fryer
* Game console
* Garage
* Gate
* Grill
Expand Down
5 changes: 5 additions & 0 deletions devices/device.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
<option value='FIREPLACE' data-i18n='device.device_type.FIREPLACE'></option>
<option value='FREEZER' data-i18n='device.device_type.FREEZER'></option>
<option value='FRYER' data-i18n='device.device_type.FRYER'></option>
<option value='GAME_CONSOLE' data-i18n='device.device_type.GAME_CONSOLE'></option>
<option value='GARAGE' data-i18n='device.device_type.GARAGE'></option>
<option value='GATE' data-i18n='device.device_type.GATE'></option>
<option value='GRILL' data-i18n='device.device_type.GRILL'></option>
Expand Down Expand Up @@ -3325,6 +3326,10 @@
recommended_traits = ["cook", "startstop", "timer"];
required_traits = ["onoff"];
break;
case "GAME_CONSOLE": // Game console
recommended_traits = ["volume"];
required_traits = ["appselector", "mediastate", "onoff", "transportcontrol"];
break;
case "GARAGE": // Garage
recommended_traits = [];
required_traits = ["openclose"];
Expand Down
6 changes: 6 additions & 0 deletions devices/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ module.exports = function (RED) {
case "FRYER": // Fryer
this.trait.onoff = true;
break;
case "GAME_CONSOLE": // Game console
this.trait.appselector = true;
this.trait.mediastate = true;
this.trait.onoff = true;
this.trait.transportcontrol = true;
break;
case "GARAGE": // Garage
this.trait.openclose = true;
break;
Expand Down
1 change: 1 addition & 0 deletions devices/locales/en-US/device.json
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@
"FIREPLACE": "Fireplace",
"FREEZER": "Freezer",
"FRYER": "Fryer",
"GAME_CONSOLE": "Game console",
"GARAGE": "Garage",
"GATE": "Gate",
"GRILL": "Grill",
Expand Down

0 comments on commit d62e24c

Please sign in to comment.