Skip to content

Commit

Permalink
update device classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt committed Dec 15, 2023
1 parent b0731c5 commit 1737c31
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ You need to have one of the following Home Assistant classes in the input descri
### Inputs
The name of the Inputs in Inception needs to contain one of the following words (case insensitive), otherwise it won't show up in Home Assistant:
- `motion`
- `pir`
- `louvre`
- `garage`
- `door`
- `gate`
Expand All @@ -60,8 +62,6 @@ The name of the Inputs in Inception needs to contain one of the following words
- `break`
- `glass`
- `window`
- `louvre`


### Outputs
The name of the Inputs in Inception needs to contain one of the following words (case insensitive), otherwise it won't show up in Home Assistant:
Expand Down
8 changes: 6 additions & 2 deletions src/entities/homeAssistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ const startControlInputs = async () => {

let deviceClass = [
'motion',
'pir',
'louvre',
'garage',
'door',
'gate',
Expand All @@ -134,17 +136,19 @@ const startControlInputs = async () => {
'vibration',
'shock',
'cold',
'heat',
'light',
'moisture',
'break',
'glass',
'window'
'window',
'heat'
].find(device => name.toLowerCase().includes(device)) || 'opening';

// override found device
if (deviceClass === 'garage') {
deviceClass = 'garage_door';
} else if (deviceClass === 'pir') {
deviceClass = 'motion';
} else if (deviceClass === 'rex') {
deviceClass = 'door';
} else if (deviceClass === 'gate') {
Expand Down

0 comments on commit 1737c31

Please sign in to comment.