File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
homeassistant/components/sonos Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -410,7 +410,7 @@ def volume_down(self) -> None:
410410 @soco_error ()
411411 def set_volume_level (self , volume : float ) -> None :
412412 """Set volume level, range 0..1."""
413- self .soco .volume = int (volume * 100 )
413+ self .soco .volume = int (round ( volume * 100 ) )
414414
415415 @soco_error (UPNP_ERRORS_TO_IGNORE )
416416 def set_shuffle (self , shuffle : bool ) -> None :
Original file line number Diff line number Diff line change @@ -1101,11 +1101,11 @@ async def test_volume(
11011101 await hass .services .async_call (
11021102 MP_DOMAIN ,
11031103 SERVICE_VOLUME_SET ,
1104- {ATTR_ENTITY_ID : "media_player.zone_a" , ATTR_MEDIA_VOLUME_LEVEL : 0.30 },
1104+ {ATTR_ENTITY_ID : "media_player.zone_a" , ATTR_MEDIA_VOLUME_LEVEL : 0.57 },
11051105 blocking = True ,
11061106 )
11071107 # SoCo uses 0..100 for its range.
1108- assert soco .volume == 30
1108+ assert soco .volume == 57
11091109
11101110
11111111@pytest .mark .parametrize (
You can’t perform that action at this time.
0 commit comments