-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(device): Fix device node losing trigger id
fix(device): Fix translations not loading Home Assistant changed the entity_id field from being an entity id to the id of the entity registry fix(device)!: Fix device action to send entity to HA fixes #1032, fixes #634, fixes #1045
- Loading branch information
Showing
18 changed files
with
419 additions
and
402 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export enum DeviceType { | ||
Action = 'action', | ||
Trigger = 'trigger', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,7 @@ | |
} | ||
} | ||
} | ||
|
||
#ha-device { | ||
margin-left: 4px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,31 @@ | ||
import * as haServer from '../../../editor/haserver'; | ||
import { | ||
HassDeviceActions, | ||
HassDeviceCapabilities, | ||
} from '../../../types/home-assistant'; | ||
import { DeviceEndpoint, fetchDeviceData } from './utils'; | ||
|
||
export const inputCount = 1; | ||
|
||
export const getCapabilitiesList = async ( | ||
export async function getCapabilitiesList( | ||
action: any, | ||
): Promise<HassDeviceCapabilities> => | ||
await haServer.fetch('deviceActionCapabilities', { | ||
action, | ||
}); | ||
): Promise<HassDeviceCapabilities> { | ||
return fetchDeviceData<HassDeviceCapabilities>( | ||
DeviceEndpoint.DeviceActionCapabilities, | ||
{ event: JSON.stringify(action) }, | ||
'ha-device.error.failed_to_fetch_capabilities', | ||
); | ||
} | ||
|
||
export const getEventList = async ( | ||
export async function getEventList( | ||
deviceId: string, | ||
): Promise<HassDeviceActions> => | ||
await haServer.fetch('deviceActions', { | ||
deviceId, | ||
}); | ||
): Promise<HassDeviceActions> { | ||
return fetchDeviceData<HassDeviceActions>( | ||
DeviceEndpoint.DeviceActions, | ||
{ deviceId }, | ||
'ha-device.error.failed_to_fetch_actions', | ||
); | ||
} | ||
|
||
export const setDefaultOutputs = () => { | ||
export function setDefaultOutputs() { | ||
return []; | ||
}; | ||
} |
Oops, something went wrong.