Skip to content

Commit

Permalink
fixed historical data
Browse files Browse the repository at this point in the history
  • Loading branch information
dannybloe committed May 31, 2016
1 parent c34bebd commit d3f8659
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dzVents/HistoricalStorage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ local function HistoricalStorage(data, maxItems, maxHours, maxMinutes, getData)
end

function self.reset()
self.storage = {}
for k, v in pairs(self.storage) do
self.storage[k] = nil
end
self.size = 0
self.newData = nil
end
Expand Down
1 change: 1 addition & 0 deletions dzVents/dzVents history.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[1.0.1]
* Added updateCustomSensor(value) method.
* Fixed reset() for historical data.

[1.0][1.0-beta2]
* Deprecated setNew(). Use add() instead. You can now add multiple values at once in a script by calling multiple add()s in succession.
Expand Down
1 change: 1 addition & 0 deletions dzVents/tests/testEventHelpersStorage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ describe('event helper storage', function()
hs.reset()
assert.is_same(0, hs.size)
assert.is_nil(hs.getLatest())
assert.is_same({}, hs._getForStorage())
end)

it('should return a subset', function()
Expand Down

0 comments on commit d3f8659

Please sign in to comment.