Giter Site home page Giter Site logo

[BUG] After removing and re-adding integration, TypeError: unsupported operand type(s) for -: 'int' and 'NoneType' about simple-wyze-vac HOT 7 CLOSED

romedtino avatar romedtino commented on May 27, 2024
[BUG] After removing and re-adding integration, TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'

from simple-wyze-vac.

Comments (7)

romedtino avatar romedtino commented on May 27, 2024

1.6.202 is the max I can personally support in regards to Wyze Firmware Version. I would need someone else who has 1.6.306 to do the testing to fix this sort of issue. And I don't know if the error you see is the only one as well.

It seems on 1.6.306, the variable self.usage is no longer populated. This might be better off as an issue to file against https://github.com/shauntarves/wyze-sdk to either capture cases where self._usage is None and convert it to an int prior to subtracting or guarantee it to be an int? Or dig out the correct new way to get usage value out

If you're savvy enough, you can remote into your Home Assistant instance, go to /usr/local/lib/python3.10/site-packages/wyze_sdk/models/devices/vacuums.py and change line 970 from

self.type.max_hours - self.usage

to

self.type.max_hours - int(self.usage or 0)

Then reboot HA and see if Simple Wyze Vac gets further in the initialization process. But keep in mind, your vacuum will just always return max hours since it could not actually query actual usage.

from simple-wyze-vac.

SpartanTech avatar SpartanTech commented on May 27, 2024

1.6.202 is the max I can personally support in regards to Wyze Firmware Version. I would need someone else who has 1.6.306 to do the testing to fix this sort of issue. And I don't know if the error you see is the only one as well.

It seems on 1.6.306, the variable self.usage is no longer populated. This might be better off as an issue to file against https://github.com/shauntarves/wyze-sdk to either capture cases where self._usage is None and convert it to an int prior to subtracting or guarantee it to be an int? Or dig out the correct new way to get usage value out

If you're savvy enough, you can remote into your Home Assistant instance, go to /usr/local/lib/python3.10/site-packages/wyze_sdk/models/devices/vacuums.py and change line 970 from

self.type.max_hours - self.usage

to

self.type.max_hours - int(self.usage or 0)

Then reboot HA and see if Simple Wyze Vac gets further in the initialization process. But keep in mind, your vacuum will just always return max hours since it could not actually query actual usage.

That's what I thought, it didn't notify me it updated, I guess it must have updated since the last time I added the integration.

Thanks a bunch for the quick reply. Musician for the last 10 years, but I graduated computer science, so as long as I'm pointed in the right direction I can usually handle it myself 🤣, thanks for the nudge. I'll take a look at that file when I get home.

If you need any data from something specific, I can provide that as well no problem.

from simple-wyze-vac.

SpartanTech avatar SpartanTech commented on May 27, 2024

1.6.202 is the max I can personally support in regards to Wyze Firmware Version. I would need someone else who has 1.6.306 to do the testing to fix this sort of issue. And I don't know if the error you see is the only one as well.
It seems on 1.6.306, the variable self.usage is no longer populated. This might be better off as an issue to file against https://github.com/shauntarves/wyze-sdk to either capture cases where self._usage is None and convert it to an int prior to subtracting or guarantee it to be an int? Or dig out the correct new way to get usage value out
If you're savvy enough, you can remote into your Home Assistant instance, go to /usr/local/lib/python3.10/site-packages/wyze_sdk/models/devices/vacuums.py and change line 970 from

self.type.max_hours - self.usage

to

self.type.max_hours - int(self.usage or 0)

Then reboot HA and see if Simple Wyze Vac gets further in the initialization process. But keep in mind, your vacuum will just always return max hours since it could not actually query actual usage.

That's what I thought, it didn't notify me it updated, I guess it must have updated since the last time I added the integration.

Thanks a bunch for the quick reply. Musician for the last 10 years, but I graduated computer science, so as long as I'm pointed in the right direction I can usually handle it myself 🤣, thanks for the nudge. I'll take a look at that file when I get home.

If you need any data from something specific, I can provide that as well no problem.

I had to edit home assistant directly via docker, but I found the file and modified it. It works just perfect now, that was the exact issue!

Do you know what would reset the file change? Would a wise vacuum update, a home assistant update, or system reboot reset that file?

from simple-wyze-vac.

SpartanTech avatar SpartanTech commented on May 27, 2024

No one happens to have any experience with docker modifications do they? After I edited the file, home assistant updated and removed the edit. I'm guessing I need to edit a different file or clonr my own sdk? What's the easiest way for that line change to be persistent

from simple-wyze-vac.

romedtino avatar romedtino commented on May 27, 2024

Unfortunately whenever HA updates, it will essentially pull fresh copies of the addons and all that. So everytime HA updates, you would have to change it. It should at least persist on reboots.

So did that change work for you? With that workaround, have you tried to see if the rest of the functionality is there (start vac/pause vac/go dock/etc.)? If so, I wouldn't mind updating the version of wyze-sdk I use to add that int check. Let me know 👍

from simple-wyze-vac.

SpartanTech avatar SpartanTech commented on May 27, 2024

Ah I see. Yeah, editing the file allows the integration to load and show the map, but other things fail. Starting, Stopping, and Docking commands work, but show Error on Home Assistant (as if it didnt work). Polling also gives errors when enabled. So in short, sends the commands ok seems like but room selection cleaning and receiving data back shows an Error on home assistant side.
image

I can try to investigate on my own and give a log or something that might help. If you have any nudges or tips on where to look or what to enable to view the actual debug log, let me know!

HA Log shows:
image

from simple-wyze-vac.

romedtino avatar romedtino commented on May 27, 2024

The error states returned should be addressed in this release - https://github.com/romedtino/simple-wyze-vac/releases/tag/1.8.3

(you can try it if you enable show beta releases on HACS -> Simple Wyze Vac)

Issue was Wyze added new names for states and they were not accounted for.

from simple-wyze-vac.

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.