openhab / openhab-js

openHAB JavaScript Library for JavaScript Scripting Automation
https://www.openhab.org/addons/automation/jsscripting/
Eclipse Public License 2.0
38 stars 31 forks source link

README: Fix Item persistene reference #336

Closed jlaur closed 3 weeks ago

jlaur commented 3 weeks ago

The member was renamed from history in #331.

I tested if history is still available for backwards compatibility, but it appears not:

var averageSpotPrice = items.Energi_Data_Service_Spot_Price.history.averageBetween(tomorrowPeakStart, tomorrowPeakEnd);

Result:

Failed to execute action: 1(Error: Failed to execute rule Test-persistence-00356c1b-7b21-4fc2-8789-9b804de7577f: TypeError: undefined has no such function "averageBetween": TypeError: undefined has no such function "averageBetween"