code: def is_powered_on(self):
          
          host = '{0}:62137'.format(self.ip)
          try:
              HTTPConnection(host, timeout=2).\
                  request('GET', '/DeviceDescription.xml')
          except (ConnectionRefusedError, socket.timeout):
              log.debug('Set-top box at %s:%s is powered off.',
                        self.ip, self.port)
  
              return False
  
          log.debug('Set-top box at %s:%s is powered on.', self.ip, self.port)
          return True
docs: Get power status of device.
  
          The set-top box can't explicitly powered on or powered off the device.
          The power can only be toggled.
  
          To find out the power status of the device a little trick is used.
          When the set-top box is powered a web server is running on port 62137
          of the device server a file at /DeviceDescription.xml. By checking if
          this file is available the power status can be determined.
  
          :return: Boolean indicitation if device is powered on.