Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for sensor.water_counter fails #13

Open
Spirituss opened this issue Dec 12, 2021 · 0 comments
Open

Update for sensor.water_counter fails #13

Spirituss opened this issue Dec 12, 2021 · 0 comments

Comments

@Spirituss
Copy link

Регулярно лог заваливает такой ошибкой по обновлению данных счетчиков:

2021-12-12 09:15:36 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.cold_water_counter fails
Traceback (most recent call last):
  File "/config/custom_components/moscow_pgu/api.py", line 233, in uncached_request
    response = loads(response_text)
  File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 438, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 625, in async_device_update
    raise exc
  File "/config/custom_components/moscow_pgu/sensor.py", line 1105, in async_update
    water_counters = await self.source.api.get_water_counters(flat_id=self.source.flat_id)
  File "/config/custom_components/moscow_pgu/api.py", line 465, in get_water_counters
    result = await self.request(
  File "/config/custom_components/moscow_pgu/api.py", line 286, in request
    return await self.__futures[cache_idx]
  File "/config/custom_components/moscow_pgu/sensor.py", line 1105, in async_update
    water_counters = await self.source.api.get_water_counters(flat_id=self.source.flat_id)
  File "/config/custom_components/moscow_pgu/api.py", line 465, in get_water_counters
    result = await self.request(
  File "/config/custom_components/moscow_pgu/api.py", line 286, in request
    return await self.__futures[cache_idx]
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 438, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 625, in async_device_update
    raise exc
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 438, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 625, in async_device_update
    raise exc
  File "/config/custom_components/moscow_pgu/sensor.py", line 1105, in async_update
    water_counters = await self.source.api.get_water_counters(flat_id=self.source.flat_id)
  File "/config/custom_components/moscow_pgu/api.py", line 465, in get_water_counters
    result = await self.request(
  File "/config/custom_components/moscow_pgu/api.py", line 286, in request
    return await self.__futures[cache_idx]
  File "/config/custom_components/moscow_pgu/sensor.py", line 1105, in async_update
    water_counters = await self.source.api.get_water_counters(flat_id=self.source.flat_id)
  File "/config/custom_components/moscow_pgu/api.py", line 465, in get_water_counters
    result = await self.request(
  File "/config/custom_components/moscow_pgu/api.py", line 286, in request
    return await self.__futures[cache_idx]
  File "/config/custom_components/moscow_pgu/_base.py", line 299, in async_refresh_entities
    objs = await cls.async_get_objects_for_update(
  File "/config/custom_components/moscow_pgu/sensor.py", line 1007, in async_get_objects_for_update
    *(await asyncio.gather(*(flat.get_water_counters() for flat in flats_with_water)))
  File "/config/custom_components/moscow_pgu/api.py", line 1564, in get_water_counters
    return await self.api.get_water_counters(self.id)
  File "/config/custom_components/moscow_pgu/api.py", line 465, in get_water_counters
    result = await self.request(
  File "/config/custom_components/moscow_pgu/api.py", line 286, in request
    return await self.__futures[cache_idx]
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 438, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 625, in async_device_update
    raise exc
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 438, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 625, in async_device_update
    raise exc
  File "/config/custom_components/moscow_pgu/sensor.py", line 1105, in async_update
    water_counters = await self.source.api.get_water_counters(flat_id=self.source.flat_id)
  File "/config/custom_components/moscow_pgu/api.py", line 465, in get_water_counters
    result = await self.request(
  File "/config/custom_components/moscow_pgu/api.py", line 286, in request
    return await self.__futures[cache_idx]
  File "/config/custom_components/moscow_pgu/sensor.py", line 1105, in async_update
    water_counters = await self.source.api.get_water_counters(flat_id=self.source.flat_id)
  File "/config/custom_components/moscow_pgu/api.py", line 465, in get_water_counters
    result = await self.request(
  File "/config/custom_components/moscow_pgu/api.py", line 286, in request
    return await self.__futures[cache_idx]
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 438, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 625, in async_device_update
    raise exc
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 438, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 625, in async_device_update
    raise exc
  File "/config/custom_components/moscow_pgu/sensor.py", line 1105, in async_update
    water_counters = await self.source.api.get_water_counters(flat_id=self.source.flat_id)
  File "/config/custom_components/moscow_pgu/api.py", line 465, in get_water_counters
    result = await self.request(
  File "/config/custom_components/moscow_pgu/api.py", line 286, in request
    return await self.__futures[cache_idx]
  File "/config/custom_components/moscow_pgu/sensor.py", line 1105, in async_update
    water_counters = await self.source.api.get_water_counters(flat_id=self.source.flat_id)
  File "/config/custom_components/moscow_pgu/api.py", line 465, in get_water_counters
    result = await self.request(
  File "/config/custom_components/moscow_pgu/api.py", line 286, in request
    return await self.__futures[cache_idx]
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 438, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 625, in async_device_update
    raise exc
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 438, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 625, in async_device_update
    raise exc
  File "/config/custom_components/moscow_pgu/sensor.py", line 1105, in async_update
    water_counters = await self.source.api.get_water_counters(flat_id=self.source.flat_id)
  File "/config/custom_components/moscow_pgu/api.py", line 465, in get_water_counters
    result = await self.request(
  File "/config/custom_components/moscow_pgu/api.py", line 286, in request
    return await self.__futures[cache_idx]
  File "/config/custom_components/moscow_pgu/sensor.py", line 1105, in async_update
    water_counters = await self.source.api.get_water_counters(flat_id=self.source.flat_id)
  File "/config/custom_components/moscow_pgu/api.py", line 465, in get_water_counters
    result = await self.request(
  File "/config/custom_components/moscow_pgu/api.py", line 286, in request
    return await self.__futures[cache_idx]
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 438, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 625, in async_device_update
    raise exc
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 438, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 625, in async_device_update
    raise exc
  File "/config/custom_components/moscow_pgu/sensor.py", line 1105, in async_update
    water_counters = await self.source.api.get_water_counters(flat_id=self.source.flat_id)
  File "/config/custom_components/moscow_pgu/api.py", line 465, in get_water_counters
    result = await self.request(
  File "/config/custom_components/moscow_pgu/api.py", line 286, in request
    return await self.__futures[cache_idx]
  File "/config/custom_components/moscow_pgu/sensor.py", line 1105, in async_update
    water_counters = await self.source.api.get_water_counters(flat_id=self.source.flat_id)
  File "/config/custom_components/moscow_pgu/api.py", line 465, in get_water_counters
    result = await self.request(
  File "/config/custom_components/moscow_pgu/api.py", line 286, in request
    return await self.__futures[cache_idx]
  File "/config/custom_components/moscow_pgu/_base.py", line 299, in async_refresh_entities
    objs = await cls.async_get_objects_for_update(
  File "/config/custom_components/moscow_pgu/sensor.py", line 1007, in async_get_objects_for_update
    *(await asyncio.gather(*(flat.get_water_counters() for flat in flats_with_water)))
  File "/config/custom_components/moscow_pgu/api.py", line 1564, in get_water_counters
    return await self.api.get_water_counters(self.id)
  File "/config/custom_components/moscow_pgu/api.py", line 465, in get_water_counters
    result = await self.request(
  File "/config/custom_components/moscow_pgu/api.py", line 286, in request
    return await self.__futures[cache_idx]
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 438, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 625, in async_device_update
    raise exc
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 438, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 625, in async_device_update
    raise exc
  File "/config/custom_components/moscow_pgu/sensor.py", line 1105, in async_update
    water_counters = await self.source.api.get_water_counters(flat_id=self.source.flat_id)
  File "/config/custom_components/moscow_pgu/api.py", line 465, in get_water_counters
    result = await self.request(
  File "/config/custom_components/moscow_pgu/api.py", line 286, in request
    return await self.__futures[cache_idx]
  File "/config/custom_components/moscow_pgu/sensor.py", line 1105, in async_update
    water_counters = await self.source.api.get_water_counters(flat_id=self.source.flat_id)
  File "/config/custom_components/moscow_pgu/api.py", line 465, in get_water_counters
    result = await self.request(
  File "/config/custom_components/moscow_pgu/api.py", line 286, in request
    return await self.__futures[cache_idx]
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 438, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 625, in async_device_update
    raise exc
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 438, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 625, in async_device_update
    raise exc
  File "/config/custom_components/moscow_pgu/sensor.py", line 1105, in async_update
    water_counters = await self.source.api.get_water_counters(flat_id=self.source.flat_id)
  File "/config/custom_components/moscow_pgu/api.py", line 465, in get_water_counters
    result = await self.request(
  File "/config/custom_components/moscow_pgu/api.py", line 286, in request
    return await self.__futures[cache_idx]
  File "/config/custom_components/moscow_pgu/sensor.py", line 1105, in async_update
    water_counters = await self.source.api.get_water_counters(flat_id=self.source.flat_id)
  File "/config/custom_components/moscow_pgu/api.py", line 465, in get_water_counters
    result = await self.request(
  File "/config/custom_components/moscow_pgu/api.py", line 286, in request
    return await self.__futures[cache_idx]
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 438, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 625, in async_device_update
    raise exc
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 438, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 625, in async_device_update
    raise exc
  File "/config/custom_components/moscow_pgu/sensor.py", line 1105, in async_update
    water_counters = await self.source.api.get_water_counters(flat_id=self.source.flat_id)
  File "/config/custom_components/moscow_pgu/api.py", line 465, in get_water_counters
    result = await self.request(
  File "/config/custom_components/moscow_pgu/api.py", line 286, in request
    return await self.__futures[cache_idx]
  File "/config/custom_components/moscow_pgu/sensor.py", line 1105, in async_update
    water_counters = await self.source.api.get_water_counters(flat_id=self.source.flat_id)
  File "/config/custom_components/moscow_pgu/api.py", line 465, in get_water_counters
    result = await self.request(
  File "/config/custom_components/moscow_pgu/api.py", line 297, in request
    raise cache_future.exception()
  File "/config/custom_components/moscow_pgu/api.py", line 293, in request
    result = await self.uncached_request(sub_url, json=json)
  File "/config/custom_components/moscow_pgu/api.py", line 236, in uncached_request
    raise DataParsingError("Could not decode JSON response: %s" % (e,))
custom_components.moscow_pgu.api.DataParsingError: Data decoding error [-1]: Could not decode JSON response: Expecting value: line 1 column 1 (char 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant