invalid literal for int() #16
Closed
opened 2023-04-10 13:39:38 +02:00 by alexduf
·
6 comments
No Branch/Tag Specified
main
v0.9
v0.8
v0.7
v0.11.0
v0.11.0-beta.1
v0.10.1
v0.10.1-beta.1
v0.10.0
v0.10.0-beta.1
v0.9.2-beta.1
v0.9.1
v0.9.1-beta.1
v0.9.0
v0.9.0-beta.10
v0.9.0-beta.9
v0.9.0-beta.8
v0.9.0-beta.7
v0.9.0-beta.6
v0.9.0-beta.5
v0.9.0-beta.4
v0.9.0-beta.3
v0.9.0-beta.2
v0.9.0-beta.1
v0.8.1
v0.8.1-beta.1
v0.8.0
v0.8.0-beta.10
v0.8.0-beta.9
v0.8.0-beta.8
v0.8.0-beta.7
v0.8.0-beta.6
v0.8.0-beta.5
v0.8.0-beta.4
v0.8.0-beta.3
v0.8.0-beta.2
v0.8.0-beta.1
v0.7.3
v0.7.3-beta.2
v0.7.3-beta.1
v0.7.2
v0.7.1
v0.7.0
v0.7.0-beta.8
v0.7.0-beta.7
v0.7.0-beta.6
v0.7.0-beta.5
v0.7.0-beta.4
v0.7.0-beta.3
v0.7.0-beta.2
v0.7.0-beta.1
v0.6.1
v0.6.0
v0.6.0-beta.8
v0.6.0-beta.7
v0.6.0-beta.6
v0.6.0-beta.5
v0.6.0-beta.4
v0.6.0-beta.3
v0.6.0-beta.2
v0.6.0-beta.1
v0.5.1
test
v0.5.1-beta.1
v0.5.0
v0.5.0-beta.5
v0.5.0-beta.4
v0.5.0-beta.3
v0.5.0-beta.2
v0.5.0-beta.1
v0.4.0
v0.3.0
v0.2.5
v0.2.4
v0.2.3
v0.2.2
v0.2.1
v0.2.0
v0.1.1
v0.1.0
Labels
Clear labels
air conditioner
air purifier
air scanner
authentication error
bug
candy
dish washer
documentation
duplicate
enhancement
fridge
good first issue
haier
help wanted
hob
hood
hoover
invalid
microwave
new appliance
oven
pyhOn
question
robot vacuum cleaner
tumble dryer
washer dryer
washing machine
water heater
wine cellar
wontfix
Air conditioner (AC)
Air purifier (AP)
Air scanner (AS)
Authentication Error
Something isn't working
Candy
Dish washer (DW)
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Fridge (REF)
Good for newcomers
Haier
Extra attention is needed
Hob (IH)
Hood (HO)
Hoover
This doesn't seem right
Microwave (MW)
New Appliance Request
Oven (OV)
Issue in pyhOn
Further information is requested
Robot vacuum cleaner (RVC)
Tumble dryer (TD)
Washer dryer (WD)
Washing machine (WM)
Water Heater (WH)
Wine Cellar (WC)
This will not be worked on
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xiconfjs/hon#16
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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.