Parse features only during updates (#527)

Every time emeter functions were called features had to be re-parsed. For power strips, thats a lot of re-parses. Only parse them when we update.
This commit is contained in:
J. Nick Koston
2023-10-07 09:18:47 -10:00
committed by GitHub
parent 0ec0826cc7
commit 9930311b54
3 changed files with 25 additions and 11 deletions

View File

@@ -259,7 +259,7 @@ class SmartStripPlug(SmartPlug):
self.parent = parent
self.child_id = child_id
self._last_update = parent._last_update
self._sys_info = parent._sys_info
self._set_sys_info(parent.sys_info)
self._device_type = DeviceType.StripSocket
self.modules = {}
self.protocol = parent.protocol # Must use the same connection as the parent