Skip to content

Commit

Permalink
Fix errors for Viomi vacuums
Browse files Browse the repository at this point in the history
  • Loading branch information
PiotrMachowski committed Jul 9, 2021
1 parent 9f2a409 commit 844a7f9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def image_to_map(x):
@staticmethod
def get_current_vacuum_room(buf: ParsingBuffer, vacuum_position: Point) -> Optional[int]:
vacuum_position_on_image = MapDataParserViomi.map_to_image(vacuum_position)
pixel_type = buf.get_at_image(vacuum_position_on_image.y * 800 + vacuum_position_on_image.x)
pixel_type = buf.get_at_image(int(vacuum_position_on_image.y) * 800 + int(vacuum_position_on_image.x))
if ImageHandlerViomi.MAP_ROOM_MIN <= pixel_type <= ImageHandlerViomi.MAP_ROOM_MAX:
return pixel_type
elif ImageHandlerViomi.MAP_SELECTED_ROOM_MIN <= pixel_type <= ImageHandlerViomi.MAP_SELECTED_ROOM_MAX:
Expand Down

0 comments on commit 844a7f9

Please sign in to comment.