class DoorObstructionGenerator extends AlertGenerator {

   @Override
   protected void handleModelChanged(SubsystemContext<PlaceMonitorSubsystemModel> context, Model model, AlertScratchPad scratchPad) {
      if(!MOTORIZED_DOOR.apply(model)) {
         return;
      }
      Map<String, String> errs = DeviceAdvancedModel.getErrors(model, ImmutableMap.of());
      if(errs.containsKey(ERR_KEY)) {
         scratchPad.putAlert(SmartHomeAlerts.create(
            SmartHomeAlert.ALERTTYPE_DEV_ERR_GARAGEDOOR_OBSTRUCTION,
            SmartHomeAlert.SEVERITY_CRITICAL,
            model.getAddress(),
            SmartHomeAlerts.baseDeviceAttribues(model, prodCat),
            context.getPlaceId()
         ));
      } else {
         scratchPad.removeAlert(AlertKeys.key(SmartHomeAlert.ALERTTYPE_DEV_ERR_GARAGEDOOR_OBSTRUCTION, model.getAddress()));
      }
   }

   @Inject public  DoorObstructionGenerator(ProductCatalogManager prodCat);

}