snarky-snark / home-assistant-variables

A custom Home Assistant component for declaring and setting generic variable entities dynamically.
Apache License 2.0
274 stars 16 forks source link

Issue detected by HA #102

Closed popsyann closed 9 months ago

popsyann commented 1 year ago

Here is a log issued by Home Assistant (version 2023.7.1):

Logger: homeassistant.helpers.entity Source: helpers/entity.py:701 First occurred: 10:40:10 (4 occurrences) Last logged: 10:54:18

Entity var.living_room_temperature (<class 'custom_components.var.Variable'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please report it to the custom integration author. Entity var.master_bedroom_temperature (<class 'custom_components.var.Variable'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please report it to the custom integration author. Entity var.erwan_bedroom_temperature (<class 'custom_components.var.Variable'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please report it to the custom integration author. Entity var.bitcoin_total_initial_value (<class 'custom_components.var.Variable'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please report it to the custom integration author.

Foguet commented 1 year ago

Hi! I have the same problem. How I can help to fix it? Thanks in advance

ercsey commented 1 year ago

I made some changes for my own and created a pull request #100 but it was not yet merged. After the the changes I do not had any issues.

pdwonline commented 1 year ago

pull request #100 but it was not yet merged

Did you see the questions posted by @snarky-snark ? Could you please answer these to get this merged?

lloyda commented 11 months ago

@ercsey Be good if you could respond to @snarky-snark's questions. Would love to stop these errors filling my logfile.

ercsey commented 11 months ago

Hello. Sorry for late response. First of all I am not @ercsey, but his brother. He is in hospital. He sees the message but unable to respond. I am interpreting what he said: "I am not a programmer. I saw this solution on other github repo and made the changes for my self. After I've seen that the error messages are gone and the integration is working fine I made the changes and the pull request." Sorry for this long waiting.

danielbrunt57 commented 10 months ago

I created a new pull request https://github.com/snarky-snark/home-assistant-variables/pull/103 which is slightly different than pull request https://github.com/snarky-snark/home-assistant-variables/pull/100. I also am not a python programmer so I do not know the absolute correct way of fixing this but my PR has eliminated the error message and the var integration is working for me. All I had to change was line 448: await self.async_update_ha_state() --> await self.async_update_ha_state(True)