Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def init_all_receivers():
"""
Initialize all discovered Denon AVR receivers in LAN zone.
Returns a list of created Denon AVR instances.
By default SSDP broadcasts are sent up to 3 times with a 2 seconds timeout.
"""
receivers = discover()
init_receivers = []
for receiver in receivers:
init_receiver = DenonAVR(receiver["host"])
init_receivers.append(init_receiver)
return init_receivers
self._mute = STATE_ON
return True
else:
return False
else:
if self.send_get_command(self._urls.command_mute_off):
self._mute = STATE_OFF
return True
else:
return False
except requests.exceptions.RequestException:
_LOGGER.error("Connection error: mute command not sent.")
return False
class DenonAVRZones(DenonAVR):
"""Representing an additional zone of a Denon AVR Device."""
def __init__(self, parent_avr, zone, name):
"""
Initialize additional zones of DenonAVR.
:param parent_avr: Instance of parent DenonAVR.
:type parent_avr: denonavr.DenonAVR
:param zone: Zone name of this instance
:type zone: str
:param name: Device name, if None FriendlyName of device is used.
:type name: str
"""
self._parent_avr = parent_avr