You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fact that HomeyAPIV2.ManagerDevices.Device is typed as object raises errors for such lines of code:
const capability: string = 'target_temperature'
const value: any = device.capabilitiesObj[capability]?.value
Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'. typescript(7053)
No index signature with a parameter of type 'string' was found on type '{}'.
or
const value: any = device.capabilitiesObj.target_temperature?.value
Property 'target_temperature' does not exist on type 'object'. typescript(2339)
The text was updated successfully, but these errors were encountered:
The problem is that the type Device is not complete, as you can see on the following screenshots: Property 'capabilities' does not exist on type 'Device'.ts(2339) Property 'capabilitiesObj' does not exist on type 'Device'.ts(2339)
OlivierZal
changed the title
[TypeScript] HomeyAPIV2.ManagerDevices.Device typed as object
[TypeScript] HomeyAPIxxx.ManagerDevices.Device misses properties (capabilities, capabilitiesObj...)
Jul 24, 2023
Fact that
HomeyAPIV2.ManagerDevices.Device
is typed asobject
raises errors for such lines of code:or
The text was updated successfully, but these errors were encountered: