hass-core/homeassistant/components/tplink
J. Nick Koston 269429aa0c
Only calculate the tplink emeter values once per update cycle (#115587)
The sensor platform has to read the native_value multiple times
during the state write cycle which means the integration calculated
the value multiple times. Switch to using _attr_native_value to
ensure the calculations in the library are only done once per
state write.

To demonstrate this issue,
+        _LOGGER.warning("Fetch name value for %s", self.entity_id)
was added to `def native_value`:
```
2024-04-14 06:58:52.506 WARNING (MainThread) [homeassistant.components.tplink.sensor] Fetch name value for sensor.kasa_smart_plug_542b_0_kasa_smart_plug_542b_0_current_consumption
2024-04-14 06:58:52.506 WARNING (MainThread) [homeassistant.components.tplink.sensor] Fetch name value for sensor.kasa_smart_plug_542b_0_kasa_smart_plug_542b_0_total_consumption
2024-04-14 06:58:52.507 WARNING (MainThread) [homeassistant.components.tplink.sensor] Fetch name value for sensor.kasa_smart_plug_542b_0_kasa_smart_plug_542b_0_today_s_consumption
2024-04-14 06:58:52.507 WARNING (MainThread) [homeassistant.components.tplink.sensor] Fetch name value for sensor.kasa_smart_plug_542b_0_kasa_smart_plug_542b_0_voltage
2024-04-14 06:58:52.508 WARNING (MainThread) [homeassistant.components.tplink.sensor] Fetch name value for sensor.kasa_smart_plug_542b_0_kasa_smart_plug_542b_0_current
2024-04-14 06:58:52.509 WARNING (MainThread) [homeassistant.components.tplink.sensor] Fetch name value for sensor.kasa_smart_plug_542b_0_kasa_smart_plug_542b_0_current_consumption
2024-04-14 06:58:52.510 WARNING (MainThread) [homeassistant.components.tplink.sensor] Fetch name value for sensor.kasa_smart_plug_542b_0_kasa_smart_plug_542b_0_total_consumption
2024-04-14 06:58:52.510 WARNING (MainThread) [homeassistant.components.tplink.sensor] Fetch name value for sensor.kasa_smart_plug_542b_0_kasa_smart_plug_542b_0_today_s_consumption
2024-04-14 06:58:52.510 WARNING (MainThread) [homeassistant.components.tplink.sensor] Fetch name value for sensor.kasa_smart_plug_542b_0_kasa_smart_plug_542b_0_voltage
2024-04-14 06:58:52.510 WARNING (MainThread) [homeassistant.components.tplink.sensor] Fetch name value for sensor.kasa_smart_plug_542b_0_kasa_smart_plug_542b_0_current
```
2024-04-14 20:38:28 +02:00
..
__init__.py Add empty line after module docstring [t-v] (#112705) 2024-03-08 10:35:23 -05:00
config_flow.py Ensure test async_create_task eager start behavior matches production (#115517) 2024-04-13 15:58:52 -05:00
const.py Add empty line after module docstring [t-v] (#112705) 2024-03-08 10:35:23 -05:00
coordinator.py Wrap tplink exceptions caused by user actions inside HomeAssistantError (#114919) 2024-04-08 22:35:25 -10:00
diagnostics.py Add empty line after module docstring [t-v] (#112705) 2024-03-08 10:35:23 -05:00
entity.py Wrap tplink exceptions caused by user actions inside HomeAssistantError (#114919) 2024-04-08 22:35:25 -10:00
icons.json Add icon translations to TP-Link (#112317) 2024-03-05 14:19:08 +01:00
light.py Enable Ruff PYI041 (#115229) 2024-04-08 09:29:05 -10:00
manifest.json Remove built-in support for import_executor in manifest (#112725) 2024-03-08 12:02:32 -05:00
models.py Add empty line after module docstring [t-v] (#112705) 2024-03-08 10:35:23 -05:00
sensor.py Only calculate the tplink emeter values once per update cycle (#115587) 2024-04-14 20:38:28 +02:00
services.yaml
strings.json Wrap tplink exceptions caused by user actions inside HomeAssistantError (#114919) 2024-04-08 22:35:25 -10:00
switch.py Improve lists in integrations [T-U] (#113243) 2024-03-13 17:54:46 +01:00