Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property 'state' does not exist on type 'PersistedItem'.ts(2339) #398

Closed
Dopeyr opened this issue Nov 10, 2024 · 0 comments · Fixed by #399
Closed

Property 'state' does not exist on type 'PersistedItem'.ts(2339) #398

Dopeyr opened this issue Nov 10, 2024 · 0 comments · Fixed by #399
Labels
bug Something isn't working

Comments

@Dopeyr
Copy link
Contributor

Dopeyr commented Nov 10, 2024

Expected Behavior

A vscode to recognise state on PersistemItem instance

Current Behavior

image

Possible Solution

This seems to have been introduced as a result of this change - PersistedItem no longer extends PersistedState in the type definitions.

1d6bbb4#diff-aca6c6b1ce0defe142e0b6183c946e9ba2d064b1b8196a0d8208e724aa910673L544

Switching Extends {@link items.PersistedState}. to Extends {@link PersistedState}. in https://github.com/openhab/openhab-js/blob/v5.7.2/src/items/item-persistence.js#L80 resolves this for me.

Steps to Reproduce (for Bugs)

const previousLatLon = itemHistory.previousState(false, 'jdbc')?.state.toString()

image

Context

I think this affects v5.8.0 too but I'm not using the milestone versions of 4.3 so I am on 5.7.2

Your Environment

  • openHAB version used (check Main UI -> About): 4.2.1
  • openhab-js version used (run console.log('openhab-js ' + utils.OPENHAB_JS_VERSION) from a JS script):
  • Operating System and version (e.g. desktop or mobile, Windows 10, Raspbian Buster, ...): Debian bullseye
@Dopeyr Dopeyr added the bug Something isn't working label Nov 10, 2024
Dopeyr pushed a commit to Dopeyr/openhab-js that referenced this issue Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant