Git Product home page Git Product logo

Comments (5)

tjorim avatar tjorim commented on September 24, 2024

#124 (comment)

It is the zlib_ng implemented in the connector.py will work on it later today.

https://github.com/sca075/valetudo_vacuum_camera/blob/d8a090b0d7a4c5b8f75ea87418bab8ba208555f1/custom_components/valetudo_vacuum_camera/valetudo/MQTT/connector.py#L14-L15

#124 (comment)

Changes related to the zlib_ng: home-assistant/core#115767, and afterwards home-assistant/core#115777.

#124 (comment)

I thought it would be as simple as changing those lines from

 from zlib_ng import gzip_ng as gzip
 from zlib_ng import zlib_ng as zlib

to

from isal import igzip as gzip
from isal import isal_zlib as zlib

but now getting this error:

Logger: homeassistant.util.logging
Source: util/logging.py:98
First occurred: 12:55:18 (2 occurrences)
Last logged: 12:55:44

Exception in async_message_received when handling msg on 'valetudo/Alfred/BatteryStateAttribute/level': '99' Traceback (most recent call last): File "/config/custom_components/valetudo_vacuum_camera/valetudo/MQTT/connector.py", line 322, in async_message_received await self.hypfer_handle_battery_level(msg) File "/config/custom_components/valetudo_vacuum_camera/valetudo/MQTT/connector.py", line 208, in hypfer_handle_battery_level self._mqtt_vac_battery_level = int(bytes.decode(self._payload, "utf-8")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: descriptor 'decode' for 'bytes' objects doesn't apply to a 'str' object
Exception in async_message_received when handling msg on 'valetudo/Alfred/BatteryStateAttribute/level': '98' Traceback (most recent call last): File "/config/custom_components/valetudo_vacuum_camera/valetudo/MQTT/connector.py", line 322, in async_message_received await self.hypfer_handle_battery_level(msg) File "/config/custom_components/valetudo_vacuum_camera/valetudo/MQTT/connector.py", line 208, in hypfer_handle_battery_level self._mqtt_vac_battery_level = int(bytes.decode(self._payload, "utf-8")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: descriptor 'decode' for 'bytes' objects doesn't apply to a 'str' object

from valetudo_vacuum_camera.

sca075 avatar sca075 commented on September 24, 2024

@tjorim
Please replace the lines in the connector.py with a simple
import gzip
import zlib

This solves the issue;)

from valetudo_vacuum_camera.

sca075 avatar sca075 commented on September 24, 2024

@tjorim done on the main, will publish the fix after a short test.

from valetudo_vacuum_camera.

tjorim avatar tjorim commented on September 24, 2024

Working well for me.
Closed by c0718c5.

from valetudo_vacuum_camera.

sca075 avatar sca075 commented on September 24, 2024

@tjorim I made some additional test with the isal, and I got the same error you had with the '''BatteryStateAttribute'' the issue was in the bytes decode that of course can be done automatically by simply converting the bytes to int when I will release the new version of the camera in the connector.py we can use the isal library (that performance wise is faster then gzip and zlib python embed libs.. of course there is the need to do more tests on it.
Once again thank you really much for the help and you are welcome to contribute at any time. I do really appreciate your kind cooperation.

from valetudo_vacuum_camera.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.