Fix rate_of_change function.
This commit is contained in:
parent
0d5074fd4e
commit
9e59d5254b
|
@ -449,4 +449,4 @@ class NeoHub:
|
||||||
message = {"VIEW_ROC": names}
|
message = {"VIEW_ROC": names}
|
||||||
|
|
||||||
result = await self._send(message)
|
result = await self._send(message)
|
||||||
return result
|
return result.__dict__
|
||||||
|
|
|
@ -4,9 +4,10 @@
|
||||||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||||
|
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
from types import SimpleNamespace
|
from types import SimpleNamespace
|
||||||
|
|
||||||
|
from async_property import async_property
|
||||||
|
|
||||||
from neohubapi.enums import Weekday
|
from neohubapi.enums import Weekday
|
||||||
|
|
||||||
|
|
||||||
|
@ -122,6 +123,8 @@ class NeoStat(SimpleNamespace):
|
||||||
result = await self._hub.set_diff(switching_differential, [self])
|
result = await self._hub.set_diff(switching_differential, [self])
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
@async_property
|
||||||
async def rate_of_change(self):
|
async def rate_of_change(self):
|
||||||
result = await self._hub.rate_of_change([self])
|
result = await self._hub.rate_of_change([self])
|
||||||
return result
|
roc = result[self.name]
|
||||||
|
return roc
|
||||||
|
|
Loading…
Reference in New Issue