code: def state(self) -> str:
          
          return self._coerce_state_from_string(
              next(
                  attr['Value'] for attr in self._device_json.get(
                      'Attributes', [])
                  if attr.get('AttributeDisplayName') == 'doorstate'))
docs: Return the current state of the device (if it exists).