Entity representing a Sonos number control.
| tuple[int, int] homeassistant.components.sonos.number._balance_from_number |
( |
float |
value | ) |
|
|
private |
Convert a balance value from -100 to 100 into SoCo format.
0 becomes (100, 100), fully enabling both sides. Note that
the master volume control is separate, so this does not
turn up the speakers to maximum volume. Negative values
reduce the volume of the right side, and positive values
reduce the volume of the left side. -100 becomes (100, 0),
fully muting the right side, and +100 becomes (0, 100),
muting the left side.
Definition at line 50 of file number.py.
| float homeassistant.components.sonos.number._balance_to_number |
( |
tuple[int, int] |
state | ) |
|
|
private |
Represent a balance measure returned by SoCo as a number.
SoCo returns a pair of volumes, one for the left side and one
for the right side. When the two are equal, sound is centered;
HA will show that as 0. When the left side is louder, HA will
show a negative value, and a positive value means the right
side is louder. Maximum absolute value is 100, which means only
one side produces sound at all.
Definition at line 36 of file number.py.