invalid literal for int() #16
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi I’ve just connected a dishwasher for fun an giggles, here’s the stack trace I’m getting.
I’m guessing one of the sensors is expecting an int when the server is returning a float
Hi, I fixed it and cast it to a float now. I created a new beta release
v0.5.0-beta.2.Whoops I messed up, please try version
v0.5.0-beta.3🙂Hey thanks for your quick responses!
Something that worries me a little and that I noticed later was how the value is using a coma instead of a dot to separate digits.
ValueError: invalid literal for int() with base 10: '0,5'I’m in France and I’m wondering if the server is formatting that to whatever locale the user is in (we would format it
0,5in France as opposed to0.5in the US). Yesterday I hacked around and got it to work by casting to floats as you did, but I also had to replace,with., which felt very hack-ish because if it were indeed formatting to a specific locale then the parsing might be more complicated :/Hey, I take care of it and also used a replace. I saw this and found it also a little strange why they localize the api values. But here in Germany we also use comma as separator and I know these formatting problems well. I think this isn’t going to be a big problem when using the replace, if it’s already a dot than just nothing gets replaced. For my washing machine there is a delay parameter with values that can go above 1000 and they doesn’t use a thousand separator there, so I think this also wouldn’t be a problem.
Brilliant, I’ll test your patch tonight, thanks for your help!
Hey thanks, I can confirm the fix works. I’ll look into supporting DW devices though I can’t promise anything.